fix: update 26.2 SlotDisplay mapper with 3 new types from decompiled source
- Add with_any_potion (id 2), only_with_component (id 3), dyed (id 7) - Shift existing IDs: item 2→4, item_stack 3→5, tag 4→6, smithing_trim 5→8, with_remainder 6→9, composite 7→10 - RecipeBookAdd now decodes successfully (was index not found) - Verified against decompiled client jar via SlotDisplays.bootstrap()
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// Code generated by strom. DO NOT EDIT.
|
||||
// source: minecraft-data/pc/26.2/protocol.json (sha256:7ba66411adcc68a668f38211e1b00eeb386a345d5eb16fadd6dc1c7f94bb175f)
|
||||
// version: v0.6.6-0.20260805173638-56ac8e154ea1+dirty (go1.26.2)
|
||||
// source: minecraft-data/pc/26.2/protocol.json (sha256:795e78495a67b7311837c19c714f0c3fb2598fcf407a76779403a65ba1272457)
|
||||
// version: v0.6.6-0.20260805175346-53d366ae5301+dirty (go1.26.2)
|
||||
package v26_2
|
||||
|
||||
import (
|
||||
@@ -11306,7 +11306,7 @@ type PlayToClientSlotDisplay struct {
|
||||
Data any
|
||||
}
|
||||
|
||||
var PlayToClientSlotDisplayTypeMap = map[int32]string{0: "empty", 1: "any_fuel", 2: "item", 3: "item_stack", 4: "tag", 5: "smithing_trim", 6: "with_remainder", 7: "composite"}
|
||||
var PlayToClientSlotDisplayTypeMap = map[int32]string{0: "empty", 1: "any_fuel", 10: "composite", 2: "with_any_potion", 3: "only_with_component", 4: "item", 5: "item_stack", 6: "tag", 7: "dyed", 8: "smithing_trim", 9: "with_remainder"}
|
||||
|
||||
func (ret *PlayToClientSlotDisplay) Decode(r io.ReadSeeker) (err error) {
|
||||
var PlayToClientSlotDisplayTypeKey int32
|
||||
@@ -11340,6 +11340,20 @@ func (ret *PlayToClientSlotDisplay) Decode(r io.ReadSeeker) (err error) {
|
||||
PlayToClientSlotDisplayDataCompositeTmp = append(PlayToClientSlotDisplayDataCompositeTmp, PlayToClientSlotDisplayDataCompositeTmpElement)
|
||||
}
|
||||
ret.Data = PlayToClientSlotDisplayDataCompositeTmp
|
||||
case "dyed":
|
||||
var PlayToClientSlotDisplayDataDyedTmp struct {
|
||||
Dye PlayToClientSlotDisplay
|
||||
Target PlayToClientSlotDisplay
|
||||
}
|
||||
err = PlayToClientSlotDisplayDataDyedTmp.Dye.Decode(r)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = PlayToClientSlotDisplayDataDyedTmp.Target.Decode(r)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
ret.Data = PlayToClientSlotDisplayDataDyedTmp
|
||||
case "empty":
|
||||
var PlayToClientSlotDisplayDataEmptyTmp struct {
|
||||
}
|
||||
@@ -11358,6 +11372,20 @@ func (ret *PlayToClientSlotDisplay) Decode(r io.ReadSeeker) (err error) {
|
||||
return
|
||||
}
|
||||
ret.Data = PlayToClientSlotDisplayDataItemStackTmp
|
||||
case "only_with_component":
|
||||
var PlayToClientSlotDisplayDataOnlyWithComponentTmp struct {
|
||||
Source PlayToClientSlotDisplay
|
||||
Component IDSet
|
||||
}
|
||||
err = PlayToClientSlotDisplayDataOnlyWithComponentTmp.Source.Decode(r)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = PlayToClientSlotDisplayDataOnlyWithComponentTmp.Component.Decode(r)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
ret.Data = PlayToClientSlotDisplayDataOnlyWithComponentTmp
|
||||
case "smithing_trim":
|
||||
var PlayToClientSlotDisplayDataSmithingTrimTmp struct {
|
||||
Base PlayToClientSlotDisplay
|
||||
@@ -11395,6 +11423,15 @@ func (ret *PlayToClientSlotDisplay) Decode(r io.ReadSeeker) (err error) {
|
||||
return
|
||||
}
|
||||
ret.Data = PlayToClientSlotDisplayDataTagTmp
|
||||
case "with_any_potion":
|
||||
var PlayToClientSlotDisplayDataWithAnyPotionTmp struct {
|
||||
Display PlayToClientSlotDisplay
|
||||
}
|
||||
err = PlayToClientSlotDisplayDataWithAnyPotionTmp.Display.Decode(r)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
ret.Data = PlayToClientSlotDisplayDataWithAnyPotionTmp
|
||||
case "with_remainder":
|
||||
var PlayToClientSlotDisplayDataWithRemainderTmp struct {
|
||||
Input PlayToClientSlotDisplay
|
||||
@@ -11413,7 +11450,7 @@ func (ret *PlayToClientSlotDisplay) Decode(r io.ReadSeeker) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
var PlayToClientSlotDisplayTypeReverseMap = map[string]int32{"empty": 0, "any_fuel": 1, "item": 2, "item_stack": 3, "tag": 4, "smithing_trim": 5, "with_remainder": 6, "composite": 7}
|
||||
var PlayToClientSlotDisplayTypeReverseMap = map[string]int32{"empty": 0, "any_fuel": 1, "composite": 10, "with_any_potion": 2, "only_with_component": 3, "item": 4, "item_stack": 5, "tag": 6, "dyed": 7, "smithing_trim": 8, "with_remainder": 9}
|
||||
|
||||
func (ret *PlayToClientSlotDisplay) Encode(w io.Writer) (err error) {
|
||||
var vPlayToClientSlotDisplayType int32
|
||||
@@ -11450,6 +11487,25 @@ func (ret *PlayToClientSlotDisplay) Encode(w io.Writer) (err error) {
|
||||
return
|
||||
}
|
||||
}
|
||||
case "dyed":
|
||||
PlayToClientSlotDisplayData, ok := ret.Data.(struct {
|
||||
Dye PlayToClientSlotDisplay
|
||||
Target PlayToClientSlotDisplay
|
||||
})
|
||||
if !ok {
|
||||
err = proto_base.BadTypeError
|
||||
return
|
||||
}
|
||||
PlayToClientSlotDisplayDataDyeEncTmp := PlayToClientSlotDisplayData.Dye
|
||||
err = PlayToClientSlotDisplayDataDyeEncTmp.Encode(w)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
PlayToClientSlotDisplayDataTargetEncTmp := PlayToClientSlotDisplayData.Target
|
||||
err = PlayToClientSlotDisplayDataTargetEncTmp.Encode(w)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
case "empty":
|
||||
_, ok := ret.Data.(struct {
|
||||
})
|
||||
@@ -11478,6 +11534,25 @@ func (ret *PlayToClientSlotDisplay) Encode(w io.Writer) (err error) {
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
case "only_with_component":
|
||||
PlayToClientSlotDisplayData, ok := ret.Data.(struct {
|
||||
Source PlayToClientSlotDisplay
|
||||
Component IDSet
|
||||
})
|
||||
if !ok {
|
||||
err = proto_base.BadTypeError
|
||||
return
|
||||
}
|
||||
PlayToClientSlotDisplayDataSourceEncTmp := PlayToClientSlotDisplayData.Source
|
||||
err = PlayToClientSlotDisplayDataSourceEncTmp.Encode(w)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
PlayToClientSlotDisplayDataComponentEncTmp := PlayToClientSlotDisplayData.Component
|
||||
err = PlayToClientSlotDisplayDataComponentEncTmp.Encode(w)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
case "smithing_trim":
|
||||
PlayToClientSlotDisplayData, ok := ret.Data.(struct {
|
||||
Base PlayToClientSlotDisplay
|
||||
@@ -11527,6 +11602,19 @@ func (ret *PlayToClientSlotDisplay) Encode(w io.Writer) (err error) {
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
case "with_any_potion":
|
||||
PlayToClientSlotDisplayData, ok := ret.Data.(struct {
|
||||
Display PlayToClientSlotDisplay
|
||||
})
|
||||
if !ok {
|
||||
err = proto_base.BadTypeError
|
||||
return
|
||||
}
|
||||
PlayToClientSlotDisplayDataDisplayEncTmp := PlayToClientSlotDisplayData.Display
|
||||
err = PlayToClientSlotDisplayDataDisplayEncTmp.Encode(w)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
case "with_remainder":
|
||||
PlayToClientSlotDisplayData, ok := ret.Data.(struct {
|
||||
Input PlayToClientSlotDisplay
|
||||
|
||||
Reference in New Issue
Block a user