Add item DataComponent implements (part 1)
This commit is contained in:
28
level/component/custommodeldata.go
Normal file
28
level/component/custommodeldata.go
Normal file
@ -0,0 +1,28 @@
|
||||
package component
|
||||
|
||||
import (
|
||||
"io"
|
||||
|
||||
pk "github.com/Tnze/go-mc/net/packet"
|
||||
)
|
||||
|
||||
var _ DataComponent = (*CustomModelData)(nil)
|
||||
|
||||
type CustomModelData struct {
|
||||
Value pk.VarInt
|
||||
}
|
||||
|
||||
// ID implements DataComponent.
|
||||
func (CustomModelData) ID() string {
|
||||
return "minecraft:custom_model_data"
|
||||
}
|
||||
|
||||
// ReadFrom implements DataComponent.
|
||||
func (c *CustomModelData) ReadFrom(r io.Reader) (n int64, err error) {
|
||||
return c.Value.ReadFrom(r)
|
||||
}
|
||||
|
||||
// WriteTo implements DataComponent.
|
||||
func (c *CustomModelData) WriteTo(w io.Writer) (n int64, err error) {
|
||||
return c.Value.WriteTo(w)
|
||||
}
|
Reference in New Issue
Block a user