diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/LlamaWatcher.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/LlamaWatcher.java index 46933142..7068a349 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/LlamaWatcher.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/watchers/LlamaWatcher.java @@ -21,8 +21,16 @@ public class LlamaWatcher extends ChestedHorseWatcher { return Llama.Color.values()[getData(MetaIndex.LLAMA_COLOR)]; } + public DyeColor getCarpet() { + if (!hasValue(MetaIndex.LLAMA_CARPET) || getData(MetaIndex.LLAMA_CARPET) == -1) { + return null; + } + + return AnimalColor.getColorByWool(getData(MetaIndex.LLAMA_CARPET)).getDyeColor(); + } + public void setCarpet(DyeColor dyeColor) { - setData(MetaIndex.LLAMA_CARPET, (int) dyeColor.getWoolData()); + setData(MetaIndex.LLAMA_CARPET, dyeColor == null ? -1 : (int) dyeColor.getWoolData()); sendData(MetaIndex.LLAMA_CARPET); } @@ -31,14 +39,6 @@ public class LlamaWatcher extends ChestedHorseWatcher { setCarpet(color.getDyeColor()); } - public DyeColor getCarpet() { - if (!hasValue(MetaIndex.LLAMA_CARPET)) { - return null; - } - - return AnimalColor.getColorByWool(getData(MetaIndex.LLAMA_CARPET)).getDyeColor(); - } - public void setStrength(int strength) { setData(MetaIndex.LLAMA_STRENGTH, strength); sendData(MetaIndex.LLAMA_STRENGTH);