diff options
Diffstat (limited to 'patch-remap/mache-spigotflower/net/minecraft/world/entity/projectile/LargeFireball.java.patch')
-rw-r--r-- | patch-remap/mache-spigotflower/net/minecraft/world/entity/projectile/LargeFireball.java.patch | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower/net/minecraft/world/entity/projectile/LargeFireball.java.patch b/patch-remap/mache-spigotflower/net/minecraft/world/entity/projectile/LargeFireball.java.patch new file mode 100644 index 0000000000..c0c81bb858 --- /dev/null +++ b/patch-remap/mache-spigotflower/net/minecraft/world/entity/projectile/LargeFireball.java.patch @@ -0,0 +1,91 @@ +--- a/net/minecraft/world/entity/projectile/LargeFireball.java ++++ b/net/minecraft/world/entity/projectile/LargeFireball.java +@@ -8,39 +8,48 @@ + 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 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); ++ 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 +- @Override +- protected void onHit(HitResult hitresult) { +- super.onHit(hitresult); ++ protected void onHit(HitResult result) { ++ super.onHit(result); + 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(); + } + + } + + @Override +- @Override +- protected void onHitEntity(EntityHitResult entityhitresult) { +- super.onHitEntity(entityhitresult); ++ protected void onHitEntity(EntityHitResult result) { ++ super.onHitEntity(result); + if (!this.level().isClientSide) { +- Entity entity = entityhitresult.getEntity(); ++ Entity entity = result.getEntity(); + Entity entity1 = this.getOwner(); + + entity.hurt(this.damageSources().fireball(this, entity1), 6.0F); +@@ -52,18 +61,17 @@ + } + + @Override +- @Override +- public void addAdditionalSaveData(CompoundTag compoundtag) { +- super.addAdditionalSaveData(compoundtag); +- compoundtag.putByte("ExplosionPower", (byte) this.explosionPower); ++ public void addAdditionalSaveData(CompoundTag compound) { ++ super.addAdditionalSaveData(compound); ++ compound.putByte("ExplosionPower", (byte) this.explosionPower); + } + + @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"); + } + + } |