Add item DataComponent implements (part 2)

This commit is contained in:
Tnze
2024-07-28 22:45:40 +08:00
parent 090493c4ac
commit c51313a9cc
18 changed files with 287 additions and 73 deletions

View File

@ -1,28 +1,14 @@
package component
import (
"io"
pk "github.com/Tnze/go-mc/net/packet"
)
import pk "github.com/Tnze/go-mc/net/packet"
var _ DataComponent = (*MaxStackSize)(nil)
type MaxStackSize struct {
MaxStackSize pk.VarInt
pk.VarInt
}
// ID implements DataComponent.
func (MaxStackSize) ID() string {
return "minecraft:max_stack_size"
}
// ReadFrom implements DataComponent.
func (m *MaxStackSize) ReadFrom(r io.Reader) (n int64, err error) {
return m.MaxStackSize.ReadFrom(r)
}
// WriteTo implements DataComponent.
func (m *MaxStackSize) WriteTo(w io.Writer) (n int64, err error) {
return m.MaxStackSize.WriteTo(w)
}