summaryrefslogtreecommitdiffstats
path: root/nms-patches/EntityTNTPrimed.patch
diff options
context:
space:
mode:
authorThinkofdeath <thinkofdeath@spigotmc.org>2014-11-26 08:32:16 +1100
committermd_5 <git@md-5.net>2014-11-28 17:16:30 +1100
commit24557bc2b37deb6a0edf497d547471832457b1dd (patch)
treec560572889a3b0b34964a0cddb35dc87fda3c914 /nms-patches/EntityTNTPrimed.patch
parenta4805dbd77da057cc1ea0bf344379bc6e53ca1f6 (diff)
downloadcraftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar
craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.gz
craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.lz
craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.xz
craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.zip
Update to Minecraft 1.8
For more information please see http://www.spigotmc.org/
Diffstat (limited to 'nms-patches/EntityTNTPrimed.patch')
-rw-r--r--nms-patches/EntityTNTPrimed.patch52
1 files changed, 52 insertions, 0 deletions
diff --git a/nms-patches/EntityTNTPrimed.patch b/nms-patches/EntityTNTPrimed.patch
new file mode 100644
index 00000000..96c3399a
--- /dev/null
+++ b/nms-patches/EntityTNTPrimed.patch
@@ -0,0 +1,52 @@
+--- ../work/decompile-bb26c12b/net/minecraft/server/EntityTNTPrimed.java 2014-11-27 08:59:46.737421688 +1100
++++ src/main/java/net/minecraft/server/EntityTNTPrimed.java 2014-11-27 08:42:10.120850973 +1100
+@@ -1,9 +1,13 @@
+ package net.minecraft.server;
+
++import org.bukkit.event.entity.ExplosionPrimeEvent; // CraftBukkit
++
+ public class EntityTNTPrimed extends Entity {
+
+ public int fuseTicks;
+ private EntityLiving source;
++ public float yield = 4; // CraftBukkit - add field
++ public boolean isIncendiary = false; // CraftBukkit - add field
+
+ public EntityTNTPrimed(World world) {
+ super(world);
+@@ -52,10 +56,13 @@
+ }
+
+ if (this.fuseTicks-- <= 0) {
+- this.die();
++ // CraftBukkit start - Need to reverse the order of the explosion and the entity death so we have a location for the event
++ // this.die();
+ if (!this.world.isStatic) {
+ this.explode();
+ }
++ this.die();
++ // CraftBukkit end
+ } else {
+ this.W();
+ this.world.addParticle(EnumParticle.SMOKE_NORMAL, this.locX, this.locY + 0.5D, this.locZ, 0.0D, 0.0D, 0.0D, new int[0]);
+@@ -64,9 +71,18 @@
+ }
+
+ private void explode() {
+- float f = 4.0F;
++ // CraftBukkit start
++ // float f = 4.0F;
+
+- this.world.explode(this, this.locX, this.locY + (double) (this.length / 2.0F), this.locZ, f, true);
++ org.bukkit.craftbukkit.CraftServer server = this.world.getServer();
++
++ ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) org.bukkit.craftbukkit.entity.CraftEntity.getEntity(server, this));
++ server.getPluginManager().callEvent(event);
++
++ if (!event.isCancelled()) {
++ this.world.createExplosion(this, this.locX, this.locY + (double) (this.length / 2.0F), this.locZ, event.getRadius(), event.getFire(), true);
++ }
++ // CraftBukkit end
+ }
+
+ protected void b(NBTTagCompound nbttagcompound) {