Documentation
¶
Index ¶
- Constants
- Variables
- func Json2Nbt(b []byte, byteOrder binary.ByteOrder) ([]byte, error)
- func Nbt2Json(b []byte, byteOrder binary.ByteOrder, comment string) ([]byte, error)
- func Nbt2Yaml(b []byte, byteOrder binary.ByteOrder, comment string) ([]byte, error)
- func Yaml2Nbt(b []byte, byteOrder binary.ByteOrder) ([]byte, error)
- type JsonParseError
- type NbtJson
- type NbtParseError
- type NbtTag
- type NbtTagList
Constants ¶
const Nbt2JsonUrl = "https://github.com/midnightfreddie/nbt2json"
Nbt2JsonUrl is inserted in the json document as nbt2JsonUrl
const Version = "0.3.4"
Version is the json document's nbt2JsonVersion:
Variables ¶
var Bedrock = binary.LittleEndian
Bedrock is for Bedrock Edition (little endian NBT encoding); unable to make const, but **do not alter**
var Java = binary.BigEndian
Java is for Java Edition (big endian NBT encoding); unable to make const, but **do not alter**
var Name = "Named Binary Tag to JSON"
Name is the json document's name:
Functions ¶
Types ¶
type JsonParseError ¶
type JsonParseError struct {
// contains filtered or unexported fields
}
JsonParseError is when the json data does not match an expected pattern. Pass it message string and downstream error
func (JsonParseError) Error ¶
func (e JsonParseError) Error() string
type NbtJson ¶ added in v0.2.0
type NbtJson struct {
Name string `json:"name"`
Version string `json:"version"`
Nbt2JsonUrl string `json:"nbt2JsonUrl"`
ConversionTime string `json:"conversionTime,omitempty"`
Comment string `json:"comment,omitempty"`
Nbt []*json.RawMessage `json:"nbt"`
}
NbtJson is the top-level JSON document; it is exported for reflect, and client code shouldn't use it
type NbtParseError ¶
type NbtParseError struct {
// contains filtered or unexported fields
}
NbtParseError is when the nbt data does not match an expected pattern. Pass it message string and downstream error
func (NbtParseError) Error ¶
func (e NbtParseError) Error() string
type NbtTag ¶
type NbtTag struct {
TagType byte `json:"tagType"`
Name string `json:"name"`
Value interface{} `json:"value,omitempty"`
}
NbtTag represents one NBT tag for each struct; it is exported for reflect, and client code shouldn't use it
type NbtTagList ¶
type NbtTagList struct {
TagListType byte `json:"tagListType"`
List []interface{} `json:"list"`
}
NbtTagList represents an NBT tag list; it is exported for reflect, and client code shouldn't use it