diff options
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/item/FlintAndSteelItem.java.patch')
-rw-r--r-- | patch-remap/mache-spigotflower-stripped/net/minecraft/world/item/FlintAndSteelItem.java.patch | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/item/FlintAndSteelItem.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/item/FlintAndSteelItem.java.patch new file mode 100644 index 0000000000..46e3e7dd6b --- /dev/null +++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/item/FlintAndSteelItem.java.patch @@ -0,0 +1,51 @@ +--- a/net/minecraft/world/item/FlintAndSteelItem.java ++++ b/net/minecraft/world/item/FlintAndSteelItem.java +@@ -35,9 +34,17 @@ + if (!CampfireBlock.canLight(blockstate) && !CandleBlock.canLight(blockstate) && !CandleCakeBlock.canLight(blockstate)) { + BlockPos blockpos1 = blockpos.relative(useoncontext.getClickedFace()); + +- if (BaseFireBlock.canBePlacedAt(level, blockpos1, useoncontext.getHorizontalDirection())) { +- level.playSound(player, blockpos1, SoundEvents.FLINTANDSTEEL_USE, SoundSource.BLOCKS, 1.0F, level.getRandom().nextFloat() * 0.4F + 0.8F); +- BlockState blockstate1 = BaseFireBlock.getState(level, blockpos1); ++ if (BaseFireBlock.canBePlacedAt(world, blockposition1, context.getHorizontalDirection())) { ++ // CraftBukkit start - Store the clicked block ++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition1, org.bukkit.event.block.BlockIgniteEvent.IgniteCause.FLINT_AND_STEEL, entityhuman).isCancelled()) { ++ context.getItemInHand().hurtAndBreak(1, entityhuman, (entityhuman1) -> { ++ entityhuman1.broadcastBreakEvent(context.getHand()); ++ }); ++ return InteractionResult.PASS; ++ } ++ // CraftBukkit end ++ world.playSound(entityhuman, blockposition1, SoundEvents.FLINTANDSTEEL_USE, SoundSource.BLOCKS, 1.0F, world.getRandom().nextFloat() * 0.4F + 0.8F); ++ IBlockData iblockdata1 = BaseFireBlock.getState(world, blockposition1); + + level.setBlock(blockpos1, blockstate1, 11); + level.gameEvent((Entity) player, GameEvent.BLOCK_PLACE, blockpos); +@@ -55,14 +62,21 @@ + return InteractionResult.FAIL; + } + } else { +- level.playSound(player, blockpos, SoundEvents.FLINTANDSTEEL_USE, SoundSource.BLOCKS, 1.0F, level.getRandom().nextFloat() * 0.4F + 0.8F); +- level.setBlock(blockpos, (BlockState) blockstate.setValue(BlockStateProperties.LIT, true), 11); +- level.gameEvent((Entity) player, GameEvent.BLOCK_CHANGE, blockpos); +- if (player != null) { +- useoncontext.getItemInHand().hurtAndBreak(1, player, (player1) -> { +- player1.broadcastBreakEvent(useoncontext.getHand()); ++ // CraftBukkit start - Store the clicked block ++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition, org.bukkit.event.block.BlockIgniteEvent.IgniteCause.FLINT_AND_STEEL, entityhuman).isCancelled()) { ++ context.getItemInHand().hurtAndBreak(1, entityhuman, (entityhuman1) -> { ++ entityhuman1.broadcastBreakEvent(context.getHand()); + }); + } ++ // CraftBukkit end ++ world.playSound(entityhuman, blockposition, SoundEvents.FLINTANDSTEEL_USE, SoundSource.BLOCKS, 1.0F, world.getRandom().nextFloat() * 0.4F + 0.8F); ++ world.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockStateProperties.LIT, true), 11); ++ world.gameEvent((Entity) entityhuman, GameEvent.BLOCK_CHANGE, blockposition); ++ if (entityhuman != null) { ++ context.getItemInHand().hurtAndBreak(1, entityhuman, (entityhuman1) -> { ++ entityhuman1.broadcastBreakEvent(context.getHand()); ++ }); ++ } + + return InteractionResult.sidedSuccess(level.isClientSide()); + } |