diff options
-rw-r--r-- | nms-patches/EntityShulker.patch | 9 | ||||
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftShulker.java | 15 |
2 files changed, 23 insertions, 1 deletions
diff --git a/nms-patches/EntityShulker.patch b/nms-patches/EntityShulker.patch index 750f38f0..c1482b16 100644 --- a/nms-patches/EntityShulker.patch +++ b/nms-patches/EntityShulker.patch @@ -11,6 +11,15 @@ public class EntityShulker extends EntityGolem implements IMonster { +@@ -14,7 +18,7 @@ + protected static final DataWatcherObject<EnumDirection> a = DataWatcher.a(EntityShulker.class, DataWatcherRegistry.l); + protected static final DataWatcherObject<Optional<BlockPosition>> b = DataWatcher.a(EntityShulker.class, DataWatcherRegistry.k); + protected static final DataWatcherObject<Byte> c = DataWatcher.a(EntityShulker.class, DataWatcherRegistry.a); +- protected static final DataWatcherObject<Byte> bw = DataWatcher.a(EntityShulker.class, DataWatcherRegistry.a); ++ public static final DataWatcherObject<Byte> bw = DataWatcher.a(EntityShulker.class, DataWatcherRegistry.a); // PAIL: protected -> public, rename COLOR + public static final EnumColor bx = EnumColor.PURPLE; + private float bA; + private float bB; @@ -65,7 +69,7 @@ } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftShulker.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftShulker.java index eef9d3c5..e8cb697a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftShulker.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftShulker.java @@ -1,7 +1,8 @@ package org.bukkit.craftbukkit.entity; -import net.minecraft.server.EntityGolem; +import com.google.common.base.Preconditions; import net.minecraft.server.EntityShulker; +import org.bukkit.DyeColor; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.EntityType; import org.bukkit.entity.Shulker; @@ -21,4 +22,16 @@ public class CraftShulker extends CraftGolem implements Shulker { public EntityShulker getHandle() { return (EntityShulker) entity; } + + @Override + public DyeColor getColor() { + return DyeColor.getByWoolData(getHandle().getDataWatcher().get(EntityShulker.bw)); + } + + @Override + public void setColor(DyeColor color) { + Preconditions.checkArgument(color != null, "color"); + + getHandle().getDataWatcher().set(EntityShulker.bw, color.getWoolData()); + } } |