2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/item/ItemFlintAndSteel.java
|
|
|
|
+++ b/net/minecraft/world/item/ItemFlintAndSteel.java
|
2021-11-21 23:00:00 +01:00
|
|
|
@@ -34,6 +34,14 @@
|
|
|
|
BlockPosition blockposition1 = blockposition.relative(itemactioncontext.getClickedFace());
|
2019-12-10 23:00:00 +01:00
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
if (BlockFireAbstract.canBePlacedAt(world, blockposition1, itemactioncontext.getHorizontalDirection())) {
|
2019-12-10 23:00:00 +01:00
|
|
|
+ // 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()) {
|
2021-11-21 23:00:00 +01:00
|
|
|
+ itemactioncontext.getItemInHand().hurtAndBreak(1, entityhuman, (entityhuman1) -> {
|
|
|
|
+ entityhuman1.broadcastBreakEvent(itemactioncontext.getHand());
|
2019-12-10 23:00:00 +01:00
|
|
|
+ });
|
|
|
|
+ return EnumInteractionResult.PASS;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2021-06-11 07:00:00 +02:00
|
|
|
world.playSound(entityhuman, blockposition1, SoundEffects.FLINTANDSTEEL_USE, SoundCategory.BLOCKS, 1.0F, world.getRandom().nextFloat() * 0.4F + 0.8F);
|
2021-11-21 23:00:00 +01:00
|
|
|
IBlockData iblockdata1 = BlockFireAbstract.getState(world, blockposition1);
|
2018-07-15 02:00:00 +02:00
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
@@ -53,6 +61,14 @@
|
2021-06-11 07:00:00 +02:00
|
|
|
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()) {
|
2021-11-21 23:00:00 +01:00
|
|
|
+ itemactioncontext.getItemInHand().hurtAndBreak(1, entityhuman, (entityhuman1) -> {
|
|
|
|
+ entityhuman1.broadcastBreakEvent(itemactioncontext.getHand());
|
2021-06-11 07:00:00 +02:00
|
|
|
+ });
|
|
|
|
+ return EnumInteractionResult.PASS;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
world.playSound(entityhuman, blockposition, SoundEffects.FLINTANDSTEEL_USE, SoundCategory.BLOCKS, 1.0F, world.getRandom().nextFloat() * 0.4F + 0.8F);
|
2021-11-21 23:00:00 +01:00
|
|
|
world.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockProperties.LIT, true), 11);
|
|
|
|
world.gameEvent(entityhuman, GameEvent.BLOCK_PLACE, blockposition);
|