diff options
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/item/FireChargeItem.java.patch')
-rw-r--r-- | patch-remap/mache-vineflower-stripped/net/minecraft/world/item/FireChargeItem.java.patch | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/item/FireChargeItem.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/item/FireChargeItem.java.patch new file mode 100644 index 0000000000..3db64e44df --- /dev/null +++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/item/FireChargeItem.java.patch @@ -0,0 +1,47 @@ +--- a/net/minecraft/world/item/FireChargeItem.java ++++ b/net/minecraft/world/item/FireChargeItem.java +@@ -26,18 +29,35 @@ + BlockPos clickedPos = context.getClickedPos(); + BlockState blockState = level.getBlockState(clickedPos); + boolean flag = false; +- if (!CampfireBlock.canLight(blockState) && !CandleBlock.canLight(blockState) && !CandleCakeBlock.canLight(blockState)) { +- BlockPos var6 = clickedPos.relative(context.getClickedFace()); +- if (BaseFireBlock.canBePlacedAt(level, var6, context.getHorizontalDirection())) { +- this.playSound(level, var6); +- level.setBlockAndUpdate(var6, BaseFireBlock.getState(level, var6)); +- level.gameEvent(context.getPlayer(), GameEvent.BLOCK_PLACE, var6); ++ ++ if (!CampfireBlock.canLight(iblockdata) && !CandleBlock.canLight(iblockdata) && !CandleCakeBlock.canLight(iblockdata)) { ++ blockposition = blockposition.relative(context.getClickedFace()); ++ if (BaseFireBlock.canBePlacedAt(world, blockposition, context.getHorizontalDirection())) { ++ // CraftBukkit start - fire BlockIgniteEvent ++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition, org.bukkit.event.block.BlockIgniteEvent.IgniteCause.FIREBALL, context.getPlayer()).isCancelled()) { ++ if (!context.getPlayer().getAbilities().instabuild) { ++ context.getItemInHand().shrink(1); ++ } ++ return InteractionResult.PASS; ++ } ++ // CraftBukkit end ++ this.playSound(world, blockposition); ++ world.setBlockAndUpdate(blockposition, BaseFireBlock.getState(world, blockposition)); ++ world.gameEvent((Entity) context.getPlayer(), GameEvent.BLOCK_PLACE, blockposition); + flag = true; + } + } else { +- this.playSound(level, clickedPos); +- level.setBlockAndUpdate(clickedPos, blockState.setValue(BlockStateProperties.LIT, Boolean.valueOf(true))); +- level.gameEvent(context.getPlayer(), GameEvent.BLOCK_CHANGE, clickedPos); ++ // CraftBukkit start - fire BlockIgniteEvent ++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition, org.bukkit.event.block.BlockIgniteEvent.IgniteCause.FIREBALL, context.getPlayer()).isCancelled()) { ++ if (!context.getPlayer().getAbilities().instabuild) { ++ context.getItemInHand().shrink(1); ++ } ++ return InteractionResult.PASS; ++ } ++ // CraftBukkit end ++ this.playSound(world, blockposition); ++ world.setBlockAndUpdate(blockposition, (IBlockData) iblockdata.setValue(BlockStateProperties.LIT, true)); ++ world.gameEvent((Entity) context.getPlayer(), GameEvent.BLOCK_CHANGE, blockposition); + flag = true; + } + |