diff options
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/projectile/LargeFireball.java.patch')
-rw-r--r-- | patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/projectile/LargeFireball.java.patch | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/projectile/LargeFireball.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/projectile/LargeFireball.java.patch new file mode 100644 index 0000000000..99a6249186 --- /dev/null +++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/projectile/LargeFireball.java.patch @@ -0,0 +1,60 @@ +--- a/net/minecraft/world/entity/projectile/LargeFireball.java ++++ b/net/minecraft/world/entity/projectile/LargeFireball.java +@@ -8,18 +8,21 @@ + import net.minecraft.world.level.Level; + import net.minecraft.world.phys.EntityHitResult; + import net.minecraft.world.phys.HitResult; ++import org.bukkit.event.entity.ExplosionPrimeEvent; // CraftBukkit + + public class LargeFireball extends Fireball { + + private int explosionPower = 1; + +- public LargeFireball(EntityType<? extends LargeFireball> entitytype, Level level) { +- super(entitytype, level); ++ public LargeFireball(EntityType<? extends LargeFireball> entityType, Level level) { ++ super(entityType, level); ++ isIncendiary = this.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING); // CraftBukkit + } + + public LargeFireball(Level level, LivingEntity livingentity, double d0, double d1, double d2, int i) { + super(EntityType.FIREBALL, livingentity, d0, d1, d2, level); + this.explosionPower = i; ++ isIncendiary = this.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING); // CraftBukkit + } + + @Override +@@ -29,7 +31,15 @@ + if (!this.level().isClientSide) { + boolean flag = this.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING); + +- this.level().explode(this, this.getX(), this.getY(), this.getZ(), (float) this.explosionPower, flag, Level.ExplosionInteraction.MOB); ++ // CraftBukkit start - fire ExplosionPrimeEvent ++ ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) this.getBukkitEntity()); ++ this.level().getCraftServer().getPluginManager().callEvent(event); ++ ++ if (!event.isCancelled()) { ++ // give 'this' instead of (Entity) null so we know what causes the damage ++ this.level().explode(this, this.getX(), this.getY(), this.getZ(), event.getRadius(), event.getFire(), Level.a.MOB); ++ } ++ // CraftBukkit end + this.discard(); + } + +@@ -59,11 +67,11 @@ + } + + @Override +- @Override +- public void readAdditionalSaveData(CompoundTag compoundtag) { +- super.readAdditionalSaveData(compoundtag); +- if (compoundtag.contains("ExplosionPower", 99)) { +- this.explosionPower = compoundtag.getByte("ExplosionPower"); ++ public void readAdditionalSaveData(CompoundTag compound) { ++ super.readAdditionalSaveData(compound); ++ if (compound.contains("ExplosionPower", 99)) { ++ // CraftBukkit - set bukkitYield when setting explosionpower ++ bukkitYield = this.explosionPower = compound.getByte("ExplosionPower"); + } + + } |