Documentation ¶
Index ¶
- func Block(m map[string]any, k string) world.Block
- func Bool(m map[string]any, k string) bool
- func Float32(m map[string]any, k string) float32
- func Float64(m map[string]any, k string) float64
- func Int16(m map[string]any, k string) int16
- func Int32(m map[string]any, k string) int32
- func Int32FromRGBA(x color.RGBA) int32
- func Int64(m map[string]any, k string) int64
- func InvFromNBT(inv *inventory.Inventory, items []any)
- func InvToNBT(inv *inventory.Inventory) []map[string]any
- func Item(data map[string]any, s *item.Stack) item.Stack
- func MapItem(x map[string]any, k string) item.Stack
- func Pos(x map[string]any, k string) cube.Pos
- func PosToInt32Slice(x cube.Pos) []int32
- func RGBAFromInt32(x int32) color.RGBA
- func Rotation(m map[string]any) cube.Rotation
- func Slice(m map[string]any, k string) []any
- func String(m map[string]any, k string) string
- func TickDuration[T constraints.Integer](m map[string]any, k string) time.Duration
- func Uint8(m map[string]any, k string) uint8
- func Vec3(x map[string]any, k string) mgl64.Vec3
- func Vec3ToFloat32Slice(x mgl64.Vec3) []float32
- func WriteBlock(b world.Block) map[string]any
- func WriteItem(s item.Stack, disk bool) map[string]any
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bool ¶ added in v0.8.7
Bool reads a uint8 value from a map at key k and returns true if it equals 1.
func Int32FromRGBA ¶ added in v0.2.0
Int32FromRGBA converts a color.RGBA into an int32. These int32s are present in, for example, signs.
func InvFromNBT ¶
InvFromNBT decodes the data of an NBT slice into the inventory passed.
func MapItem ¶ added in v0.2.0
MapItem converts an item's name, count, damage (and properties when it is a block) in a map obtained by decoding NBT to a world.Item.
func PosToInt32Slice ¶ added in v0.6.0
PosToInt32Slice converts a cube.Pos to a []int32 with 3 elements.
func RGBAFromInt32 ¶ added in v0.2.0
RGBAFromInt32 converts an int32 into a color.RGBA. These int32s are present in, for example, signs.
func TickDuration ¶ added in v0.8.7
TickDuration reads a uint8/int16/in32 value from a map at key k and converts it from ticks to a time.Duration.
func Vec3ToFloat32Slice ¶ added in v0.2.0
Vec3ToFloat32Slice converts an mgl64.Vec3 to a []float32 with 3 elements.
func WriteBlock ¶ added in v0.3.0
WriteBlock encodes a world.Block into a map that can be encoded using NBT.
Types ¶
This section is empty.