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:
@@ -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());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user