From 7d330bc9f363162bb8c0f6f829f53dc4b7d3de8e Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Fri, 11 Mar 2016 07:01:33 +1100
Subject: [PATCH] SPIGOT-1813: EntityCombustByEntityEvent not Cancelled

---
 nms-patches/EntityHuman.patch | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/nms-patches/EntityHuman.patch b/nms-patches/EntityHuman.patch
index 77367b19d2..0d34b3d8fa 100644
--- a/nms-patches/EntityHuman.patch
+++ b/nms-patches/EntityHuman.patch
@@ -247,11 +247,12 @@
      }
  
      public void openSign(TileEntitySign tileentitysign) {}
-@@ -884,7 +978,15 @@
+@@ -884,8 +978,15 @@
                      if (entity instanceof EntityLiving) {
                          f3 = ((EntityLiving) entity).getHealth();
                          if (j > 0 && !entity.isBurning()) {
 -                            flag4 = true;
+-                            entity.setOnFire(1);
 +                            // CraftBukkit start - Call a combust event when somebody hits with a fire enchanted item
 +                            EntityCombustByEntityEvent combustEvent = new EntityCombustByEntityEvent(this.getBukkitEntity(), entity.getBukkitEntity(), 1);
 +                            org.bukkit.Bukkit.getPluginManager().callEvent(combustEvent);
@@ -261,10 +262,10 @@
 +                                entity.setOnFire(combustEvent.getDuration());
 +                            }
 +                            // CraftBukkit end
-                             entity.setOnFire(1);
                          }
                      }
-@@ -925,11 +1027,28 @@
+ 
+@@ -925,11 +1026,28 @@
                          }
  
                          if (entity instanceof EntityPlayer && entity.velocityChanged) {
@@ -293,7 +294,7 @@
                          }
  
                          if (flag2) {
-@@ -991,7 +1110,8 @@
+@@ -991,7 +1109,8 @@
  
                          if (itemstack3 != null && object instanceof EntityLiving) {
                              itemstack3.a((EntityLiving) object, this);
@@ -303,7 +304,7 @@
                                  this.a(EnumHand.MAIN_HAND, (ItemStack) null);
                              }
                          }
-@@ -1001,7 +1121,14 @@
+@@ -1001,7 +1120,14 @@
  
                              this.a(StatisticList.y, Math.round(f5 * 10.0F));
                              if (j > 0) {
@@ -319,7 +320,7 @@
                              }
  
                              if (this.world instanceof WorldServer && f5 > 2.0F) {
-@@ -1090,6 +1217,20 @@
+@@ -1090,6 +1216,20 @@
              this.stopRiding();
          }
  
@@ -340,7 +341,7 @@
          this.setSize(0.2F, 0.2F);
          if (this.world.isLoaded(blockposition)) {
              EnumDirection enumdirection = (EnumDirection) this.world.getType(blockposition).get(BlockFacingHorizontal.FACING);
-@@ -1172,6 +1313,23 @@
+@@ -1172,6 +1312,23 @@
              this.world.everyoneSleeping();
          }
  
@@ -364,7 +365,7 @@
          this.sleepTicks = flag ? 0 : 100;
          if (flag2) {
              this.setRespawnPosition(this.bedPosition, false);
-@@ -1222,9 +1380,11 @@
+@@ -1222,9 +1379,11 @@
          if (blockposition != null) {
              this.e = blockposition;
              this.f = flag;