aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/anthonyhilyard/iceberg/network/NewItemPickupEventPacket.java
diff options
context:
space:
mode:
authorAnthony Hilyard <anthony.hilyard@gmail.com>2021-12-04 21:27:28 -0800
committerAnthony Hilyard <anthony.hilyard@gmail.com>2021-12-04 21:27:28 -0800
commitf5d35697f524cda1736740e739f8afd902651c53 (patch)
tree1b582f6420418f62fbef9755434fbaebe7644ff6 /src/main/java/com/anthonyhilyard/iceberg/network/NewItemPickupEventPacket.java
parent36a1f98bba70892f4e06c3df8b2b0bb4d0d5fe03 (diff)
downloadIceberg-f5d35697f524cda1736740e739f8afd902651c53.tar.gz
Iceberg-f5d35697f524cda1736740e739f8afd902651c53.tar.bz2
Iceberg-f5d35697f524cda1736740e739f8afd902651c53.zip
Initial 1.18 port. Overhauled tooltip handling, added color code item
color support.
Diffstat (limited to 'src/main/java/com/anthonyhilyard/iceberg/network/NewItemPickupEventPacket.java')
-rw-r--r--src/main/java/com/anthonyhilyard/iceberg/network/NewItemPickupEventPacket.java45
1 files changed, 0 insertions, 45 deletions
diff --git a/src/main/java/com/anthonyhilyard/iceberg/network/NewItemPickupEventPacket.java b/src/main/java/com/anthonyhilyard/iceberg/network/NewItemPickupEventPacket.java
deleted file mode 100644
index b99a36d..0000000
--- a/src/main/java/com/anthonyhilyard/iceberg/network/NewItemPickupEventPacket.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package com.anthonyhilyard.iceberg.network;
-
-import net.minecraft.world.item.ItemStack;
-import net.minecraft.network.FriendlyByteBuf;
-import net.minecraftforge.common.MinecraftForge;
-import net.minecraftforge.fmllegacy.network.NetworkEvent;
-
-import java.util.UUID;
-import java.util.function.Supplier;
-
-import com.anthonyhilyard.iceberg.events.NewItemPickupEvent;
-
-
-public final class NewItemPickupEventPacket
-{
- private final UUID playerUUID;
- private final ItemStack item;
-
- public NewItemPickupEventPacket(final UUID playerUUID, final ItemStack item)
- {
- this.playerUUID = playerUUID;
- this.item = item;
- }
-
- public static void encode(final NewItemPickupEventPacket msg, final FriendlyByteBuf packetBuffer)
- {
- packetBuffer.writeUUID(msg.playerUUID);
- packetBuffer.writeItem(msg.item);
- }
-
- public static NewItemPickupEventPacket decode(final FriendlyByteBuf packetBuffer)
- {
- return new NewItemPickupEventPacket(packetBuffer.readUUID(), packetBuffer.readItem());
- }
-
- public static void handle(final NewItemPickupEventPacket msg, final Supplier<NetworkEvent.Context> contextSupplier)
- {
- final NetworkEvent.Context context = contextSupplier.get();
- context.enqueueWork(() -> {
- MinecraftForge.EVENT_BUS.post(new NewItemPickupEvent(msg.playerUUID, msg.item));
- });
- context.setPacketHandled(true);
- }
-
-} \ No newline at end of file