36 lines
995 B
Java

package org.bukkit.craftbukkit.entity;
import com.google.common.base.Preconditions;
import net.minecraft.world.entity.animal.EntityMushroomCow;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.MushroomCow;
import org.bukkit.entity.MushroomCow.Variant;
public class CraftMushroomCow extends CraftCow implements MushroomCow {
public CraftMushroomCow(CraftServer server, EntityMushroomCow entity) {
super(server, entity);
}
@Override
public EntityMushroomCow getHandle() {
return (EntityMushroomCow) entity;
}
@Override
public Variant getVariant() {
return Variant.values()[getHandle().getVariant().ordinal()];
}
@Override
public void setVariant(Variant variant) {
Preconditions.checkArgument(variant != null, "variant");
getHandle().setVariant(EntityMushroomCow.Type.values()[variant.ordinal()]);
}
@Override
public String toString() {
return "CraftMushroomCow";
}
}