2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/entity/projectile/EntityLargeFireball.java
|
|
|
|
+++ b/net/minecraft/world/entity/projectile/EntityLargeFireball.java
|
2021-06-11 07:00:00 +02:00
|
|
|
@@ -11,17 +11,21 @@
|
2021-03-15 23:00:00 +01:00
|
|
|
import net.minecraft.world.phys.MovingObjectPosition;
|
|
|
|
import net.minecraft.world.phys.MovingObjectPositionEntity;
|
2014-11-25 22:32:16 +01:00
|
|
|
|
|
|
|
+import org.bukkit.event.entity.ExplosionPrimeEvent; // CraftBukkit
|
|
|
|
+
|
2019-04-23 04:00:00 +02:00
|
|
|
public class EntityLargeFireball extends EntityFireballFireball {
|
2014-11-25 22:32:16 +01:00
|
|
|
|
2021-06-11 07:00:00 +02:00
|
|
|
public int explosionPower = 1;
|
2017-03-15 05:26:36 +01:00
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
public EntityLargeFireball(EntityTypes<? extends EntityLargeFireball> entitytypes, World world) {
|
|
|
|
super(entitytypes, world);
|
2021-06-11 07:00:00 +02:00
|
|
|
+ isIncendiary = this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING); // CraftBukkit
|
2017-03-15 05:26:36 +01:00
|
|
|
}
|
|
|
|
|
2021-06-11 07:00:00 +02:00
|
|
|
public EntityLargeFireball(World world, EntityLiving entityliving, double d0, double d1, double d2, int i) {
|
2019-04-23 04:00:00 +02:00
|
|
|
super(EntityTypes.FIREBALL, entityliving, d0, d1, d2, world);
|
2021-06-11 07:00:00 +02:00
|
|
|
this.explosionPower = i;
|
|
|
|
+ isIncendiary = this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING); // CraftBukkit
|
2017-03-15 05:26:36 +01:00
|
|
|
}
|
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
@Override
|
2021-06-11 07:00:00 +02:00
|
|
|
@@ -30,7 +34,15 @@
|
|
|
|
if (!this.level.isClientSide) {
|
|
|
|
boolean flag = this.level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING);
|
2014-11-25 22:32:16 +01:00
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
- this.level.explode((Entity) null, this.getX(), this.getY(), this.getZ(), (float) this.explosionPower, flag, flag ? Explosion.Effect.DESTROY : Explosion.Effect.NONE);
|
2014-11-25 22:32:16 +01:00
|
|
|
+ // CraftBukkit start - fire ExplosionPrimeEvent
|
2019-03-04 16:12:52 +01:00
|
|
|
+ ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) this.getBukkitEntity());
|
2021-06-11 13:33:49 +02:00
|
|
|
+ this.level.getCraftServer().getPluginManager().callEvent(event);
|
2014-11-25 22:32:16 +01:00
|
|
|
+
|
|
|
|
+ if (!event.isCancelled()) {
|
|
|
|
+ // give 'this' instead of (Entity) null so we know what causes the damage
|
2021-11-21 23:00:00 +01:00
|
|
|
+ this.level.explode(this, this.getX(), this.getY(), this.getZ(), event.getRadius(), event.getFire(), flag ? Explosion.Effect.DESTROY : Explosion.Effect.NONE);
|
2014-11-25 22:32:16 +01:00
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2021-11-21 23:00:00 +01:00
|
|
|
this.discard();
|
2014-11-25 22:32:16 +01:00
|
|
|
}
|
|
|
|
|
2021-06-11 07:00:00 +02:00
|
|
|
@@ -61,7 +73,8 @@
|
2021-11-21 23:00:00 +01:00
|
|
|
public void readAdditionalSaveData(NBTTagCompound nbttagcompound) {
|
|
|
|
super.readAdditionalSaveData(nbttagcompound);
|
|
|
|
if (nbttagcompound.contains("ExplosionPower", 99)) {
|
2021-06-11 07:00:00 +02:00
|
|
|
- this.explosionPower = nbttagcompound.getByte("ExplosionPower");
|
2014-11-25 22:32:16 +01:00
|
|
|
+ // CraftBukkit - set bukkitYield when setting explosionpower
|
2021-06-11 07:00:00 +02:00
|
|
|
+ bukkitYield = this.explosionPower = nbttagcompound.getByte("ExplosionPower");
|
2014-11-25 22:32:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|