42 lines
1.1 KiB
Java
42 lines
1.1 KiB
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.EntityType;
|
|
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";
|
|
}
|
|
|
|
@Override
|
|
public EntityType getType() {
|
|
return EntityType.MUSHROOM_COW;
|
|
}
|
|
}
|