mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 06:50:12 +01:00
SPIGOT-5301: BlockIgniteEvent for campfire + arrow
This commit is contained in:
parent
96bc85f0b4
commit
403ac18579
2 changed files with 17 additions and 0 deletions
14
nms-patches/BlockCampfire.patch
Normal file
14
nms-patches/BlockCampfire.patch
Normal 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);
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue