Add some missing CreatureSpawnEvent.SpawnReason calls

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2018-11-14 14:17:25 +11:00
parent 6fd5f1379b
commit d625045ee2
3 changed files with 14 additions and 5 deletions

View File

@@ -73,15 +73,17 @@
}
}
@@ -574,6 +604,11 @@
@@ -574,7 +604,12 @@
entitywitch.setCustomNameVisible(this.getCustomNameVisible());
}
- this.world.addEntity(entitywitch);
+ // CraftBukkit start
+ if (CraftEventFactory.callEntityTransformEvent(this, entitywitch, EntityTransformEvent.TransformReason.LIGHTNING).isCancelled()) {
+ return;
+ }
+ this.world.addEntity(entitywitch, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING);
+ // CraftBukkit end
this.world.addEntity(entitywitch);
this.die();
}
}