From 51a9b6ad0f898811df05299bd5a03889ece1b6da Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sat, 27 Apr 2019 12:52:52 +1000 Subject: [PATCH] SPIGOT-4784: Collar colour API for Cats By: md_5 --- .../java/org/bukkit/craftbukkit/entity/CraftCat.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftCat.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftCat.java index 989a8aa218..71084be470 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftCat.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftCat.java @@ -2,6 +2,8 @@ package org.bukkit.craftbukkit.entity; import com.google.common.base.Preconditions; import net.minecraft.server.EntityCat; +import net.minecraft.server.EnumColor; +import org.bukkit.DyeColor; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.Cat; import org.bukkit.entity.EntityType; @@ -38,4 +40,14 @@ public class CraftCat extends CraftTameableAnimal implements Cat { getHandle().setCatType(type.ordinal()); } + + @Override + public DyeColor getCollarColor() { + return DyeColor.getByWoolData((byte) getHandle().ei().getColorIndex()); + } + + @Override + public void setCollarColor(DyeColor color) { + getHandle().a(EnumColor.fromColorIndex(color.getWoolData())); + } }