mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-12 09:51:12 +01:00
SPIGOT-4784: Collar colour API for Cats
This commit is contained in:
parent
6bb1f087e7
commit
884028b23b
1 changed files with 12 additions and 0 deletions
|
@ -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()));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue