aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/og/net/minecraft/world/entity/projectile/EntityLargeFireball.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/og/net/minecraft/world/entity/projectile/EntityLargeFireball.patch')
-rw-r--r--patch-remap/og/net/minecraft/world/entity/projectile/EntityLargeFireball.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/world/entity/projectile/EntityLargeFireball.patch b/patch-remap/og/net/minecraft/world/entity/projectile/EntityLargeFireball.patch
new file mode 100644
index 0000000000..3a8815f46c
--- /dev/null
+++ b/patch-remap/og/net/minecraft/world/entity/projectile/EntityLargeFireball.patch
@@ -0,0 +1,51 @@
+--- a/net/minecraft/world/entity/projectile/EntityLargeFireball.java
++++ b/net/minecraft/world/entity/projectile/EntityLargeFireball.java
+@@ -9,17 +9,21 @@
+ import net.minecraft.world.phys.MovingObjectPosition;
+ import net.minecraft.world.phys.MovingObjectPositionEntity;
+
++import org.bukkit.event.entity.ExplosionPrimeEvent; // CraftBukkit
++
+ public class EntityLargeFireball extends EntityFireballFireball {
+
+ public int explosionPower = 1;
+
+ public EntityLargeFireball(EntityTypes<? extends EntityLargeFireball> entitytypes, World world) {
+ super(entitytypes, world);
++ isIncendiary = this.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING); // CraftBukkit
+ }
+
+ public EntityLargeFireball(World world, EntityLiving entityliving, double d0, double d1, double d2, int i) {
+ super(EntityTypes.FIREBALL, entityliving, d0, d1, d2, world);
+ this.explosionPower = i;
++ isIncendiary = this.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING); // CraftBukkit
+ }
+
+ @Override
+@@ -28,7 +32,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, World.a.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(), World.a.MOB);
++ }
++ // CraftBukkit end
+ this.discard();
+ }
+
+@@ -59,7 +71,8 @@
+ public void readAdditionalSaveData(NBTTagCompound nbttagcompound) {
+ super.readAdditionalSaveData(nbttagcompound);
+ if (nbttagcompound.contains("ExplosionPower", 99)) {
+- this.explosionPower = nbttagcompound.getByte("ExplosionPower");
++ // CraftBukkit - set bukkitYield when setting explosionpower
++ bukkitYield = this.explosionPower = nbttagcompound.getByte("ExplosionPower");
+ }
+
+ }