mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 19:49:35 +01:00
b3a8254758
By: md_5 <git@md-5.net>
32 lines
2.2 KiB
Diff
32 lines
2.2 KiB
Diff
--- a/net/minecraft/world/item/ItemFlintAndSteel.java
|
|
+++ b/net/minecraft/world/item/ItemFlintAndSteel.java
|
|
@@ -36,6 +36,14 @@
|
|
BlockPosition blockposition1 = blockposition.shift(itemactioncontext.getClickedFace());
|
|
|
|
if (BlockFireAbstract.a(world, blockposition1, itemactioncontext.g())) {
|
|
+ // 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()) {
|
|
+ itemactioncontext.getItemStack().damage(1, entityhuman, (entityhuman1) -> {
|
|
+ entityhuman1.broadcastItemBreak(itemactioncontext.getHand());
|
|
+ });
|
|
+ return EnumInteractionResult.PASS;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
world.playSound(entityhuman, blockposition1, SoundEffects.FLINTANDSTEEL_USE, SoundCategory.BLOCKS, 1.0F, world.getRandom().nextFloat() * 0.4F + 0.8F);
|
|
IBlockData iblockdata1 = BlockFireAbstract.a((IBlockAccess) world, blockposition1);
|
|
|
|
@@ -55,6 +63,14 @@
|
|
return EnumInteractionResult.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()) {
|
|
+ itemactioncontext.getItemStack().damage(1, entityhuman, (entityhuman1) -> {
|
|
+ entityhuman1.broadcastItemBreak(itemactioncontext.getHand());
|
|
+ });
|
|
+ return EnumInteractionResult.PASS;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
world.playSound(entityhuman, blockposition, SoundEffects.FLINTANDSTEEL_USE, SoundCategory.BLOCKS, 1.0F, world.getRandom().nextFloat() * 0.4F + 0.8F);
|
|
world.setTypeAndData(blockposition, (IBlockData) iblockdata.set(BlockProperties.LIT, true), 11);
|
|
world.a((Entity) entityhuman, GameEvent.BLOCK_PLACE, blockposition);
|