Skip to content

Commit 17a73df

Browse files
committed
Handle set_player_inventory
1 parent 5e9d213 commit 17a73df

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

common/src/main/java/com/viaversion/viaversion/protocols/v1_21_2to1_21_4/rewriter/BlockItemPacketRewriter1_21_4.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public void registerPackets() {
6565
protocol.cancelServerbound(ServerboundPackets1_21_4.PICK_ITEM_FROM_ENTITY);
6666

6767
protocol.registerClientbound(ClientboundPackets1_21_2.SET_CURSOR_ITEM, this::passthroughClientboundItem);
68+
registerSetPlayerInventory(ClientboundPackets1_21_2.SET_PLAYER_INVENTORY);
6869
registerCooldown1_21_2(ClientboundPackets1_21_2.COOLDOWN);
6970
registerSetContent1_21_2(ClientboundPackets1_21_2.CONTAINER_SET_CONTENT);
7071
registerSetSlot1_21_2(ClientboundPackets1_21_2.CONTAINER_SET_SLOT);

common/src/main/java/com/viaversion/viaversion/rewriter/ItemRewriter.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,13 @@ public void registerContainerClick1_17_1(S packetType, Type<? extends Number> co
231231
});
232232
}
233233

234+
public void registerSetPlayerInventory(C packetType) {
235+
protocol.registerClientbound(packetType, wrapper -> {
236+
wrapper.passthrough(Types.VAR_INT); // Slot
237+
passthroughClientboundItem(wrapper);
238+
});
239+
}
240+
234241
public void registerCooldown(C packetType) {
235242
protocol.registerClientbound(packetType, wrapper -> {
236243
int itemId = wrapper.read(Types.VAR_INT);

0 commit comments

Comments
 (0)