3
0
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:
Nassim Jahnke 2024-12-04 15:23:56 +01:00
Ursprung 5e9d213082
Commit 17a73dff82
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: EF6771C01F6EF02F
2 geänderte Dateien mit 8 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -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);

Datei anzeigen

@ -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);