Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-25 15:50:10 +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.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);
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren