mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-23 01:17:44 +01:00
Add variant API to MushroomCow
This commit is contained in:
parent
abab38526a
commit
4b9b0f4d5b
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user