diff options
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/projectile/LargeFireball.java.patch')
-rw-r--r-- | patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/projectile/LargeFireball.java.patch | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/projectile/LargeFireball.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/projectile/LargeFireball.java.patch new file mode 100644 index 0000000000..dce2bb426e --- /dev/null +++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/projectile/LargeFireball.java.patch @@ -0,0 +1,55 @@ +--- a/net/minecraft/world/entity/projectile/LargeFireball.java ++++ b/net/minecraft/world/entity/projectile/LargeFireball.java +@@ -8,25 +8,37 @@ + 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); ++ isIncendiary = this.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING); // CraftBukkit + } + +- public LargeFireball(Level level, LivingEntity shooter, double offsetX, double offsetY, double offsetZ, int explosionPower) { +- super(EntityType.FIREBALL, shooter, offsetX, offsetY, offsetZ, level); +- this.explosionPower = explosionPower; ++ public LargeFireball(Level level, LivingEntity shooter, double offsetX, double d1, double offsetY, int i) { ++ super(EntityType.FIREBALL, shooter, offsetX, d1, offsetY, level); ++ this.explosionPower = i; ++ isIncendiary = this.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING); // CraftBukkit + } + + @Override + protected void onHit(HitResult result) { + super.onHit(result); + if (!this.level().isClientSide) { +- boolean _boolean = this.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING); +- this.level().explode(this, this.getX(), this.getY(), this.getZ(), (float)this.explosionPower, _boolean, Level.ExplosionInteraction.MOB); ++ boolean flag = this.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING); ++ ++ // 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(); + } + } +@@ -54,7 +70,8 @@ + public void readAdditionalSaveData(CompoundTag compound) { + super.readAdditionalSaveData(compound); + if (compound.contains("ExplosionPower", 99)) { +- this.explosionPower = compound.getByte("ExplosionPower"); ++ // CraftBukkit - set bukkitYield when setting explosionpower ++ bukkitYield = this.explosionPower = compound.getByte("ExplosionPower"); + } + } + } |