chunk

package
v0.0.0-...-54241fc Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrIncomplete = errors.New("incomplete chunk found")
View Source
var ErrNotFound = errors.New("chunk not found")

Functions

func GetBlockId

func GetBlockId(b Block) (int, bool)

func RegisterBlock

func RegisterBlock(b Block) error

Types

type Block

type Block interface {
	EncodedName() string

	New(string, map[string]string) Block

	Properties() map[string]string
}

func DefaultBlock

func DefaultBlock(name string) Block

func GetBlock

func GetBlock(name string) Block

type Chunk

type Chunk struct {
	Entities []Entity
	// contains filtered or unexported fields
}

func NewAnvilChunk

func NewAnvilChunk(b []byte) (*Chunk, error)

func (*Chunk) Block

func (c *Chunk) Block(x, y, z int64) Block

func (*Chunk) Data

func (c *Chunk) Data() *packet.ChunkData

func (*Chunk) RandomTick

func (c *Chunk) RandomTick(speed int32)

func (*Chunk) Sections

func (c *Chunk) Sections() []*section

func (*Chunk) SetBlock

func (c *Chunk) SetBlock(x, y, z int64, b Block)

func (*Chunk) SetPosition

func (c *Chunk) SetPosition(x, z int32)

type Entity

type Entity struct {
	//Attributes            []map[string]interface{} `nbt:"Attributes"`
	IsBaby           int8      `nbt:"IsBaby"`
	AbsorptionAmount float32   `nbt:"AbsorptionAmount"`
	HandDropChances  []float32 `nbt:"HandDropChances"`
	Motion           []float64 `nbt:"Motion"`
	Fire             int16     `nbt:"Fire"`
	CanPickUpLoot    int8      `nbt:"CanPickUpLoot"`
	OnGround         int8      `nbt:"OnGround"`
	//HandItems             []map[string]interface{}   `nbt:"HandItems"`
	Health                float32   `nbt:"Health"`
	Air                   int16     `nbt:"Air"`
	HurtTime              int16     `nbt:"HurtTime"`
	DrownedConversionTime int32     `nbt:"DrownedConversionTime"`
	FallDistance          float32   `nbt:"FallDistance"`
	UUID                  []int32   `nbt:"UUID"`
	ArmorDropChances      []float32 `nbt:"ArmorDropChances"`
	Pos                   []float64 `nbt:"Pos"`
	DeathTime             int16     `nbt:"DeathTime"`
	LeftHanded            int8      `nbt:"LeftHanded"`
	Rotation              []float32 `nbt:"Rotation"`
	HurtByTimestamp       int32     `nbt:"HurtByTimestamp"`
	FallFlying            int8      `nbt:"FallFlying"`
	PortalCooldown        int32     `nbt:"PortalCooldown"`
	InWaterTime           int32     `nbt:"InWaterTime"`
	Id                    string    `nbt:"id"`
	Brain                 struct {
		Memories struct {
		} `nbt:"memories"`
	} `nbt:"Brain"`
	Invulnerable        int8 `nbt:"Invulnerable"`
	PersistenceRequired int8 `nbt:"PersistenceRequired"`
	CanBreakDoors       int8 `nbt:"CanBreakDoors"`
}

type Hash

type Hash uint64

func HashXZ

func HashXZ(x, z int32) Hash

func (Hash) Position

func (h Hash) Position() (x, z int32)

type HeightMap

type HeightMap struct {
	MotionBlocking []int64 `nbt:"MOTION_BLOCKING"`
	WorldSurface   []int64 `nbt:"WORLD_SURFACE"`
}

type UnknownBlock

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

func NewUnknownBlock

func NewUnknownBlock(name string) *UnknownBlock

func (UnknownBlock) EncodedName

func (u UnknownBlock) EncodedName() string

func (UnknownBlock) New

func (u UnknownBlock) New(n string, m map[string]string) Block

func (UnknownBlock) Properties

func (u UnknownBlock) Properties() map[string]string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳