worlds

package
v1.30.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2023 License: GPL-3.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const ViewMapID = 0x424242

Variables

View Source
var MapItemPacket = packet.InventoryContent{
	WindowID: 119,
	Content: []protocol.ItemInstance{
		{
			StackNetworkID: 1,
			Stack: protocol.ItemStack{
				ItemType: protocol.ItemType{
					NetworkID:     420,
					MetadataValue: 0,
				},
				BlockRuntimeID: 0,
				Count:          1,
				NBTData: map[string]interface{}{
					"map_name_index": int64(1),
					"map_uuid":       int64(ViewMapID),
				},
			},
		},
	},
}

MapItemPacket tells the client that it has a map with id 0x424242 in the offhand

Functions

func NewWorldsHandler

func NewWorldsHandler(ctx context.Context, ui utils.UI, settings WorldSettings) *utils.ProxyHandler

Types

type MapUI

type MapUI struct {
	// contains filtered or unexported fields
}

func NewMapUI

func NewMapUI(w *worldsHandler) *MapUI

func (*MapUI) ChangeZoom

func (m *MapUI) ChangeZoom()

ChangeZoom adds to the zoom value and goes around to 32 once it hits 128

func (*MapUI) GetBounds

func (m *MapUI) GetBounds() (min, max protocol.ChunkPos)

func (*MapUI) Redraw

func (m *MapUI) Redraw()

Redraw draws chunk images to the map image

func (*MapUI) Reset

func (m *MapUI) Reset()

Reset resets the map to inital state

func (*MapUI) SchedRedraw

func (m *MapUI) SchedRedraw()

SchedRedraw tells the map to redraw the next time its sent

func (*MapUI) SetChunk

func (m *MapUI) SetChunk(pos world.ChunkPos, ch *chunk.Chunk, complete bool)

func (*MapUI) Start

func (m *MapUI) Start()

func (*MapUI) Stop

func (m *MapUI) Stop()

func (*MapUI) ToImage

func (m *MapUI) ToImage() *image.RGBA

type RenderElem

type RenderElem struct {
	// contains filtered or unexported fields
}

type TPlayerPos

type TPlayerPos struct {
	Position mgl32.Vec3
	Pitch    float32
	Yaw      float32
	HeadYaw  float32
}

type WorldSettings

type WorldSettings struct {
	// settings
	VoidGen         bool
	WithPacks       bool
	SaveImage       bool
	SaveEntities    bool
	SaveInventories bool
	BlockUpdates    bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL