SPIGOT-1813: EntityCombustByEntityEvent not Cancelled

This commit is contained in:
md_5 2016-03-11 07:01:33 +11:00
parent c126d6101e
commit 7d330bc9f3

View File

@ -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;