world

package
v1.24.12 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2022 License: GPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const VIEW_MAP_ID = 0x424242

Variables

View Source
var MAP_ITEM_PACKET packet.InventoryContent = 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_uuid": int64(VIEW_MAP_ID),
				},
			},
		},
	},
}

packet to tell the client that it has a map with id 0x424242 in the offhand

View Source
var (
	Offset_table [24]protocol.SubChunkOffset
)

Functions

func Chunk2Img

func Chunk2Img(c *chunk.Chunk) *image.RGBA

Types

type MapUI

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

func NewMapUI

func NewMapUI(w *WorldState) *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) Redraw

func (m *MapUI) Redraw()

draw 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 protocol.ChunkPos, ch *chunk.Chunk)

func (*MapUI) Start

func (m *MapUI) Start()

func (*MapUI) Stop

func (m *MapUI) Stop()

func (*MapUI) ToImage added in v1.24.12

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 WorldCMD

type WorldCMD struct {
	Address string
	// contains filtered or unexported fields
}

func (*WorldCMD) Execute

func (c *WorldCMD) Execute(ctx context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus

func (*WorldCMD) Name

func (*WorldCMD) Name() string

func (*WorldCMD) SetFlags

func (p *WorldCMD) SetFlags(f *flag.FlagSet)

func (*WorldCMD) Synopsis

func (*WorldCMD) Synopsis() string

func (*WorldCMD) Usage

func (c *WorldCMD) Usage() string

type WorldState

type WorldState struct {
	Dim        world.Dimension
	WorldName  string
	ServerName string

	PlayerPos TPlayerPos
	// contains filtered or unexported fields
}

func NewWorldState

func NewWorldState() *WorldState

func (*WorldState) OnConnect

func (w *WorldState) OnConnect(proxy *utils.ProxyContext)

func (*WorldState) ProcessAnimate

func (w *WorldState) ProcessAnimate(pk *packet.Animate)

func (*WorldState) ProcessChangeDimension

func (w *WorldState) ProcessChangeDimension(pk *packet.ChangeDimension)

func (*WorldState) ProcessLevelChunk

func (w *WorldState) ProcessLevelChunk(pk *packet.LevelChunk)

func (*WorldState) ProcessPacketClient

func (w *WorldState) ProcessPacketClient(pk packet.Packet) (packet.Packet, bool)

func (*WorldState) ProcessPacketServer

func (w *WorldState) ProcessPacketServer(pk packet.Packet) (packet.Packet, bool)

func (*WorldState) ProcessSubChunk

func (w *WorldState) ProcessSubChunk(pk *packet.SubChunk)

func (*WorldState) Reset

func (w *WorldState) Reset()

func (*WorldState) SaveAndReset

func (w *WorldState) SaveAndReset()

writes the world to a folder, resets all the chunks

func (*WorldState) SetPlayerPos

func (w *WorldState) SetPlayerPos(Position mgl32.Vec3, Pitch, Yaw, HeadYaw float32)

Jump to

Keyboard shortcuts

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