Files
CatServer/patches/net/minecraft/item/ItemFlintAndSteel.java.patch
2019-02-24 22:29:41 +08:00

19 lines
1019 B
Diff

--- ../src-base/minecraft/net/minecraft/item/ItemFlintAndSteel.java
+++ ../src-work/minecraft/net/minecraft/item/ItemFlintAndSteel.java
@@ -34,8 +34,14 @@
}
else
{
- if (worldIn.getBlockState(pos).getMaterial() == Material.AIR)
+ if (worldIn.isAirBlock(pos))
{
+ // CraftBukkit start - Store the clicked block
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(worldIn, pos.getX(), pos.getY(), pos.getZ(), org.bukkit.event.block.BlockIgniteEvent.IgniteCause.FLINT_AND_STEEL, player).isCancelled()) {
+ itemstack.damageItem(1, player);
+ return EnumActionResult.PASS;
+ }
+ // CraftBukkit end
worldIn.playSound(player, pos, SoundEvents.ITEM_FLINTANDSTEEL_USE, SoundCategory.BLOCKS, 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
worldIn.setBlockState(pos, Blocks.FIRE.getDefaultState(), 11);
}