Skip to content

Commit

Permalink
Don't use deprecated item types
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianMichael committed Oct 19, 2023
1 parent 3afef18 commit b8d239a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ public BlockItemPackets3D_Shareware(Protocol1_14to3D_Shareware protocol) {
@Override
protected void registerPackets() {
this.registerSetCooldown(ClientboundPackets3D_Shareware.COOLDOWN);
this.registerWindowItems(ClientboundPackets3D_Shareware.WINDOW_ITEMS, Type.FLAT_VAR_INT_ITEM_ARRAY);
this.registerSetSlot(ClientboundPackets3D_Shareware.SET_SLOT, Type.FLAT_VAR_INT_ITEM);
this.registerEntityEquipment(ClientboundPackets3D_Shareware.ENTITY_EQUIPMENT, Type.FLAT_VAR_INT_ITEM);
this.registerAdvancements(ClientboundPackets3D_Shareware.ADVANCEMENTS, Type.FLAT_VAR_INT_ITEM);
this.registerClickWindow(ServerboundPackets1_14.CLICK_WINDOW, Type.FLAT_VAR_INT_ITEM);
this.registerCreativeInvAction(ServerboundPackets1_14.CREATIVE_INVENTORY_ACTION, Type.FLAT_VAR_INT_ITEM);
this.registerSpawnParticle(ClientboundPackets3D_Shareware.SPAWN_PARTICLE, Type.FLAT_VAR_INT_ITEM, Type.FLOAT);
this.registerWindowItems(ClientboundPackets3D_Shareware.WINDOW_ITEMS, Type.ITEM1_13_2_SHORT_ARRAY);
this.registerSetSlot(ClientboundPackets3D_Shareware.SET_SLOT, Type.ITEM1_13_2);
this.registerEntityEquipment(ClientboundPackets3D_Shareware.ENTITY_EQUIPMENT, Type.ITEM1_13_2);
this.registerAdvancements(ClientboundPackets3D_Shareware.ADVANCEMENTS, Type.ITEM1_13_2);
this.registerClickWindow(ServerboundPackets1_14.CLICK_WINDOW, Type.ITEM1_13_2);
this.registerCreativeInvAction(ServerboundPackets1_14.CREATIVE_INVENTORY_ACTION, Type.ITEM1_13_2);
this.registerSpawnParticle(ClientboundPackets3D_Shareware.SPAWN_PARTICLE, Type.ITEM1_13_2, Type.FLOAT);

this.protocol.registerClientbound(ClientboundPackets3D_Shareware.TRADE_LIST, new PacketHandlers() {
public void register() {
Expand All @@ -48,10 +48,10 @@ public void register() {
int size = wrapper.passthrough(Type.UNSIGNED_BYTE);

for (int i = 0; i < size; ++i) {
BlockItemPackets3D_Shareware.this.handleItemToClient(wrapper.passthrough(Type.FLAT_VAR_INT_ITEM));
BlockItemPackets3D_Shareware.this.handleItemToClient(wrapper.passthrough(Type.FLAT_VAR_INT_ITEM));
BlockItemPackets3D_Shareware.this.handleItemToClient(wrapper.passthrough(Type.ITEM1_13_2));
BlockItemPackets3D_Shareware.this.handleItemToClient(wrapper.passthrough(Type.ITEM1_13_2));
if (wrapper.passthrough(Type.BOOLEAN)) {
BlockItemPackets3D_Shareware.this.handleItemToClient(wrapper.passthrough(Type.FLAT_VAR_INT_ITEM));
BlockItemPackets3D_Shareware.this.handleItemToClient(wrapper.passthrough(Type.ITEM1_13_2));
}

wrapper.passthrough(Type.BOOLEAN);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ public BlockItemPackets20w14infinite(Protocol1_16to20w14infinite protocol) {
@Override
protected void registerPackets() {
this.registerSetCooldown(ClientboundPackets20w14infinite.COOLDOWN);
this.registerWindowItems(ClientboundPackets20w14infinite.WINDOW_ITEMS, Type.FLAT_VAR_INT_ITEM_ARRAY);
this.registerSetSlot(ClientboundPackets20w14infinite.SET_SLOT, Type.FLAT_VAR_INT_ITEM);
this.registerWindowItems(ClientboundPackets20w14infinite.WINDOW_ITEMS, Type.ITEM1_13_2_SHORT_ARRAY);
this.registerSetSlot(ClientboundPackets20w14infinite.SET_SLOT, Type.ITEM1_13_2);
this.registerTradeList(ClientboundPackets20w14infinite.TRADE_LIST);
this.registerAdvancements(ClientboundPackets20w14infinite.ADVANCEMENTS, Type.FLAT_VAR_INT_ITEM);
this.registerSpawnParticle(ClientboundPackets20w14infinite.SPAWN_PARTICLE, Type.FLAT_VAR_INT_ITEM, Type.DOUBLE);
this.registerClickWindow(ServerboundPackets1_16.CLICK_WINDOW, Type.FLAT_VAR_INT_ITEM);
this.registerCreativeInvAction(ServerboundPackets1_16.CREATIVE_INVENTORY_ACTION, Type.FLAT_VAR_INT_ITEM);
this.registerAdvancements(ClientboundPackets20w14infinite.ADVANCEMENTS, Type.ITEM1_13_2);
this.registerSpawnParticle(ClientboundPackets20w14infinite.SPAWN_PARTICLE, Type.ITEM1_13_2, Type.DOUBLE);
this.registerClickWindow(ServerboundPackets1_16.CLICK_WINDOW, Type.ITEM1_13_2);
this.registerCreativeInvAction(ServerboundPackets1_16.CREATIVE_INVENTORY_ACTION, Type.ITEM1_13_2);
final BlockRewriter<ClientboundPackets20w14infinite> blockRewriter = new BlockRewriter<>(this.protocol, Type.POSITION1_14);
blockRewriter.registerBlockAction(ClientboundPackets20w14infinite.BLOCK_ACTION);
blockRewriter.registerBlockChange(ClientboundPackets20w14infinite.BLOCK_CHANGE);
Expand Down Expand Up @@ -114,15 +114,15 @@ public void register() {
handler(wrapper -> {
int slot = wrapper.read(Type.VAR_INT);
wrapper.write(Type.BYTE, (byte) slot);
handleItemToClient(wrapper.passthrough(Type.FLAT_VAR_INT_ITEM));
handleItemToClient(wrapper.passthrough(Type.ITEM1_13_2));
});
}
});

protocol.registerServerbound(ServerboundPackets1_16.EDIT_BOOK, new PacketHandlers() {
@Override
public void register() {
handler(wrapper -> handleItemToServer(wrapper.passthrough(Type.FLAT_VAR_INT_ITEM)));
handler(wrapper -> handleItemToServer(wrapper.passthrough(Type.ITEM1_13_2)));
}
});
}
Expand Down

0 comments on commit b8d239a

Please sign in to comment.