diff --git a/nms-patches/EntityMushroomCow.patch b/nms-patches/EntityMushroomCow.patch index 00ee0bd481..36e1818843 100644 --- a/nms-patches/EntityMushroomCow.patch +++ b/nms-patches/EntityMushroomCow.patch @@ -47,3 +47,12 @@ for (i = 0; i < 5; ++i) { this.world.addEntity(new EntityItem(this.world, this.locX, this.locY + (double) this.getHeight(), this.locZ, new ItemStack(this.dV().d.getBlock()))); +@@ -156,7 +176,7 @@ + return Pair.of(blockflowers.d(), blockflowers.e()); + } + +- private void a(EntityMushroomCow.Type entitymushroomcow_type) { ++ public void a(EntityMushroomCow.Type entitymushroomcow_type) { // PAIL + this.datawatcher.set(EntityMushroomCow.bz, entitymushroomcow_type.c); + } + diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java index c1ae676f24..5d1f2741eb 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java @@ -1,5 +1,6 @@ package org.bukkit.craftbukkit.entity; +import com.google.common.base.Preconditions; import net.minecraft.server.EntityMushroomCow; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.EntityType; @@ -15,11 +16,24 @@ public class CraftMushroomCow extends CraftCow implements MushroomCow { return (EntityMushroomCow) entity; } + @Override + public Variant getVariant() { + return Variant.values()[getHandle().dV().ordinal()]; + } + + @Override + public void setVariant(Variant variant) { + Preconditions.checkArgument(variant != null, "variant"); + + getHandle().a(EntityMushroomCow.Type.values()[variant.ordinal()]); + } + @Override public String toString() { return "CraftMushroomCow"; } + @Override public EntityType getType() { return EntityType.MUSHROOM_COW; }