From a1226abb816350658b3f830784bcb539f44110db Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Fri, 25 Jun 2021 07:19:28 +1200 Subject: [PATCH] Fix axololtl disguises being pickable by players --- .../packetlisteners/PacketListenerClientInteract.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerClientInteract.java b/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerClientInteract.java index 4836aad4..2ca38153 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerClientInteract.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/packets/packetlisteners/PacketListenerClientInteract.java @@ -18,6 +18,7 @@ import me.libraryaddict.disguise.events.DisguiseInteractEvent; import me.libraryaddict.disguise.utilities.DisguiseUtilities; import org.bukkit.Bukkit; import org.bukkit.Material; +import org.bukkit.entity.Axolotl; import org.bukkit.entity.Player; import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; @@ -104,6 +105,13 @@ public class PacketListenerClientInteract extends PacketAdapter { } switch (disguise.getType()) { + case AXOLOTL: + // They can't be picked up by a bucket sir if they are fake + if (!(disguise.getEntity() instanceof Axolotl)) { + DisguiseUtilities.refreshTrackers((TargetedDisguise) disguise); + observer.updateInventory(); // Remove their fake bucket + } + break; case CAT: case WOLF: case SHEEP: