3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-19 04:50:06 +01:00

Made Ender Dragons fire EntityRegainHealth events when getting healed by Ender Crystals.

Dieser Commit ist enthalten in:
EvilSeph 2012-02-08 10:55:15 -05:00
Ursprung 0a52fd372a
Commit 8e7e073523

Datei anzeigen

@ -9,8 +9,8 @@ import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.Location;
import org.bukkit.event.entity.EntityCreatePortalEvent; import org.bukkit.event.entity.EntityCreatePortalEvent;
import org.bukkit.event.entity.EntityRegainHealthEvent;
import java.util.ArrayList; import java.util.ArrayList;
import org.bukkit.PortalType; import org.bukkit.PortalType;
@ -346,7 +346,14 @@ public class EntityEnderDragon extends EntityComplex {
this.s = null; this.s = null;
} else if (this.ticksLived % 10 == 0 && this.health < this.t) { } else if (this.ticksLived % 10 == 0 && this.health < this.t) {
++this.health; // CraftBukkit start
EntityRegainHealthEvent event = new EntityRegainHealthEvent(this.getBukkitEntity(), 1, EntityRegainHealthEvent.RegainReason.ENDER_CRYSTAL);
this.world.getServer().getPluginManager().callEvent(event);
if (!event.isCancelled()) {
this.health += event.getAmount();
}
// CraftBukkit end
} }
} }