SPIGOT-892: Set chicken egg baby age before adding it to world.
By: md_5 <git@md-5.net>
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
public class EntityEgg extends EntityProjectile {
|
||||
|
||||
public EntityEgg(World world) {
|
||||
@@ -19,21 +26,36 @@
|
||||
@@ -19,21 +26,37 @@
|
||||
movingobjectposition.entity.damageEntity(DamageSource.projectile(this, this.getShooter()), 0.0F);
|
||||
}
|
||||
|
||||
@@ -53,10 +53,11 @@
|
||||
- }
|
||||
+ if (hatching) {
|
||||
+ for (int k = 0; k < numHatching; k++) {
|
||||
+ org.bukkit.entity.Entity entity = world.getWorld().spawn(new org.bukkit.Location(world.getWorld(), this.locX, this.locY, this.locZ, this.yaw, 0.0F), hatchingType.getEntityClass(), org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.EGG);
|
||||
+ if (entity instanceof Ageable) {
|
||||
+ ((Ageable) entity).setBaby();
|
||||
+ Entity entity = world.getWorld().createEntity(new org.bukkit.Location(world.getWorld(), this.locX, this.locY, this.locZ, this.yaw, 0.0F), hatchingType.getEntityClass());
|
||||
+ if (entity.getBukkitEntity() instanceof Ageable) {
|
||||
+ ((Ageable) entity.getBukkitEntity()).setBaby();
|
||||
+ }
|
||||
+ world.getWorld().addEntity(entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.EGG);
|
||||
+ }
|
||||
}
|
||||
+ // CraftBukkit end
|
||||
|
||||
Reference in New Issue
Block a user