diff --git a/src/main/java/net/raphimc/viaaprilfools/protocols/protocol1_14to3D_Shareware/packets/BlockItemPackets3D_Shareware.java b/src/main/java/net/raphimc/viaaprilfools/protocols/protocol1_14to3D_Shareware/packets/BlockItemPackets3D_Shareware.java index 6171c5d..e15f005 100644 --- a/src/main/java/net/raphimc/viaaprilfools/protocols/protocol1_14to3D_Shareware/packets/BlockItemPackets3D_Shareware.java +++ b/src/main/java/net/raphimc/viaaprilfools/protocols/protocol1_14to3D_Shareware/packets/BlockItemPackets3D_Shareware.java @@ -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.ITEM1_13_2)); - BlockItemPackets3D_Shareware.this.handleItemToClient(wrapper.passthrough(Type.ITEM1_13_2)); + BlockItemPackets3D_Shareware.this.handleItemToClient(wrapper.user(), wrapper.passthrough(Type.ITEM1_13_2)); + BlockItemPackets3D_Shareware.this.handleItemToClient(wrapper.user(), wrapper.passthrough(Type.ITEM1_13_2)); if (wrapper.passthrough(Type.BOOLEAN)) { - BlockItemPackets3D_Shareware.this.handleItemToClient(wrapper.passthrough(Type.ITEM1_13_2)); + BlockItemPackets3D_Shareware.this.handleItemToClient(wrapper.user(), wrapper.passthrough(Type.ITEM1_13_2)); } wrapper.passthrough(Type.BOOLEAN); diff --git a/src/main/java/net/raphimc/viaaprilfools/protocols/protocol1_14to3D_Shareware/packets/EntityPackets3D_Shareware.java b/src/main/java/net/raphimc/viaaprilfools/protocols/protocol1_14to3D_Shareware/packets/EntityPackets3D_Shareware.java index ef7dd96..3fb5183 100644 --- a/src/main/java/net/raphimc/viaaprilfools/protocols/protocol1_14to3D_Shareware/packets/EntityPackets3D_Shareware.java +++ b/src/main/java/net/raphimc/viaaprilfools/protocols/protocol1_14to3D_Shareware/packets/EntityPackets3D_Shareware.java @@ -17,6 +17,7 @@ */ package net.raphimc.viaaprilfools.protocols.protocol1_14to3D_Shareware.packets; +import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.minecraft.metadata.Metadata; import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers; import com.viaversion.viaversion.api.type.Type; @@ -51,7 +52,7 @@ public void register() { map(Type.SHORT); // 10 - Velocity Y map(Type.SHORT); // 11 - Velocity Z map(Types1_14.METADATA_LIST); // 12 - Metadata - handler(packetWrapper -> handleMetadata(packetWrapper.get(Types1_14.METADATA_LIST, 0))); + handler(packetWrapper -> handleMetadata(packetWrapper.user(), packetWrapper.get(Types1_14.METADATA_LIST, 0))); } }); this.protocol.registerClientbound(ClientboundPackets3D_Shareware.SPAWN_PLAYER, new PacketHandlers() { @@ -65,7 +66,7 @@ public void register() { map(Type.BYTE); // 5 - Yaw map(Type.BYTE); // 6 - Pitch map(Types1_14.METADATA_LIST); // 7 - Metadata - handler(packetWrapper -> handleMetadata(packetWrapper.get(Types1_14.METADATA_LIST, 0))); + handler(packetWrapper -> handleMetadata(packetWrapper.user(), packetWrapper.get(Types1_14.METADATA_LIST, 0))); } }); this.protocol.registerClientbound(ClientboundPackets3D_Shareware.ENTITY_METADATA, new PacketHandlers() { @@ -73,15 +74,15 @@ public void register() { public void register() { map(Type.VAR_INT); // 0 - Entity ID map(Types1_14.METADATA_LIST); - handler(packetWrapper -> handleMetadata(packetWrapper.get(Types1_14.METADATA_LIST, 0))); + handler(packetWrapper -> handleMetadata(packetWrapper.user(), packetWrapper.get(Types1_14.METADATA_LIST, 0))); } }); } - public void handleMetadata(final List metadataList) { + public void handleMetadata(final UserConnection user, final List metadataList) { for (Metadata metadata : metadataList) { if (metadata.metaType() == Types1_14.META_TYPES.itemType) { - metadata.setValue(this.protocol.getItemRewriter().handleItemToClient(metadata.value())); + metadata.setValue(this.protocol.getItemRewriter().handleItemToClient(user, metadata.value())); } } } diff --git a/src/main/java/net/raphimc/viaaprilfools/protocols/protocol1_16to20w14infinite/packets/BlockItemPackets20w14infinite.java b/src/main/java/net/raphimc/viaaprilfools/protocols/protocol1_16to20w14infinite/packets/BlockItemPackets20w14infinite.java index de71ac0..bd88d0e 100644 --- a/src/main/java/net/raphimc/viaaprilfools/protocols/protocol1_16to20w14infinite/packets/BlockItemPackets20w14infinite.java +++ b/src/main/java/net/raphimc/viaaprilfools/protocols/protocol1_16to20w14infinite/packets/BlockItemPackets20w14infinite.java @@ -114,7 +114,7 @@ public void register() { handler(wrapper -> { int slot = wrapper.read(Type.VAR_INT); wrapper.write(Type.BYTE, (byte) slot); - handleItemToClient(wrapper.passthrough(Type.ITEM1_13_2)); + handleItemToClient(wrapper.user(), wrapper.passthrough(Type.ITEM1_13_2)); }); } }); @@ -122,7 +122,7 @@ public void register() { protocol.registerServerbound(ServerboundPackets1_16.EDIT_BOOK, new PacketHandlers() { @Override public void register() { - handler(wrapper -> handleItemToServer(wrapper.passthrough(Type.ITEM1_13_2))); + handler(wrapper -> handleItemToServer(wrapper.user(), wrapper.passthrough(Type.ITEM1_13_2))); } }); }