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

@@ -47,7 +47,15 @@
this.world.broadcastEntityEffect(this, (byte) 16);
}
@@ -123,7 +135,12 @@
@@ -116,14 +128,20 @@
entityvillager.setAgeRaw(-24000);
}
- this.world.kill(this);
+ // this.world.kill(this); // CraftBukkit - moved down
entityvillager.setNoAI(this.isNoAI());
if (this.hasCustomName()) {
entityvillager.setCustomName(this.getCustomName());
entityvillager.setCustomNameVisible(this.getCustomNameVisible());
}
@@ -56,12 +64,13 @@
+ if (CraftEventFactory.callEntityTransformEvent(this, entityvillager, EntityTransformEvent.TransformReason.CURED).isCancelled()) {
+ return;
+ }
+ // CraftBukkit end
+ this.world.kill(this); // CraftBukkit - from above
+ this.world.addEntity(entityvillager, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CURED); // CraftBukkit - add SpawnReason
+ // CraftBukkit end
if (this.bD != null) {
EntityHuman entityhuman = this.world.b(this.bD);
@@ -132,7 +149,7 @@
@@ -132,7 +150,7 @@
}
}