worldstate

package
v1.42.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: GPL-3.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chunk added in v1.42.0

type Chunk struct {
	*chunk.Chunk
	BlockEntities map[cube.Pos]map[string]any
}

type Map added in v1.37.0

type Map struct {
	Decorations       []any            `nbt:"decorations"`
	Dimension         uint8            `nbt:"dimension"`
	Height            int16            `nbt:"height"`
	Width             int16            `nbt:"width"`
	MapID             int64            `nbt:"mapId"`
	Scale             uint8            `nbt:"scale"`
	UnlimitedTracking bool             `nbt:"unlimitedTracking"`
	ZCenter           int32            `nbt:"zCenter"`
	XCenter           int32            `nbt:"xCenter"`
	FullyExplored     bool             `nbt:"fullyExplored"`
	ParentMapId       int64            `nbt:"parentMapId"`
	Colors            [0xffff + 1]byte `nbt:"colors"`
	MapLocked         bool             `nbt:"mapLocked"`
}

type World

type World struct {
	// called when a chunk is added
	ChunkFunc func(world.ChunkPos, *chunk.Chunk)

	BlockRegistry world.BlockRegistry
	BiomeRegistry *world.BiomeRegistry

	StoredChunks map[world.ChunkPos]bool

	ResourcePacks []resource.Pack

	VoidGen bool

	Name   string
	Folder string

	UseHashedRids bool

	IgnoredChunks map[world.ChunkPos]bool
	// contains filtered or unexported fields
}

func New

func New(dimensionDefinitions map[int]protocol.DimensionDefinition, onChunkUpdate func(pos world.ChunkPos, chunk *chunk.Chunk, isPaused bool)) (*World, error)
func (w *World) AddEntityLink(el protocol.EntityLink)

func (*World) AddPlayer added in v1.33.0

func (w *World) AddPlayer(pk *packet.AddPlayer)

func (*World) BlockByID added in v1.39.1

func (w *World) BlockByID(rid uint32) (runtimeID uint32, name string, properties map[string]any, found bool)

func (*World) Dimension

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

func (*World) EntityCount added in v1.33.0

func (w *World) EntityCount() int

func (*World) FinalizePacks added in v1.39.1

func (w *World) FinalizePacks(addBehaviorPack func(fs utils.WriterFS) (*resource.Header, error)) error

func (*World) Finish

func (w *World) Finish(playerData map[string]any, excludedMobs []string, withPlayers bool, spawn cube.Pos, gd minecraft.GameData, experimental bool) error

func (*World) GetEntity

func (w *World) GetEntity(id entity.RuntimeID) *entity.Entity

func (*World) GetEntityUniqueID added in v1.39.1

func (w *World) GetEntityUniqueID(id entity.UniqueID) *entity.Entity

func (*World) IsPaused added in v1.33.1

func (w *World) IsPaused() bool

func (*World) LoadChunk

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

func (*World) Open

func (w *World) Open(name string, folder string, deferred bool)

func (*World) PauseCapture

func (w *World) PauseCapture()

func (*World) QueueBlockUpdate added in v1.39.0

func (w *World) QueueBlockUpdate(pos protocol.BlockPos, ridTo uint32, layer uint8)

func (*World) Range added in v1.33.1

func (w *World) Range() cube.Range

func (*World) Rename

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

Rename moves the folder and reopens it

func (*World) SetBlockNBT

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

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) (err error)

func (*World) StoreEntity

func (w *World) StoreEntity(id entity.RuntimeID, es *entity.Entity)

func (*World) StoreMap added in v1.37.0

func (w *World) StoreMap(m *packet.ClientBoundMapItemData)

func (*World) UnpauseCapture

func (w *World) UnpauseCapture(around cube.Pos, radius int32)

Jump to

Keyboard shortcuts

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