3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 20:40:08 +01:00

Make EntityEnderDragon call the ExplosionEventi

Rather than just creating the event and not worrying any further about it.
Thanks for the heads up snowleo!
Dieser Commit ist enthalten in:
Andrew Ardill 2011-12-08 10:30:20 +11:00
Ursprung a25151306c
Commit d75d1660b3

Datei anzeigen

@ -489,6 +489,7 @@ public class EntityEnderDragon extends EntityComplex {
// CraftBukkit start - set off an EntityExplodeEvent for the dragon exploding all these blocks
org.bukkit.entity.Entity bukkitEntity = this.getBukkitEntity();
EntityExplodeEvent event = new EntityExplodeEvent(bukkitEntity, bukkitEntity.getLocation(), destroyedBlocks, 0F);
Bukkit.getPluginManager().callEvent(event);
if (event.isCancelled()) {
// this flag literally means 'Dragon hit something hard' (Obsidian, White Stone or Bedrock) and will cause the dragon to slow down.
// We should consider adding an event extension for it, or perhaps returning true if the event is cancelled.