nbtconv

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Int32FromRGBA added in v0.2.0

func Int32FromRGBA(x color.RGBA) int32

Int32FromRGBA converts a color.RGBA into an int32. These int32s are present in, for example, signs.

func InvFromNBT

func InvFromNBT(inv *inventory.Inventory, items []interface{})

InvFromNBT decodes the data of an NBT slice into the inventory passed.

func InvToNBT

func InvToNBT(inv *inventory.Inventory) []map[string]interface{}

InvToNBT encodes an inventory to a data slice which may be encoded as NBT.

func MapBlock added in v0.2.0

func MapBlock(x map[string]interface{}, k string) world.Block

MapBlock converts a block's name and properties in a map obtained by decoding NBT to a world.Block.

func MapByte added in v0.2.0

func MapByte(m map[string]interface{}, key string) byte

MapByte reads a byte from a map at the key passed. noinspection GoCommentLeadingSpace

func MapFloat32 added in v0.2.0

func MapFloat32(m map[string]interface{}, key string) float32

MapFloat32 reads a float32 from a map at the key passed. noinspection GoCommentLeadingSpace

func MapInt16 added in v0.2.0

func MapInt16(m map[string]interface{}, key string) int16

MapInt16 reads an int16 from a map at the key passed.

func MapInt32 added in v0.2.0

func MapInt32(m map[string]interface{}, key string) int32

MapInt32 reads an int32 from a map at the key passed.

func MapInt64 added in v0.2.0

func MapInt64(m map[string]interface{}, key string) int64

MapInt64 reads an int64 from a map at the key passed.

func MapItem added in v0.2.0

func MapItem(x map[string]interface{}, k string) item.Stack

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 MapSlice added in v0.2.0

func MapSlice(m map[string]interface{}, key string) []interface{}

MapSlice reads an interface slice from a map at the key passed.

func MapString added in v0.2.0

func MapString(m map[string]interface{}, key string) string

MapString reads a string from a map at the key passed.

func MapVec3 added in v0.2.0

func MapVec3(x map[string]interface{}, k string) mgl64.Vec3

MapVec3 converts x, y and z values in an NBT map to an mgl64.Vec3.

func RGBAFromInt32 added in v0.2.0

func RGBAFromInt32(x int32) color.RGBA

RGBAFromInt32 converts an int32 into a color.RGBA. These int32s are present in, for example, signs.

func ReadBlock added in v0.3.0

func ReadBlock(m map[string]interface{}) world.Block

ReadBlock decodes the data of a block into a world.Block.

func ReadItem added in v0.3.0

func ReadItem(data map[string]interface{}, s *item.Stack) item.Stack

ReadItem decodes the data of an item into an item stack.

func Vec3ToFloat32Slice added in v0.2.0

func Vec3ToFloat32Slice(x mgl64.Vec3) []float32

Vec3ToFloat32Slice converts an mgl64.Vec3 to a []float32 with 3 elements.

func WriteBlock added in v0.3.0

func WriteBlock(b world.Block) map[string]interface{}

WriteBlock encodes a world.Block into a map that can be encoded using NBT.

func WriteItem added in v0.3.0

func WriteItem(s item.Stack, disk bool) map[string]interface{}

WriteItem encodes an item stack into a map that can be encoded using NBT.

Types

This section is empty.

Jump to

Keyboard shortcuts

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