[Bleeding] Added Ageable interface for Villagers and Animals to extend. Addresses BUKKIT-1232
This commit is contained in:
@@ -2,7 +2,7 @@ package net.minecraft.server;
|
||||
|
||||
// CraftBukkit start
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Animals;
|
||||
import org.bukkit.entity.Ageable;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
||||
import org.bukkit.event.player.PlayerEggThrowEvent;
|
||||
@@ -51,8 +51,8 @@ public class EntityEgg extends EntityProjectile {
|
||||
for (int k = 0; k < numHatching; k++) {
|
||||
org.bukkit.entity.Entity entity = world.getWorld().spawn(new Location(world.getWorld(), this.locX, this.locY, this.locZ, this.yaw, 0.0F), hatchingType.getEntityClass(), SpawnReason.EGG);
|
||||
|
||||
if (entity instanceof Animals) {
|
||||
((Animals) entity).setBaby();
|
||||
if (entity instanceof Ageable) {
|
||||
((Ageable) entity).setBaby();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user