Add list of entities to EntityTransformEvent & move die calls

By: nathat890 <nathat890@outlook.com>
This commit is contained in:
CraftBukkit/Spigot
2018-12-05 09:51:20 +11:00
parent b69f1de549
commit e9e6bec4e5
6 changed files with 72 additions and 39 deletions

View File

@@ -13,7 +13,7 @@
public class EntityMushroomCow extends EntityCow {
public EntityMushroomCow(World world) {
@@ -23,6 +29,14 @@
@@ -23,9 +29,17 @@
return true;
} else if (itemstack.getItem() == Items.SHEARS && this.getAge() >= 0) {
@@ -27,8 +27,12 @@
+ // CraftBukkit end
this.world.addParticle(Particles.u, this.locX, this.locY + (double) (this.length / 2.0F), this.locZ, 0.0D, 0.0D, 0.0D);
if (!this.world.isClientSide) {
this.die();
@@ -35,7 +49,12 @@
- this.die();
+ // this.die(); // CraftBukkit - moved down
EntityCow entitycow = new EntityCow(this.world);
entitycow.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, this.pitch);
@@ -35,7 +49,14 @@
entitycow.setCustomName(this.getCustomName());
}
@@ -38,6 +42,8 @@
+ return false;
+ }
+ this.world.addEntity(entitycow, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SHEARED);
+
+ this.die(); // CraftBukkit - from above
+ // CraftBukkit end
for (int i = 0; i < 5; ++i) {