1.20.80 support (#1)
This commit is contained in:
@@ -112,3 +112,22 @@ func IOStackRequestAction(io protocol.IO, x *protocol.StackRequestAction) {
|
||||
}
|
||||
(*x).Marshal(io)
|
||||
}
|
||||
|
||||
func IORecipe(io protocol.IO, recipe *Recipe) {
|
||||
if IsReader(io) {
|
||||
var recipeType int32
|
||||
io.Varint32(&recipeType)
|
||||
if !lookupRecipe(recipeType, recipe) {
|
||||
io.UnknownEnumOption(recipeType, "crafting data recipe type")
|
||||
return
|
||||
}
|
||||
(*recipe).Unmarshal(io.(*Reader))
|
||||
} else {
|
||||
var recipeType int32
|
||||
if !lookupRecipeType(*recipe, &recipeType) {
|
||||
io.UnknownEnumOption(fmt.Sprintf("%T", *recipe), "crafting recipe type")
|
||||
}
|
||||
io.Varint32(&recipeType)
|
||||
(*recipe).Marshal(io.(*Writer))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user