Skip to content

Commit

Permalink
Merge branch 'Sandertv:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
cqdetdev authored Jan 16, 2023
2 parents aa3f571 + b795b64 commit dfd3861
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions minecraft/protocol/io.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
5 changes: 5 additions & 0 deletions minecraft/protocol/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions minecraft/protocol/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit dfd3861

Please sign in to comment.