worldstate

package
v1.32.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DummyBlock

type DummyBlock struct {
	ID  string
	NBT map[string]any
}

func (*DummyBlock) Color

func (d *DummyBlock) Color() color.RGBA

func (*DummyBlock) DecodeNBT

func (d *DummyBlock) DecodeNBT(data map[string]any) any

func (*DummyBlock) EncodeBlock

func (d *DummyBlock) EncodeBlock() (string, map[string]any)

func (*DummyBlock) EncodeNBT

func (d *DummyBlock) EncodeNBT() map[string]any

func (*DummyBlock) Hash

func (d *DummyBlock) Hash() uint64

func (*DummyBlock) Model

func (d *DummyBlock) Model() world.BlockModel

type EntityRuntimeID

type EntityRuntimeID = uint64

type EntityState

type EntityState struct {
	RuntimeID  uint64
	UniqueID   int64
	EntityType string

	Position         mgl32.Vec3
	Pitch, Yaw       float32
	HeadYaw, BodyYaw float32
	Velocity         mgl32.Vec3

	Metadata  protocol.EntityMetadata
	Inventory map[byte]map[byte]protocol.ItemInstance

	Helmet     *protocol.ItemInstance
	Chestplate *protocol.ItemInstance
	Leggings   *protocol.ItemInstance
	Boots      *protocol.ItemInstance
}

func (*EntityState) ToServerEntity

func (s *EntityState) ToServerEntity(links []int64) serverEntity

type EntityUniqueID

type EntityUniqueID = int64

type World

type World struct {
	StoredChunks map[world.ChunkPos]bool

	VoidGen bool

	Name   string
	Folder string
	// contains filtered or unexported fields
}

func New

func New(cf func(world.ChunkPos, *chunk.Chunk)) (*World, error)
func (w *World) AddEntityLink(el protocol.EntityLink)

func (*World) Dimension

func (w *World) Dimension() world.Dimension

func (*World) Finish

func (w *World) Finish(playerData map[string]any, excludedMobs []string, spawn cube.Pos, gd minecraft.GameData, bp *behaviourpack.BehaviourPack) error

func (*World) GetEntity

func (w *World) GetEntity(id EntityRuntimeID) (*EntityState, bool)

func (*World) IsDeferred

func (w *World) IsDeferred() bool

func (*World) LoadChunk

func (m *World) LoadChunk(pos world.ChunkPos) (*chunk.Chunk, bool, error)

func (*World) Open

func (w *World) Open(name string, folder string, dim world.Dimension, deferred bool) (err error)

func (*World) PauseCapture

func (w *World) PauseCapture()

func (*World) ProcessAddActor

func (w *World) ProcessAddActor(pk *packet.AddActor, ignoreCB func(*EntityState) bool, bpCB func(behaviourpack.EntityIn))

func (*World) Rename

func (w *World) Rename(name, folder string) error

func (*World) SetBlockNBT

func (w *World) SetBlockNBT(pos cube.Pos, nbt map[string]any, merge bool)

func (*World) SetDimension

func (w *World) SetDimension(dim world.Dimension)

func (*World) SetTime

func (w *World) SetTime(real time.Time, ingame int)

func (*World) StoreChunk

func (w *World) StoreChunk(pos world.ChunkPos, ch *chunk.Chunk, blockNBT map[cube.Pos]DummyBlock)

func (*World) StoreEntity

func (w *World) StoreEntity(id EntityRuntimeID, es *EntityState)

func (*World) UnpauseCapture

func (w *World) UnpauseCapture(around cube.Pos, radius int32, cf func(world.ChunkPos, *chunk.Chunk))

Jump to

Keyboard shortcuts

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