From 403ac1857906cc5fd03d33268f315a83b847c3f6 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 2 Sep 2019 13:14:13 +1000 Subject: [PATCH] SPIGOT-5301: BlockIgniteEvent for campfire + arrow --- nms-patches/BlockCampfire.patch | 14 ++++++++++++++ .../craftbukkit/event/CraftEventFactory.java | 3 +++ 2 files changed, 17 insertions(+) create mode 100644 nms-patches/BlockCampfire.patch diff --git a/nms-patches/BlockCampfire.patch b/nms-patches/BlockCampfire.patch new file mode 100644 index 0000000000..95ef2f3d1b --- /dev/null +++ b/nms-patches/BlockCampfire.patch @@ -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); + } + } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index 3502cac6d9..22ba790994 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -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; }