can parse TAG_String
This commit is contained in:
22
nbt/typeinfo.go
Normal file
22
nbt/typeinfo.go
Normal file
@ -0,0 +1,22 @@
|
||||
package nbt
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
)
|
||||
|
||||
type typeInfo struct {
|
||||
}
|
||||
|
||||
func getTypeInfo(typ reflect.Type) (*typeInfo, error) {
|
||||
tinfo := new(typeInfo)
|
||||
if typ.Kind() == reflect.Struct {
|
||||
n := typ.NumField()
|
||||
for i := 0; i < n; i++ {
|
||||
f := typ.Field(i)
|
||||
if (f.PkgPath != "" && !f.Anonymous) || f.Tag.Get("nbt") == "-" {
|
||||
continue // Private field
|
||||
}
|
||||
}
|
||||
}
|
||||
return tinfo, nil
|
||||
}
|
Reference in New Issue
Block a user