Fix llama unable to remove carpet, not sure if null is a valid arg tho
This commit is contained in:
		| @@ -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); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user