52 lines
2.6 KiB
Diff
52 lines
2.6 KiB
Diff
--- a/net/minecraft/world/entity/boss/enderdragon/EntityEnderCrystal.java
|
|
+++ b/net/minecraft/world/entity/boss/enderdragon/EntityEnderCrystal.java
|
|
@@ -21,6 +21,11 @@
|
|
import net.minecraft.world.level.block.BlockFireAbstract;
|
|
import net.minecraft.world.level.dimension.end.EnderDragonBattle;
|
|
|
|
+// CraftBukkit start
|
|
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
|
+import org.bukkit.event.entity.ExplosionPrimeEvent;
|
|
+// CraftBukkit end
|
|
+
|
|
public class EntityEnderCrystal extends Entity {
|
|
|
|
private static final DataWatcherObject<Optional<BlockPosition>> DATA_BEAM_TARGET = DataWatcher.defineId(EntityEnderCrystal.class, DataWatcherRegistry.OPTIONAL_BLOCK_POS);
|
|
@@ -56,7 +61,11 @@
|
|
BlockPosition blockposition = this.blockPosition();
|
|
|
|
if (((WorldServer) this.level).dragonFight() != null && this.level.getBlockState(blockposition).isAir()) {
|
|
- this.level.setBlockAndUpdate(blockposition, BlockFireAbstract.getState(this.level, blockposition));
|
|
+ // CraftBukkit start
|
|
+ if (!CraftEventFactory.callBlockIgniteEvent(this.level, blockposition, this).isCancelled()) {
|
|
+ this.level.setBlockAndUpdate(blockposition, BlockFireAbstract.getState(this.level, blockposition));
|
|
+ }
|
|
+ // CraftBukkit end
|
|
}
|
|
}
|
|
|
|
@@ -96,9 +105,22 @@
|
|
return false;
|
|
} else {
|
|
if (!this.isRemoved() && !this.level.isClientSide) {
|
|
+ // CraftBukkit start - All non-living entities need this
|
|
+ if (CraftEventFactory.handleNonLivingEntityDamageEvent(this, damagesource, f, false)) {
|
|
+ return false;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
this.remove(Entity.RemovalReason.KILLED);
|
|
if (!damagesource.isExplosion()) {
|
|
- this.level.explode((Entity) null, this.getX(), this.getY(), this.getZ(), 6.0F, Explosion.Effect.DESTROY);
|
|
+ // CraftBukkit start
|
|
+ ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), 6.0F, false);
|
|
+ this.level.getCraftServer().getPluginManager().callEvent(event);
|
|
+ if (event.isCancelled()) {
|
|
+ this.unsetRemoved();
|
|
+ return false;
|
|
+ }
|
|
+ this.level.explode(this, this.getX(), this.getY(), this.getZ(), event.getRadius(), event.getFire(), Explosion.Effect.DESTROY);
|
|
+ // CraftBukkit end
|
|
}
|
|
|
|
this.onDestroyedBy(damagesource);
|