mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-25 12:05:53 +01:00
SPIGOT-5301: BlockIgniteEvent for campfire + arrow
This commit is contained in:
parent
96bc85f0b4
commit
403ac18579
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 New Issue
Block a user