SPIGOT-5830: Server crash when campfire lit via dispenser.

Also adds a missing call to BlockIgniteEvent for players igniting campfires with flint and steel.

By: Parker Hawke <hawkeboyz2@hotmail.com>
This commit is contained in:
CraftBukkit/Spigot
2020-06-25 19:01:18 -04:00
parent 61ff27fa00
commit 6ccde4e6fd
3 changed files with 19 additions and 1 deletions

View File

@@ -1,5 +1,14 @@
--- a/net/minecraft/server/ItemFlintAndSteel.java
+++ b/net/minecraft/server/ItemFlintAndSteel.java
@@ -13,7 +13,7 @@
BlockPosition blockposition = itemactioncontext.getClickPosition();
IBlockData iblockdata = world.getType(blockposition);
- if (BlockCampfire.h(iblockdata)) {
+ if (BlockCampfire.h(iblockdata) && !org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition, entityhuman).isCancelled()) { // CraftBukkit
world.playSound(entityhuman, blockposition, SoundEffects.ITEM_FLINTANDSTEEL_USE, SoundCategory.BLOCKS, 1.0F, ItemFlintAndSteel.RANDOM.nextFloat() * 0.4F + 0.8F);
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockProperties.r, true), 11);
if (entityhuman != null) {
@@ -27,6 +27,14 @@
BlockPosition blockposition1 = blockposition.shift(itemactioncontext.getClickedFace());