can parse TAG_String
This commit is contained in:
44
nbt/nbt.go
Normal file
44
nbt/nbt.go
Normal file
@ -0,0 +1,44 @@
|
||||
package nbt
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"io"
|
||||
)
|
||||
|
||||
//Tag type IDs
|
||||
const (
|
||||
TagEnd byte = iota
|
||||
TagByte
|
||||
TagShort
|
||||
TagInt
|
||||
TagLong
|
||||
TagFloat
|
||||
TagDouble
|
||||
TagByteArray
|
||||
TagString
|
||||
TagList
|
||||
TagCompound
|
||||
TagIntArray
|
||||
TagLongArray
|
||||
)
|
||||
|
||||
type Decoder struct {
|
||||
r interface {
|
||||
io.ByteReader
|
||||
io.Reader
|
||||
}
|
||||
nameless bool
|
||||
}
|
||||
|
||||
func NewDecoder(r io.Reader) *Decoder {
|
||||
d := new(Decoder)
|
||||
if br, ok := r.(interface {
|
||||
io.ByteReader
|
||||
io.Reader
|
||||
}); ok {
|
||||
d.r = br
|
||||
} else {
|
||||
d.r = bufio.NewReader(r)
|
||||
}
|
||||
return d
|
||||
}
|
Reference in New Issue
Block a user