Versions in this module Expand all Collapse all v0 v0.0.4 Jan 4, 2021 Changes in this version + func BlockRuntimeID(b Block) (uint32, bool) + func Distance(a, b mgl64.Vec3) float64 + func RegisterBlock(b Block, s BlockState) error + func RegisterBlockState(s BlockState) error + func RegisterItem(name string, item Item) + type Axis int + const X + const Y + const Z + func (a Axis) FromString(s string) (interface{}, error) + func (a Axis) String() string + type Block interface + HasNBT func() bool + Model func() BlockModel + type BlockModel interface + AABB func(pos BlockPos, w *World) []physics.AABB + FaceSolid func(pos BlockPos, face Face, w *World) bool + type BlockPos [3]int + func BlockPosFromVec3(vec3 mgl64.Vec3) BlockPos + func (p BlockPos) Add(pos BlockPos) BlockPos + func (p BlockPos) Face(other BlockPos) Face + func (p BlockPos) Neighbours(f func(neighbour BlockPos)) + func (p BlockPos) OutOfBounds() bool + func (p BlockPos) Side(face Face) BlockPos + func (p BlockPos) Subtract(pos BlockPos) BlockPos + func (p BlockPos) Vec3() mgl64.Vec3 + func (p BlockPos) Vec3Centre() mgl64.Vec3 + func (p BlockPos) Vec3Middle() mgl64.Vec3 + func (p BlockPos) X() int + func (p BlockPos) Y() int + func (p BlockPos) Z() int + type BlockState struct + Name string + Properties map[string]interface{} + Version int32 + func (s BlockState) HashProperties() string + type ChunkPos [2]int32 + func (p ChunkPos) Hash() string + func (p ChunkPos) X() int32 + func (p ChunkPos) Z() int32 + type Direction int + const East + const North + const South + const West + func AllDirections() (d []Direction) + func (d Direction) Face() Face + func (d Direction) Opposite() Direction + func (d Direction) Rotate90() Direction + type Entity interface + AABB func() physics.AABB + EncodeEntity func() string + Name func() string + OnGround func() bool + Pitch func() float64 + Position func() mgl64.Vec3 + SetVelocity func(v mgl64.Vec3) + State func() []state.State + Velocity func() mgl64.Vec3 + World func() *World + Yaw func() float64 + type Face int + const FaceDown + const FaceEast + const FaceNorth + const FaceSouth + const FaceUp + const FaceWest + func AllFaces() []Face + func (f Face) Axis() Axis + func (f Face) Direction() Direction + func (f Face) FromString(s string) (interface{}, error) + func (f Face) Opposite() Face + type Generator interface + GenerateChunk func(pos ChunkPos, chunk *chunk.Chunk) + type Handler interface + HandleLiquidFlow func(ctx *event.Context, from, into BlockPos, liquid, replaced Block) + HandleLiquidHarden func(ctx *event.Context, hardenedPos BlockPos, ...) + type Item interface + EncodeItem func() (id int32, meta int16) + type ItemEntry struct + ID int32 + Meta int16 + type Liquid interface + Harden func(pos BlockPos, w *World, flownIntoBy *BlockPos) bool + LiquidDepth func() int + LiquidFalling func() bool + LiquidType func() string + SpreadDecay func() int + WithDepth func(depth int, falling bool) Liquid + type LiquidDisplacer interface + CanDisplace func(b Liquid) bool + SideClosed func(pos, side BlockPos, w *World) bool + type Loader struct + func NewLoader(chunkRadius int, world *World, v Viewer) *Loader + func (l *Loader) ChangeRadius(new int) + func (l *Loader) ChangeWorld(new *World) + func (l *Loader) Close() error + func (l *Loader) Load(n int) error + func (l *Loader) Move(pos mgl64.Vec3) + func (l *Loader) World() *World + type NBTer interface + DecodeNBT func(data map[string]interface{}) interface{} + EncodeNBT func() map[string]interface{} + type NeighbourUpdateTicker interface + NeighbourUpdateTick func(pos, changedNeighbour BlockPos, w *World) + type NoIOProvider struct + func (NoIOProvider) Close() error + func (NoIOProvider) LoadBlockNBT(ChunkPos) ([]map[string]interface{}, error) + func (NoIOProvider) LoadChunk(ChunkPos) (*chunk.Chunk, bool, error) + func (NoIOProvider) LoadDefaultGameMode() gamemode.GameMode + func (NoIOProvider) LoadDifficulty() difficulty.Difficulty + func (NoIOProvider) LoadEntities(ChunkPos) ([]Entity, error) + func (NoIOProvider) LoadTime() int64 + func (NoIOProvider) LoadTimeCycle() bool + func (NoIOProvider) SaveBlockNBT(ChunkPos, []map[string]interface{}) error + func (NoIOProvider) SaveChunk(ChunkPos, *chunk.Chunk) error + func (NoIOProvider) SaveDefaultGameMode(gamemode.GameMode) + func (NoIOProvider) SaveDifficulty(difficulty.Difficulty) + func (NoIOProvider) SaveEntities(ChunkPos, []Entity) error + func (NoIOProvider) SaveTime(int64) + func (NoIOProvider) SaveTimeCycle(bool) + func (NoIOProvider) SetWorldName(string) + func (NoIOProvider) SetWorldSpawn(BlockPos) + func (NoIOProvider) WorldName() string + func (NoIOProvider) WorldSpawn() BlockPos + type NopGenerator struct + func (NopGenerator) GenerateChunk(ChunkPos, *chunk.Chunk) + type NopHandler struct + func (NopHandler) HandleLiquidFlow(*event.Context, BlockPos, BlockPos, Block, Block) + func (NopHandler) HandleLiquidHarden(*event.Context, BlockPos, Block, Block, Block) + type Particle interface + Spawn func(w *World, pos mgl64.Vec3) + type Provider interface + LoadBlockNBT func(position ChunkPos) ([]map[string]interface{}, error) + LoadChunk func(position ChunkPos) (c *chunk.Chunk, exists bool, err error) + LoadDefaultGameMode func() gamemode.GameMode + LoadDifficulty func() difficulty.Difficulty + LoadEntities func(position ChunkPos) ([]Entity, error) + LoadTime func() int64 + LoadTimeCycle func() bool + SaveBlockNBT func(position ChunkPos, data []map[string]interface{}) error + SaveChunk func(position ChunkPos, c *chunk.Chunk) error + SaveDefaultGameMode func(mode gamemode.GameMode) + SaveDifficulty func(d difficulty.Difficulty) + SaveEntities func(position ChunkPos, entities []Entity) error + SaveTime func(time int64) + SaveTimeCycle func(running bool) + SetWorldName func(name string) + SetWorldSpawn func(pos BlockPos) + WorldName func() string + WorldSpawn func() BlockPos + type RandomTicker interface + RandomTick func(pos BlockPos, w *World, r *rand.Rand) + type ScheduledTicker interface + ScheduledTick func(pos BlockPos, w *World) + type Sound interface + Play func(w *World, pos mgl64.Vec3) + type Structure interface + AdditionalLiquidAt func(x, y, z int) Liquid + At func(x, y, z int, blockAt func(x, y, z int) Block) Block + Dimensions func() [3]int + type TickerBlock interface + Tick func(currentTick int64, pos BlockPos, w *World) + type TickerEntity interface + Tick func(current int64) + type Viewer interface + HideEntity func(e Entity) + Position func() mgl64.Vec3 + ViewBlockAction func(pos BlockPos, a blockAction.Action) + ViewBlockUpdate func(pos BlockPos, b Block, layer int) + ViewChunk func(pos ChunkPos, c *chunk.Chunk, blockNBT map[BlockPos]Block) + ViewEmote func(player Entity, emote uuid.UUID) + ViewEntity func(e Entity) + ViewEntityAction func(e Entity, a action.Action) + ViewEntityArmour func(e Entity) + ViewEntityItems func(e Entity) + ViewEntityMovement func(e Entity, deltaPos mgl64.Vec3, deltaYaw, deltaPitch float64) + ViewEntityState func(e Entity, s []state.State) + ViewEntityTeleport func(e Entity, position mgl64.Vec3) + ViewEntityVelocity func(e Entity, velocity mgl64.Vec3) + ViewParticle func(pos mgl64.Vec3, p Particle) + ViewSound func(pos mgl64.Vec3, s Sound) + ViewTime func(time int) + type World struct + func New(log *logrus.Logger, simulationDistance int) *World + func OfEntity(e Entity) (*World, bool) + func (w *World) AddEntity(e Entity) + func (w *World) AddParticle(pos mgl64.Vec3, p Particle) + func (w *World) Block(pos BlockPos) Block + func (w *World) BreakBlock(pos BlockPos) + func (w *World) BreakBlockWithoutParticles(pos BlockPos) + func (w *World) BuildStructure(pos BlockPos, s Structure) + func (w *World) Close() error + func (w *World) CloseChunkCacheJanitor() + func (w *World) DefaultGameMode() gamemode.GameMode + func (w *World) Difficulty() difficulty.Difficulty + func (w *World) Entities() []Entity + func (w *World) EntitiesWithin(aabb physics.AABB) []Entity + func (w *World) Generator(g Generator) + func (w *World) Handle(h Handler) + func (w *World) Handler() Handler + func (w *World) HighestBlock(x, z int) int + func (w *World) Light(pos BlockPos) uint8 + func (w *World) Liquid(pos BlockPos) (Liquid, bool) + func (w *World) Name() string + func (w *World) PlaceBlock(pos BlockPos, b Block) + func (w *World) PlaySound(pos mgl64.Vec3, s Sound) + func (w *World) Provider(p Provider) + func (w *World) ReadOnly() + func (w *World) RemoveEntity(e Entity) + func (w *World) ScheduleBlockUpdate(pos BlockPos, delay time.Duration) + func (w *World) SetBlock(pos BlockPos, b Block) + func (w *World) SetDefaultGameMode(mode gamemode.GameMode) + func (w *World) SetDifficulty(d difficulty.Difficulty) + func (w *World) SetLiquid(pos BlockPos, b Liquid) + func (w *World) SetRandomTickSpeed(v int) + func (w *World) SetSpawn(pos BlockPos) + func (w *World) SetTime(new int) + func (w *World) SkyLight(pos BlockPos) uint8 + func (w *World) Spawn() BlockPos + func (w *World) StartTime() + func (w *World) StopTime() + func (w *World) Time() int + func (w *World) Viewers(pos mgl64.Vec3) []Viewer