Skip to content

Commit

Permalink
Fix bedrock recipe text encoding issue (#808)
Browse files Browse the repository at this point in the history
* bedrock: add latin1 string type and use for recipes

* temp fix for outdated protodef-validate
  • Loading branch information
extremeheat committed Dec 25, 2023
1 parent 37e2880 commit 900ebf2
Show file tree
Hide file tree
Showing 79 changed files with 421 additions and 212 deletions.
1 change: 1 addition & 0 deletions data/bedrock/1.16.201/proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ string: ["pstring",{"countType":"varint"}]
ByteArray: ["buffer",{"countType":"varint"}]
SignedByteArray: ["buffer",{"countType":"zigzag32"}]
LittleString: ["pstring",{"countType":"li32"}]
LatinString: ["pstring",{"countType":"varint", "encoding": "latin1"}]
varint64: native # Some primitives
zigzag32: native
zigzag64: native
Expand Down
17 changes: 12 additions & 5 deletions data/bedrock/1.16.201/protocol.json
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,7 @@
[
{
"name": "recipe_id",
"type": "string"
"type": "LatinString"
},
{
"name": "input",
Expand Down Expand Up @@ -1248,7 +1248,7 @@
[
{
"name": "recipe_id",
"type": "string"
"type": "LatinString"
},
{
"name": "input",
Expand Down Expand Up @@ -1293,7 +1293,7 @@
[
{
"name": "recipe_id",
"type": "string"
"type": "LatinString"
},
{
"name": "input",
Expand Down Expand Up @@ -1338,7 +1338,7 @@
[
{
"name": "recipe_id",
"type": "string"
"type": "LatinString"
},
{
"name": "width",
Expand Down Expand Up @@ -1397,7 +1397,7 @@
[
{
"name": "recipe_id",
"type": "string"
"type": "LatinString"
},
{
"name": "width",
Expand Down Expand Up @@ -7341,6 +7341,13 @@
"countType": "li32"
}
],
"LatinString": [
"pstring",
{
"countType": "varint",
"encoding": "latin1"
}
],
"AdventureFlags": [
"bitflags",
{
Expand Down
4 changes: 2 additions & 2 deletions data/bedrock/1.16.201/types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -455,15 +455,15 @@ Recipes: []varint
'7': 'shaped_chemistry' #'ENTRY_SHAPED_CHEMISTRY', //TODO
recipe: type?
if shapeless or shulker_box or shapeless_chemistry:
recipe_id: string
recipe_id: LatinString
input: RecipeIngredient[]varint
output: Item[]varint
uuid: uuid
block: string
priority: zigzag32
network_id: zigzag32
if shaped or shaped_chemistry:
recipe_id: string
recipe_id: LatinString
width: zigzag32
height: zigzag32
# todo: can this become
Expand Down
1 change: 1 addition & 0 deletions data/bedrock/1.16.210/proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ string: ["pstring",{"countType":"varint"}]
ByteArray: ["buffer",{"countType":"varint"}]
SignedByteArray: ["buffer",{"countType":"zigzag32"}]
LittleString: ["pstring",{"countType":"li32"}]
LatinString: ["pstring",{"countType":"varint", "encoding": "latin1"}]
varint64: native # Some primitives
zigzag32: native
zigzag64: native
Expand Down
17 changes: 12 additions & 5 deletions data/bedrock/1.16.210/protocol.json
Original file line number Diff line number Diff line change
Expand Up @@ -1225,7 +1225,7 @@
[
{
"name": "recipe_id",
"type": "string"
"type": "LatinString"
},
{
"name": "input",
Expand Down Expand Up @@ -1270,7 +1270,7 @@
[
{
"name": "recipe_id",
"type": "string"
"type": "LatinString"
},
{
"name": "input",
Expand Down Expand Up @@ -1315,7 +1315,7 @@
[
{
"name": "recipe_id",
"type": "string"
"type": "LatinString"
},
{
"name": "input",
Expand Down Expand Up @@ -1360,7 +1360,7 @@
[
{
"name": "recipe_id",
"type": "string"
"type": "LatinString"
},
{
"name": "width",
Expand Down Expand Up @@ -1419,7 +1419,7 @@
[
{
"name": "recipe_id",
"type": "string"
"type": "LatinString"
},
{
"name": "width",
Expand Down Expand Up @@ -7792,6 +7792,13 @@
"countType": "li32"
}
],
"LatinString": [
"pstring",
{
"countType": "varint",
"encoding": "latin1"
}
],
"MetadataFlags1": [
"bitflags",
{
Expand Down
4 changes: 2 additions & 2 deletions data/bedrock/1.16.210/types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -589,15 +589,15 @@ Recipes: []varint
7: shaped_chemistry #'ENTRY_SHAPED_CHEMISTRY', //TODO
recipe: type?
if shapeless or shulker_box or shapeless_chemistry:
recipe_id: string
recipe_id: LatinString
input: RecipeIngredient[]varint
output: Item[]varint
uuid: uuid
block: string
priority: zigzag32
network_id: varint
if shaped or shaped_chemistry:
recipe_id: string
recipe_id: LatinString
width: zigzag32
height: zigzag32
# todo: can this become
Expand Down
1 change: 1 addition & 0 deletions data/bedrock/1.16.220/proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ string: ["pstring",{"countType":"varint"}]
ByteArray: ["buffer",{"countType":"varint"}]
SignedByteArray: ["buffer",{"countType":"zigzag32"}]
LittleString: ["pstring",{"countType":"li32"}]
LatinString: ["pstring",{"countType":"varint", "encoding": "latin1"}]
ShortArray: ["buffer",{"countType":"li16"}]
ShortString: ["pstring",{"countType":"li16"}]
varint64: native # Some primitives
Expand Down
17 changes: 12 additions & 5 deletions data/bedrock/1.16.220/protocol.json
Original file line number Diff line number Diff line change
Expand Up @@ -1355,7 +1355,7 @@
[
{
"name": "recipe_id",
"type": "string"
"type": "LatinString"
},
{
"name": "input",
Expand Down Expand Up @@ -1400,7 +1400,7 @@
[
{
"name": "recipe_id",
"type": "string"
"type": "LatinString"
},
{
"name": "input",
Expand Down Expand Up @@ -1445,7 +1445,7 @@
[
{
"name": "recipe_id",
"type": "string"
"type": "LatinString"
},
{
"name": "input",
Expand Down Expand Up @@ -1490,7 +1490,7 @@
[
{
"name": "recipe_id",
"type": "string"
"type": "LatinString"
},
{
"name": "width",
Expand Down Expand Up @@ -1549,7 +1549,7 @@
[
{
"name": "recipe_id",
"type": "string"
"type": "LatinString"
},
{
"name": "width",
Expand Down Expand Up @@ -8690,6 +8690,13 @@
"countType": "li32"
}
],
"LatinString": [
"pstring",
{
"countType": "varint",
"encoding": "latin1"
}
],
"ShortArray": [
"buffer",
{
Expand Down
4 changes: 2 additions & 2 deletions data/bedrock/1.16.220/types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -626,15 +626,15 @@ Recipes: []varint
7: shaped_chemistry #'ENTRY_SHAPED_CHEMISTRY', //TODO
recipe: type?
if shapeless or shulker_box or shapeless_chemistry:
recipe_id: string
recipe_id: LatinString
input: RecipeIngredient[]varint
output: ItemLegacy[]varint
uuid: uuid
block: string
priority: zigzag32
network_id: varint
if shaped or shaped_chemistry:
recipe_id: string
recipe_id: LatinString
width: zigzag32
height: zigzag32
# 2D input array, size of width*height
Expand Down
1 change: 1 addition & 0 deletions data/bedrock/1.17.0/proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ string: ["pstring",{"countType":"varint"}] # String / array types
ByteArray: ["buffer",{"countType":"varint"}]
SignedByteArray: ["buffer",{"countType":"zigzag32"}]
LittleString: ["pstring",{"countType":"li32"}]
LatinString: ["pstring",{"countType":"varint", "encoding": "latin1"}]
ShortArray: ["buffer",{"countType":"li16"}]
ShortString: ["pstring",{"countType":"li16"}]
varint64: native # Some primitives
Expand Down
17 changes: 12 additions & 5 deletions data/bedrock/1.17.0/protocol.json
Original file line number Diff line number Diff line change
Expand Up @@ -1358,7 +1358,7 @@
[
{
"name": "recipe_id",
"type": "string"
"type": "LatinString"
},
{
"name": "input",
Expand Down Expand Up @@ -1403,7 +1403,7 @@
[
{
"name": "recipe_id",
"type": "string"
"type": "LatinString"
},
{
"name": "input",
Expand Down Expand Up @@ -1448,7 +1448,7 @@
[
{
"name": "recipe_id",
"type": "string"
"type": "LatinString"
},
{
"name": "input",
Expand Down Expand Up @@ -1493,7 +1493,7 @@
[
{
"name": "recipe_id",
"type": "string"
"type": "LatinString"
},
{
"name": "width",
Expand Down Expand Up @@ -1552,7 +1552,7 @@
[
{
"name": "recipe_id",
"type": "string"
"type": "LatinString"
},
{
"name": "width",
Expand Down Expand Up @@ -8800,6 +8800,13 @@
"countType": "li32"
}
],
"LatinString": [
"pstring",
{
"countType": "varint",
"encoding": "latin1"
}
],
"ShortArray": [
"buffer",
{
Expand Down
4 changes: 2 additions & 2 deletions data/bedrock/1.17.0/types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -629,15 +629,15 @@ Recipes: []varint
7: shaped_chemistry #'ENTRY_SHAPED_CHEMISTRY', //TODO
recipe: type?
if shapeless or shulker_box or shapeless_chemistry:
recipe_id: string
recipe_id: LatinString
input: RecipeIngredient[]varint
output: ItemLegacy[]varint
uuid: uuid
block: string
priority: zigzag32
network_id: varint
if shaped or shaped_chemistry:
recipe_id: string
recipe_id: LatinString
width: zigzag32
height: zigzag32
# 2D input array, size of width*height
Expand Down
1 change: 1 addition & 0 deletions data/bedrock/1.17.10/proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ string: ["pstring",{"countType":"varint"}] # String / array types
ByteArray: ["buffer",{"countType":"varint"}]
SignedByteArray: ["buffer",{"countType":"zigzag32"}]
LittleString: ["pstring",{"countType":"li32"}]
LatinString: ["pstring",{"countType":"varint", "encoding": "latin1"}]
ShortArray: ["buffer",{"countType":"li16"}]
ShortString: ["pstring",{"countType":"li16"}]
varint64: native # Some primitives
Expand Down
Loading

0 comments on commit 900ebf2

Please sign in to comment.