Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-26 16:12:42 +01:00
Handle set_player_inventory
Dieser Commit ist enthalten in:
Ursprung
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.cancelServerbound(ServerboundPackets1_21_4.PICK_ITEM_FROM_ENTITY);
|
||||||
|
|
||||||
protocol.registerClientbound(ClientboundPackets1_21_2.SET_CURSOR_ITEM, this::passthroughClientboundItem);
|
protocol.registerClientbound(ClientboundPackets1_21_2.SET_CURSOR_ITEM, this::passthroughClientboundItem);
|
||||||
|
registerSetPlayerInventory(ClientboundPackets1_21_2.SET_PLAYER_INVENTORY);
|
||||||
registerCooldown1_21_2(ClientboundPackets1_21_2.COOLDOWN);
|
registerCooldown1_21_2(ClientboundPackets1_21_2.COOLDOWN);
|
||||||
registerSetContent1_21_2(ClientboundPackets1_21_2.CONTAINER_SET_CONTENT);
|
registerSetContent1_21_2(ClientboundPackets1_21_2.CONTAINER_SET_CONTENT);
|
||||||
registerSetSlot1_21_2(ClientboundPackets1_21_2.CONTAINER_SET_SLOT);
|
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) {
|
public void registerCooldown(C packetType) {
|
||||||
protocol.registerClientbound(packetType, wrapper -> {
|
protocol.registerClientbound(packetType, wrapper -> {
|
||||||
int itemId = wrapper.read(Types.VAR_INT);
|
int itemId = wrapper.read(Types.VAR_INT);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren