SPIGOT-5301: BlockIgniteEvent for campfire + arrow

This commit is contained in:
md_5 2019-09-02 13:14:13 +10:00
parent 96bc85f0b4
commit 403ac18579
2 changed files with 17 additions and 0 deletions

View file

@ -0,0 +1,14 @@
--- a/net/minecraft/server/BlockCampfire.java
+++ b/net/minecraft/server/BlockCampfire.java
@@ -142,6 +142,11 @@
if (entityarrow.isBurning() && !(Boolean) iblockdata.get(BlockCampfire.b) && !(Boolean) iblockdata.get(BlockCampfire.d)) {
BlockPosition blockposition = movingobjectpositionblock.getBlockPosition();
+ // CraftBukkit start
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition, entityarrow).isCancelled()) {
+ return;
+ }
+ // CraftBukkit end
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockProperties.r, true), 11);
}
}

View file

@ -1173,6 +1173,9 @@ public class CraftEventFactory {
case FIREBALL:
cause = IgniteCause.FIREBALL;
break;
case ARROW:
cause = IgniteCause.ARROW;
break;
default:
cause = IgniteCause.FLINT_AND_STEEL;
}