diff options
author | md_5 <git@md-5.net> | 2017-03-15 15:26:36 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2017-03-15 15:26:36 +1100 |
commit | 251e4c9215141e01df87308c2faec3bf2e1e9460 (patch) | |
tree | a503a79e49192cdd1722c9fba18ae97f1fa5c5c8 /nms-patches/EntityLargeFireball.patch | |
parent | 2ad21b87f1f112752cac419551299043a8ab1111 (diff) | |
download | craftbukkit-251e4c9215141e01df87308c2faec3bf2e1e9460.tar craftbukkit-251e4c9215141e01df87308c2faec3bf2e1e9460.tar.gz craftbukkit-251e4c9215141e01df87308c2faec3bf2e1e9460.tar.lz craftbukkit-251e4c9215141e01df87308c2faec3bf2e1e9460.tar.xz craftbukkit-251e4c9215141e01df87308c2faec3bf2e1e9460.zip |
SPIGOT-3126: Make fireballs do a better job of respecting mobGriefing
Diffstat (limited to 'nms-patches/EntityLargeFireball.patch')
-rw-r--r-- | nms-patches/EntityLargeFireball.patch | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/nms-patches/EntityLargeFireball.patch b/nms-patches/EntityLargeFireball.patch index 0fed3d4c..3e4e73c7 100644 --- a/nms-patches/EntityLargeFireball.patch +++ b/nms-patches/EntityLargeFireball.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/EntityLargeFireball.java +++ b/net/minecraft/server/EntityLargeFireball.java -@@ -1,5 +1,7 @@ +@@ -1,15 +1,19 @@ package net.minecraft.server; +import org.bukkit.event.entity.ExplosionPrimeEvent; // CraftBukkit @@ -8,7 +8,19 @@ public class EntityLargeFireball extends EntityFireball { public int yield = 1; -@@ -21,7 +23,15 @@ + + 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 @@ boolean flag = this.world.getGameRules().getBoolean("mobGriefing"); @@ -19,13 +31,13 @@ + + if (!event.isCancelled()) { + // give 'this' instead of (Entity) null so we know what causes the damage -+ this.world.createExplosion(this, this.locX, this.locY, this.locZ, event.getRadius(), event.getFire(), flag); ++ this.world.createExplosion(this, this.locX, this.locY, this.locZ, event.getRadius(), event.getFire(), isIncendiary); + } + // CraftBukkit end this.die(); } -@@ -39,7 +49,8 @@ +@@ -39,7 +51,8 @@ public void a(NBTTagCompound nbttagcompound) { super.a(nbttagcompound); if (nbttagcompound.hasKeyOfType("ExplosionPower", 99)) { |