Add 1.20.70 & 1.20.60 support + Fix crafting issue (#9)
This commit is contained in:
@@ -12,6 +12,8 @@ const (
|
||||
ID686 = 686 // v1.21.2
|
||||
ID685 = 685 // v1.21.0
|
||||
ID671 = 671 // v1.20.80
|
||||
ID662 = 662 // v1.20.70
|
||||
ID649 = 649 // v1.20.60
|
||||
)
|
||||
|
||||
func IsProtoGTE(io protocol.IO, proto int32) bool {
|
||||
|
||||
@@ -808,9 +808,13 @@ func (a *CraftRecipeStackRequestAction) FromLatest(y *protocol.CraftRecipeStackR
|
||||
}
|
||||
|
||||
func (a *CraftRecipeStackRequestAction) ToLatest() *protocol.CraftRecipeStackRequestAction {
|
||||
numberOfCrafts := a.NumberOfCrafts
|
||||
if numberOfCrafts == 0 {
|
||||
numberOfCrafts = 1
|
||||
}
|
||||
return &protocol.CraftRecipeStackRequestAction{
|
||||
RecipeNetworkID: a.RecipeNetworkID,
|
||||
NumberOfCrafts: a.NumberOfCrafts,
|
||||
NumberOfCrafts: numberOfCrafts,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -677,7 +677,9 @@ func marshalShaped(r protocol.IO, recipe *ShapedRecipe) {
|
||||
r.UUID(&recipe.UUID)
|
||||
r.String(&recipe.Block)
|
||||
r.Varint32(&recipe.Priority)
|
||||
r.Bool(&recipe.AssumeSymmetry)
|
||||
if IsProtoGTE(r, ID671) {
|
||||
r.Bool(&recipe.AssumeSymmetry)
|
||||
}
|
||||
if IsProtoGTE(r, ID685) {
|
||||
protocol.Single(r, &recipe.UnlockRequirement)
|
||||
}
|
||||
|
||||
@@ -132,5 +132,7 @@ func (x *BehaviourPackInfo) Marshal(r protocol.IO) {
|
||||
r.String(&x.SubPackName)
|
||||
r.String(&x.ContentIdentity)
|
||||
r.Bool(&x.HasScripts)
|
||||
r.Bool(&x.AddonPack)
|
||||
if IsProtoGTE(r, ID712) {
|
||||
r.Bool(&x.AddonPack)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user