From c6ad0c146677678c08533811daffbc40f9bad5ab Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Thu, 15 Dec 2016 10:25:27 +1300 Subject: [PATCH] Fix Llama setColor and setCarpet and a sound error --- .../libraryaddict/disguise/disguisetypes/FlagType.java | 8 ++++---- .../disguise/disguisetypes/watchers/LlamaWatcher.java | 2 +- .../libraryaddict/disguise/utilities/DisguiseSound.java | 9 +++++++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/me/libraryaddict/disguise/disguisetypes/FlagType.java b/src/me/libraryaddict/disguise/disguisetypes/FlagType.java index f6bebdd0..d8067dc2 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/FlagType.java +++ b/src/me/libraryaddict/disguise/disguisetypes/FlagType.java @@ -16,6 +16,7 @@ import com.comphenix.protocol.wrappers.Vector3F; import com.comphenix.protocol.wrappers.WrappedBlockData; import com.google.common.base.Optional; +import me.libraryaddict.disguise.disguisetypes.watchers.AbstractHorseWatcher; import me.libraryaddict.disguise.disguisetypes.watchers.AgeableWatcher; import me.libraryaddict.disguise.disguisetypes.watchers.AreaEffectCloudWatcher; import me.libraryaddict.disguise.disguisetypes.watchers.ArmorStandWatcher; @@ -23,6 +24,7 @@ import me.libraryaddict.disguise.disguisetypes.watchers.ArrowWatcher; import me.libraryaddict.disguise.disguisetypes.watchers.BatWatcher; import me.libraryaddict.disguise.disguisetypes.watchers.BlazeWatcher; import me.libraryaddict.disguise.disguisetypes.watchers.BoatWatcher; +import me.libraryaddict.disguise.disguisetypes.watchers.ChestedHorseWatcher; import me.libraryaddict.disguise.disguisetypes.watchers.CreeperWatcher; import me.libraryaddict.disguise.disguisetypes.watchers.DroppedItemWatcher; import me.libraryaddict.disguise.disguisetypes.watchers.EnderCrystalWatcher; @@ -34,8 +36,6 @@ import me.libraryaddict.disguise.disguisetypes.watchers.FireworkWatcher; import me.libraryaddict.disguise.disguisetypes.watchers.FishingHookWatcher; import me.libraryaddict.disguise.disguisetypes.watchers.GhastWatcher; import me.libraryaddict.disguise.disguisetypes.watchers.GuardianWatcher; -import me.libraryaddict.disguise.disguisetypes.watchers.AbstractHorseWatcher; -import me.libraryaddict.disguise.disguisetypes.watchers.ChestedHorseWatcher; import me.libraryaddict.disguise.disguisetypes.watchers.HorseWatcher; import me.libraryaddict.disguise.disguisetypes.watchers.InsentientWatcher; import me.libraryaddict.disguise.disguisetypes.watchers.IronGolemWatcher; @@ -202,9 +202,9 @@ public class FlagType { public static FlagType LIVING_POTIONS = new FlagType(LivingWatcher.class, 2, 0); - public static FlagType LLAMA_CARPET = new FlagType(LlamaWatcher.class, 2, 0); + public static FlagType LLAMA_CARPET = new FlagType(LlamaWatcher.class, 1, 0); - public static FlagType LLAMA_COLOR = new FlagType(LlamaWatcher.class, 1, -1); + public static FlagType LLAMA_COLOR = new FlagType(LlamaWatcher.class, 2, -1); public static FlagType LLAMA_STRENGTH = new FlagType(LlamaWatcher.class, 0, 0); diff --git a/src/me/libraryaddict/disguise/disguisetypes/watchers/LlamaWatcher.java b/src/me/libraryaddict/disguise/disguisetypes/watchers/LlamaWatcher.java index 0a857d0a..5b2fc361 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/watchers/LlamaWatcher.java +++ b/src/me/libraryaddict/disguise/disguisetypes/watchers/LlamaWatcher.java @@ -22,7 +22,7 @@ public class LlamaWatcher extends ChestedHorseWatcher { } public void setCarpet(AnimalColor color) { - setData(FlagType.LLAMA_CARPET, color.ordinal()); + setData(FlagType.LLAMA_CARPET, color.getId()); sendData(FlagType.LLAMA_CARPET); } diff --git a/src/me/libraryaddict/disguise/utilities/DisguiseSound.java b/src/me/libraryaddict/disguise/utilities/DisguiseSound.java index 05667410..140b2824 100644 --- a/src/me/libraryaddict/disguise/utilities/DisguiseSound.java +++ b/src/me/libraryaddict/disguise/utilities/DisguiseSound.java @@ -175,8 +175,13 @@ public enum DisguiseSound { DisguiseSound(Object hurt, Object[] step, Object death, Object idle, Object... sounds) { addSound(hurt, SoundType.HURT); - for (Object obj : step) - addSound(obj, SoundType.STEP); + + if (step != null) { + for (Object obj : step) { + addSound(obj, SoundType.STEP); + } + } + addSound(death, SoundType.DEATH); addSound(idle, SoundType.IDLE);