geforkt von Mirrors/Paper
SPIGOT-4547: Call EntitySpawnEvent as general spawn fallback event
By: md_5 <git@md-5.net>
Dieser Commit ist enthalten in:
Ursprung
5e4a190d2c
Commit
fbbba56eca
@ -383,6 +383,8 @@ public class CraftEventFactory {
|
||||
event = CraftEventFactory.callProjectileLaunchEvent(entity);
|
||||
} else if (entity.getBukkitEntity() instanceof org.bukkit.entity.Vehicle){
|
||||
event = CraftEventFactory.callVehicleCreateEvent(entity);
|
||||
} else {
|
||||
event = CraftEventFactory.callEntitySpawnEvent(entity);
|
||||
}
|
||||
|
||||
if (event != null && (event.isCancelled() || entity.dead)) {
|
||||
@ -400,6 +402,17 @@ public class CraftEventFactory {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* EntitySpawnEvent
|
||||
*/
|
||||
public static EntitySpawnEvent callEntitySpawnEvent(Entity entity) {
|
||||
org.bukkit.entity.Entity bukkitEntity = entity.getBukkitEntity();
|
||||
|
||||
EntitySpawnEvent event = new EntitySpawnEvent(bukkitEntity);
|
||||
bukkitEntity.getServer().getPluginManager().callEvent(event);
|
||||
return event;
|
||||
}
|
||||
|
||||
/**
|
||||
* CreatureSpawnEvent
|
||||
*/
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren