[Bleeding] Added Ageable interface for Villagers and Animals to extend. Addresses BUKKIT-1232

This commit is contained in:
aPunch
2012-03-19 14:12:17 -05:00
committed by EvilSeph
parent 96c4bb7da6
commit 169c2ee8cb
4 changed files with 72 additions and 49 deletions

View File

@@ -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();
}
}
}