Skip to content

Commit

Permalink
Correction to bedrock ItemStackRequests packet auto craft (#894)
Browse files Browse the repository at this point in the history
  • Loading branch information
extremeheat committed Jul 10, 2024
1 parent d84b228 commit ddd0700
Show file tree
Hide file tree
Showing 60 changed files with 1,324 additions and 141 deletions.
4 changes: 4 additions & 0 deletions data/bedrock/1.16.201/protocol.json
Original file line number Diff line number Diff line change
Expand Up @@ -2226,6 +2226,10 @@
{
"name": "recipe_network_id",
"type": "varint"
},
{
"name": "times_crafted",
"type": "u8"
}
]
],
Expand Down
7 changes: 6 additions & 1 deletion data/bedrock/1.16.201/types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -687,11 +687,16 @@ ItemStackRequests: []varint
# PrimaryEffect and SecondaryEffect are the effects that were selected from the beacon.
primary_effect: zigzag32
secondary_effect: zigzag32
if craft_recipe or craft_recipe_auto:
if craft_recipe:
# RecipeNetworkID is the network ID of the recipe that is about to be crafted. This network ID matches
# one of the recipes sent in the CraftingData packet, where each of the recipes have a RecipeNetworkID as
# of 1.16.
recipe_network_id: varint
if craft_recipe_auto:
# RecipeNetworkID is the network ID of the recipe that is about to be crafted. This network ID matches
# one of the recipes sent in the CraftingData packet, where each of the recipes have a RecipeNetworkID as
recipe_network_id: varint
times_crafted: u8
if craft_creative:
# CreativeItemNetworkID is the network ID of the creative item that is being created. This is one of the
# creative item network IDs sent in the CreativeContent packet.
Expand Down
8 changes: 6 additions & 2 deletions data/bedrock/1.16.210/protocol.json
Original file line number Diff line number Diff line change
Expand Up @@ -2226,7 +2226,7 @@
[
{
"name": "request_id",
"type": "varint"
"type": "zigzag32"
},
{
"name": "actions",
Expand Down Expand Up @@ -2387,7 +2387,7 @@
"container",
[
{
"name": "unknown1",
"name": "hotbar_slot",
"type": "zigzag32"
},
{
Expand Down Expand Up @@ -2415,6 +2415,10 @@
{
"name": "recipe_network_id",
"type": "varint"
},
{
"name": "times_crafted",
"type": "u8"
}
]
],
Expand Down
13 changes: 9 additions & 4 deletions data/bedrock/1.16.210/types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ StackRequestSlotInfo:
ItemStackRequest:
# RequestID is a unique ID for the request. This ID is used by the server to send a response for this
# specific request in the ItemStackResponse packet.
request_id: varint
request_id: zigzag32
actions: []varint
type_id: u8 =>
# TakeStackRequestAction is sent by the client to the server to take x amount of items from one slot in a
Expand Down Expand Up @@ -865,19 +865,24 @@ ItemStackRequest:
primary_effect: zigzag32
secondary_effect: zigzag32
if mine_block:
# // Unknown1 ... TODO: Find out what this is for
unknown1: zigzag32
# Current hotbar slot
hotbar_slot: zigzag32
# PredictedDurability is the durability of the item that the client assumes to be present at the time
predicted_durability: zigzag32
# StackNetworkID is the unique stack ID that the client assumes to be present at the time. The server
# must check if these IDs match. If they do not match, servers should reject the stack request that the
# action holding this info was in.
network_id: zigzag32
if craft_recipe or craft_recipe_auto:
if craft_recipe:
# RecipeNetworkID is the network ID of the recipe that is about to be crafted. This network ID matches
# one of the recipes sent in the CraftingData packet, where each of the recipes have a RecipeNetworkID as
# of 1.16.
recipe_network_id: varint
if craft_recipe_auto:
# RecipeNetworkID is the network ID of the recipe that is about to be crafted. This network ID matches
# one of the recipes sent in the CraftingData packet, where each of the recipes have a RecipeNetworkID as
recipe_network_id: varint
times_crafted: u8
if craft_creative:
# The stack ID of the creative item that is being created. This is one of the
# creative item stack IDs sent in the CreativeContent packet.
Expand Down
6 changes: 5 additions & 1 deletion data/bedrock/1.16.220/protocol.json
Original file line number Diff line number Diff line change
Expand Up @@ -2381,7 +2381,7 @@
"container",
[
{
"name": "unknown1",
"name": "hotbar_slot",
"type": "zigzag32"
},
{
Expand Down Expand Up @@ -2409,6 +2409,10 @@
{
"name": "recipe_network_id",
"type": "varint"
},
{
"name": "times_crafted",
"type": "u8"
}
]
],
Expand Down
11 changes: 8 additions & 3 deletions data/bedrock/1.16.220/types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -873,19 +873,24 @@ ItemStackRequest:
primary_effect: zigzag32
secondary_effect: zigzag32
if mine_block:
# // Unknown1 ... TODO: Find out what this is for
unknown1: zigzag32
# Current hotbar slot
hotbar_slot: zigzag32
# PredictedDurability is the durability of the item that the client assumes to be present at the time
predicted_durability: zigzag32
# StackNetworkID is the unique stack ID that the client assumes to be present at the time. The server
# must check if these IDs match. If they do not match, servers should reject the stack request that the
# action holding this info was in.
network_id: zigzag32
if craft_recipe or craft_recipe_auto:
if craft_recipe:
# RecipeNetworkID is the network ID of the recipe that is about to be crafted. This network ID matches
# one of the recipes sent in the CraftingData packet, where each of the recipes have a RecipeNetworkID as
# of 1.16.
recipe_network_id: varint
if craft_recipe_auto:
# RecipeNetworkID is the network ID of the recipe that is about to be crafted. This network ID matches
# one of the recipes sent in the CraftingData packet, where each of the recipes have a RecipeNetworkID as
recipe_network_id: varint
times_crafted: u8
if craft_creative:
# The stack ID of the creative item that is being created. This is one of the
# creative item stack IDs sent in the CreativeContent packet.
Expand Down
6 changes: 5 additions & 1 deletion data/bedrock/1.17.0/protocol.json
Original file line number Diff line number Diff line change
Expand Up @@ -2387,7 +2387,7 @@
"container",
[
{
"name": "unknown1",
"name": "hotbar_slot",
"type": "zigzag32"
},
{
Expand Down Expand Up @@ -2415,6 +2415,10 @@
{
"name": "recipe_network_id",
"type": "varint"
},
{
"name": "times_crafted",
"type": "u8"
}
]
],
Expand Down
11 changes: 8 additions & 3 deletions data/bedrock/1.17.0/types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -876,19 +876,24 @@ ItemStackRequest:
primary_effect: zigzag32
secondary_effect: zigzag32
if mine_block:
# // Unknown1 ... TODO: Find out what this is for
unknown1: zigzag32
# Current hotbar slot
hotbar_slot: zigzag32
# PredictedDurability is the durability of the item that the client assumes to be present at the time
predicted_durability: zigzag32
# StackNetworkID is the unique stack ID that the client assumes to be present at the time. The server
# must check if these IDs match. If they do not match, servers should reject the stack request that the
# action holding this info was in.
network_id: zigzag32
if craft_recipe or craft_recipe_auto:
if craft_recipe:
# RecipeNetworkID is the network ID of the recipe that is about to be crafted. This network ID matches
# one of the recipes sent in the CraftingData packet, where each of the recipes have a RecipeNetworkID as
# of 1.16.
recipe_network_id: varint
if craft_recipe_auto:
# RecipeNetworkID is the network ID of the recipe that is about to be crafted. This network ID matches
# one of the recipes sent in the CraftingData packet, where each of the recipes have a RecipeNetworkID as
recipe_network_id: varint
times_crafted: u8
if craft_creative:
# The stack ID of the creative item that is being created. This is one of the
# creative item stack IDs sent in the CreativeContent packet.
Expand Down
6 changes: 5 additions & 1 deletion data/bedrock/1.17.10/protocol.json
Original file line number Diff line number Diff line change
Expand Up @@ -2387,7 +2387,7 @@
"container",
[
{
"name": "unknown1",
"name": "hotbar_slot",
"type": "zigzag32"
},
{
Expand Down Expand Up @@ -2415,6 +2415,10 @@
{
"name": "recipe_network_id",
"type": "varint"
},
{
"name": "times_crafted",
"type": "u8"
}
]
],
Expand Down
11 changes: 8 additions & 3 deletions data/bedrock/1.17.10/types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -876,19 +876,24 @@ ItemStackRequest:
primary_effect: zigzag32
secondary_effect: zigzag32
if mine_block:
# // Unknown1 ... TODO: Find out what this is for
unknown1: zigzag32
# Current hotbar slot
hotbar_slot: zigzag32
# PredictedDurability is the durability of the item that the client assumes to be present at the time
predicted_durability: zigzag32
# StackNetworkID is the unique stack ID that the client assumes to be present at the time. The server
# must check if these IDs match. If they do not match, servers should reject the stack request that the
# action holding this info was in.
network_id: zigzag32
if craft_recipe or craft_recipe_auto:
if craft_recipe:
# RecipeNetworkID is the network ID of the recipe that is about to be crafted. This network ID matches
# one of the recipes sent in the CraftingData packet, where each of the recipes have a RecipeNetworkID as
# of 1.16.
recipe_network_id: varint
if craft_recipe_auto:
# RecipeNetworkID is the network ID of the recipe that is about to be crafted. This network ID matches
# one of the recipes sent in the CraftingData packet, where each of the recipes have a RecipeNetworkID as
recipe_network_id: varint
times_crafted: u8
if craft_creative:
# The stack ID of the creative item that is being created. This is one of the
# creative item stack IDs sent in the CreativeContent packet.
Expand Down
6 changes: 5 additions & 1 deletion data/bedrock/1.17.30/protocol.json
Original file line number Diff line number Diff line change
Expand Up @@ -2395,7 +2395,7 @@
"container",
[
{
"name": "unknown1",
"name": "hotbar_slot",
"type": "zigzag32"
},
{
Expand Down Expand Up @@ -2423,6 +2423,10 @@
{
"name": "recipe_network_id",
"type": "varint"
},
{
"name": "times_crafted",
"type": "u8"
}
]
],
Expand Down
11 changes: 8 additions & 3 deletions data/bedrock/1.17.30/types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -881,19 +881,24 @@ ItemStackRequest:
primary_effect: zigzag32
secondary_effect: zigzag32
if mine_block:
# // Unknown1 ... TODO: Find out what this is for
unknown1: zigzag32
# Current hotbar slot
hotbar_slot: zigzag32
# PredictedDurability is the durability of the item that the client assumes to be present at the time
predicted_durability: zigzag32
# StackNetworkID is the unique stack ID that the client assumes to be present at the time. The server
# must check if these IDs match. If they do not match, servers should reject the stack request that the
# action holding this info was in.
network_id: zigzag32
if craft_recipe or craft_recipe_auto:
if craft_recipe:
# RecipeNetworkID is the network ID of the recipe that is about to be crafted. This network ID matches
# one of the recipes sent in the CraftingData packet, where each of the recipes have a RecipeNetworkID as
# of 1.16.
recipe_network_id: varint
if craft_recipe_auto:
# RecipeNetworkID is the network ID of the recipe that is about to be crafted. This network ID matches
# one of the recipes sent in the CraftingData packet, where each of the recipes have a RecipeNetworkID as
recipe_network_id: varint
times_crafted: u8
if craft_creative:
# The stack ID of the creative item that is being created. This is one of the
# creative item stack IDs sent in the CreativeContent packet.
Expand Down
6 changes: 5 additions & 1 deletion data/bedrock/1.17.40/protocol.json
Original file line number Diff line number Diff line change
Expand Up @@ -2397,7 +2397,7 @@
"container",
[
{
"name": "unknown1",
"name": "hotbar_slot",
"type": "zigzag32"
},
{
Expand Down Expand Up @@ -2425,6 +2425,10 @@
{
"name": "recipe_network_id",
"type": "varint"
},
{
"name": "times_crafted",
"type": "u8"
}
]
],
Expand Down
11 changes: 8 additions & 3 deletions data/bedrock/1.17.40/types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -887,19 +887,24 @@ ItemStackRequest:
primary_effect: zigzag32
secondary_effect: zigzag32
if mine_block:
# // Unknown1 ... TODO: Find out what this is for
unknown1: zigzag32
# Current hotbar slot
hotbar_slot: zigzag32
# PredictedDurability is the durability of the item that the client assumes to be present at the time
predicted_durability: zigzag32
# StackNetworkID is the unique stack ID that the client assumes to be present at the time. The server
# must check if these IDs match. If they do not match, servers should reject the stack request that the
# action holding this info was in.
network_id: zigzag32
if craft_recipe or craft_recipe_auto:
if craft_recipe:
# RecipeNetworkID is the network ID of the recipe that is about to be crafted. This network ID matches
# one of the recipes sent in the CraftingData packet, where each of the recipes have a RecipeNetworkID as
# of 1.16.
recipe_network_id: varint
if craft_recipe_auto:
# RecipeNetworkID is the network ID of the recipe that is about to be crafted. This network ID matches
# one of the recipes sent in the CraftingData packet, where each of the recipes have a RecipeNetworkID as
recipe_network_id: varint
times_crafted: u8
if craft_creative:
# The stack ID of the creative item that is being created. This is one of the
# creative item stack IDs sent in the CreativeContent packet.
Expand Down
6 changes: 5 additions & 1 deletion data/bedrock/1.18.0/protocol.json
Original file line number Diff line number Diff line change
Expand Up @@ -2397,7 +2397,7 @@
"container",
[
{
"name": "unknown1",
"name": "hotbar_slot",
"type": "zigzag32"
},
{
Expand Down Expand Up @@ -2425,6 +2425,10 @@
{
"name": "recipe_network_id",
"type": "varint"
},
{
"name": "times_crafted",
"type": "u8"
}
]
],
Expand Down
11 changes: 8 additions & 3 deletions data/bedrock/1.18.0/types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -887,19 +887,24 @@ ItemStackRequest:
primary_effect: zigzag32
secondary_effect: zigzag32
if mine_block:
# // Unknown1 ... TODO: Find out what this is for
unknown1: zigzag32
# Current hotbar slot
hotbar_slot: zigzag32
# PredictedDurability is the durability of the item that the client assumes to be present at the time
predicted_durability: zigzag32
# StackNetworkID is the unique stack ID that the client assumes to be present at the time. The server
# must check if these IDs match. If they do not match, servers should reject the stack request that the
# action holding this info was in.
network_id: zigzag32
if craft_recipe or craft_recipe_auto:
if craft_recipe:
# RecipeNetworkID is the network ID of the recipe that is about to be crafted. This network ID matches
# one of the recipes sent in the CraftingData packet, where each of the recipes have a RecipeNetworkID as
# of 1.16.
recipe_network_id: varint
if craft_recipe_auto:
# RecipeNetworkID is the network ID of the recipe that is about to be crafted. This network ID matches
# one of the recipes sent in the CraftingData packet, where each of the recipes have a RecipeNetworkID as
recipe_network_id: varint
times_crafted: u8
if craft_creative:
# The stack ID of the creative item that is being created. This is one of the
# creative item stack IDs sent in the CreativeContent packet.
Expand Down
Loading

0 comments on commit ddd0700

Please sign in to comment.