diff --git a/minecraft/protocol/io.go b/minecraft/protocol/io.go index b4ec37eb..a49e93e9 100644 --- a/minecraft/protocol/io.go +++ b/minecraft/protocol/io.go @@ -49,6 +49,7 @@ type IO interface { MaterialReducer(x *MaterialReducer) GameRule(x *GameRule) + ShieldID() int32 UnknownEnumOption(value any, enum string) InvalidValue(value any, forField, reason string) } diff --git a/minecraft/protocol/reader.go b/minecraft/protocol/reader.go index ed1cf58f..ac9bafaa 100644 --- a/minecraft/protocol/reader.go +++ b/minecraft/protocol/reader.go @@ -474,6 +474,11 @@ func (r *Reader) LimitInt32(value int32, min, max int32) { } } +// ShieldID returns the shield ID provided to the reader. +func (r *Reader) ShieldID() int32 { + return r.shieldID +} + // UnknownEnumOption panics with an unknown enum option error. func (r *Reader) UnknownEnumOption(value any, enum string) { r.panicf("unknown value '%v' for enum type '%v'", value, enum) diff --git a/minecraft/protocol/writer.go b/minecraft/protocol/writer.go index 70b06f37..d60d5f25 100644 --- a/minecraft/protocol/writer.go +++ b/minecraft/protocol/writer.go @@ -423,6 +423,11 @@ func (w *Writer) NBTList(x *[]any, encoding nbt.Encoding) { } } +// ShieldID returns the shield ID provided to the writer. +func (w *Writer) ShieldID() int32 { + return w.shieldID +} + // UnknownEnumOption panics with an unknown enum option error. func (w *Writer) UnknownEnumOption(value any, enum string) { w.panicf("unknown value '%v' for enum type '%v'", value, enum)