mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-12-22 00:17:37 +01:00
Handle set_player_inventory
This commit is contained in:
parent
5e9d213082
commit
17a73dff82
@ -65,6 +65,7 @@ public final class BlockItemPacketRewriter1_21_4 extends StructuredItemRewriter<
|
||||
protocol.cancelServerbound(ServerboundPackets1_21_4.PICK_ITEM_FROM_ENTITY);
|
||||
|
||||
protocol.registerClientbound(ClientboundPackets1_21_2.SET_CURSOR_ITEM, this::passthroughClientboundItem);
|
||||
registerSetPlayerInventory(ClientboundPackets1_21_2.SET_PLAYER_INVENTORY);
|
||||
registerCooldown1_21_2(ClientboundPackets1_21_2.COOLDOWN);
|
||||
registerSetContent1_21_2(ClientboundPackets1_21_2.CONTAINER_SET_CONTENT);
|
||||
registerSetSlot1_21_2(ClientboundPackets1_21_2.CONTAINER_SET_SLOT);
|
||||
|
@ -231,6 +231,13 @@ public class ItemRewriter<C extends ClientboundPacketType, S extends Serverbound
|
||||
});
|
||||
}
|
||||
|
||||
public void registerSetPlayerInventory(C packetType) {
|
||||
protocol.registerClientbound(packetType, wrapper -> {
|
||||
wrapper.passthrough(Types.VAR_INT); // Slot
|
||||
passthroughClientboundItem(wrapper);
|
||||
});
|
||||
}
|
||||
|
||||
public void registerCooldown(C packetType) {
|
||||
protocol.registerClientbound(packetType, wrapper -> {
|
||||
int itemId = wrapper.read(Types.VAR_INT);
|
||||
|
Loading…
Reference in New Issue
Block a user