mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 10:44:39 +01:00
30e4583dbe
By: Initial Source <noreply+automated@papermc.io>
28 lines
2 KiB
Diff
28 lines
2 KiB
Diff
--- a/net/minecraft/world/item/FlintAndSteelItem.java
|
|
+++ b/net/minecraft/world/item/FlintAndSteelItem.java
|
|
@@ -37,6 +37,12 @@
|
|
BlockPos blockposition1 = blockposition.relative(context.getClickedFace());
|
|
|
|
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, LivingEntity.getSlotForHand(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);
|
|
BlockState iblockdata1 = BaseFireBlock.getState(world, blockposition1);
|
|
|
|
@@ -54,6 +60,12 @@
|
|
return InteractionResult.FAIL;
|
|
}
|
|
} else {
|
|
+ // 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, LivingEntity.getSlotForHand(context.getHand()));
|
|
+ return InteractionResult.PASS;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
world.playSound(entityhuman, blockposition, SoundEvents.FLINTANDSTEEL_USE, SoundSource.BLOCKS, 1.0F, world.getRandom().nextFloat() * 0.4F + 0.8F);
|
|
world.setBlock(blockposition, (BlockState) iblockdata.setValue(BlockStateProperties.LIT, true), 11);
|
|
world.gameEvent((Entity) entityhuman, (Holder) GameEvent.BLOCK_CHANGE, blockposition);
|