2015-05-25 12:37:24 +02:00
|
|
|
--- a/net/minecraft/server/EntityLargeFireball.java
|
|
|
|
+++ b/net/minecraft/server/EntityLargeFireball.java
|
2017-03-15 05:26:36 +01:00
|
|
|
@@ -1,15 +1,19 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
package net.minecraft.server;
|
|
|
|
|
|
|
|
+import org.bukkit.event.entity.ExplosionPrimeEvent; // CraftBukkit
|
|
|
|
+
|
|
|
|
public class EntityLargeFireball extends EntityFireball {
|
|
|
|
|
|
|
|
public int yield = 1;
|
2017-03-15 05:26:36 +01:00
|
|
|
|
|
|
|
public EntityLargeFireball(World world) {
|
|
|
|
super(world);
|
|
|
|
+ isIncendiary = this.world.getGameRules().getBoolean("mobGriefing"); // CraftBukkit
|
|
|
|
}
|
|
|
|
|
|
|
|
public EntityLargeFireball(World world, EntityLiving entityliving, double d0, double d1, double d2) {
|
|
|
|
super(world, entityliving, d0, d1, d2);
|
|
|
|
+ isIncendiary = this.world.getGameRules().getBoolean("mobGriefing"); // CraftBukkit
|
|
|
|
}
|
|
|
|
|
|
|
|
protected void a(MovingObjectPosition movingobjectposition) {
|
|
|
|
@@ -21,7 +25,15 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
|
|
|
|
boolean flag = this.world.getGameRules().getBoolean("mobGriefing");
|
|
|
|
|
|
|
|
- this.world.createExplosion((Entity) null, this.locX, this.locY, this.locZ, (float) this.yield, flag, flag);
|
|
|
|
+ // CraftBukkit start - fire ExplosionPrimeEvent
|
|
|
|
+ ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) org.bukkit.craftbukkit.entity.CraftEntity.getEntity(this.world.getServer(), this));
|
|
|
|
+ this.world.getServer().getPluginManager().callEvent(event);
|
|
|
|
+
|
|
|
|
+ if (!event.isCancelled()) {
|
|
|
|
+ // give 'this' instead of (Entity) null so we know what causes the damage
|
2017-03-15 05:26:36 +01:00
|
|
|
+ this.world.createExplosion(this, this.locX, this.locY, this.locZ, event.getRadius(), event.getFire(), isIncendiary);
|
2014-11-25 22:32:16 +01:00
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
this.die();
|
|
|
|
}
|
|
|
|
|
2017-03-15 05:26:36 +01:00
|
|
|
@@ -39,7 +51,8 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
public void a(NBTTagCompound nbttagcompound) {
|
|
|
|
super.a(nbttagcompound);
|
|
|
|
if (nbttagcompound.hasKeyOfType("ExplosionPower", 99)) {
|
|
|
|
- this.yield = nbttagcompound.getInt("ExplosionPower");
|
|
|
|
+ // CraftBukkit - set bukkitYield when setting explosionpower
|
|
|
|
+ bukkitYield = this.yield = nbttagcompound.getInt("ExplosionPower");
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|