From c90bebecf9f4ea3d62e3ca97d291eb326bb08154 Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Sun, 3 May 2020 12:36:56 -0500 Subject: [PATCH] Fixes #13 --- .../java/net/seanomik/tamablefoxes/EntityTamableFox.java | 3 +++ src/main/java/net/seanomik/tamablefoxes/TamableFoxes.java | 7 ++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/seanomik/tamablefoxes/EntityTamableFox.java b/src/main/java/net/seanomik/tamablefoxes/EntityTamableFox.java index beccaaa..e879d7c 100644 --- a/src/main/java/net/seanomik/tamablefoxes/EntityTamableFox.java +++ b/src/main/java/net/seanomik/tamablefoxes/EntityTamableFox.java @@ -282,6 +282,9 @@ public class EntityTamableFox extends EntityFox { this.goalSit.setSitting(!this.isSitting()); return flag; } else if (entityhuman.isSneaking()) { // Swap/Put/Take item from fox. + // Ignore buckets since they can be easily duplicated. + if (itemstack.getItem() == Items.BUCKET || itemstack.getItem() == Items.LAVA_BUCKET || itemstack.getItem() == Items.WATER_BUCKET) return true; + if (!this.getEquipment(EnumItemSlot.MAINHAND).isEmpty()) { getBukkitEntity().getWorld().dropItem(getBukkitEntity().getLocation(), CraftItemStack.asBukkitCopy(this.getEquipment(EnumItemSlot.MAINHAND))); this.setSlot(EnumItemSlot.MAINHAND, new ItemStack(Items.AIR)); diff --git a/src/main/java/net/seanomik/tamablefoxes/TamableFoxes.java b/src/main/java/net/seanomik/tamablefoxes/TamableFoxes.java index 03d44a1..b21c987 100644 --- a/src/main/java/net/seanomik/tamablefoxes/TamableFoxes.java +++ b/src/main/java/net/seanomik/tamablefoxes/TamableFoxes.java @@ -14,11 +14,8 @@ import java.lang.reflect.Modifier; // @TODO: -/* @CHANGELOG (1.6.0): - * Code cleanup. - * Fixed low TPS issues. (If you run into any please DM me or create a github issue) - * When you tame a fox you now get the taming advancement. - * Added support for color codes in language.yml +/* @CHANGELOG (1.6.0-SNAPSHOT): + * Fix a bug of duplicating water/lava buckets. */ public final class TamableFoxes extends JavaPlugin implements Listener { private static TamableFoxes plugin;