Files
2019-02-24 22:29:41 +08:00

16 lines
992 B
Diff

--- ../src-base/minecraft/net/minecraft/item/ItemFireball.java
+++ ../src-work/minecraft/net/minecraft/item/ItemFireball.java
@@ -38,6 +38,12 @@
{
if (worldIn.getBlockState(pos).getMaterial() == Material.AIR)
{
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(worldIn, pos.getX(), pos.getY(), pos.getZ(), org.bukkit.event.block.BlockIgniteEvent.IgniteCause.FIREBALL, player).isCancelled()) {
+ if (!player.capabilities.isCreativeMode) {
+ itemstack.shrink(1);
+ }
+ return EnumActionResult.PASS;
+ }
worldIn.playSound((EntityPlayer)null, pos, SoundEvents.ITEM_FIRECHARGE_USE, SoundCategory.BLOCKS, 1.0F, (itemRand.nextFloat() - itemRand.nextFloat()) * 0.2F + 1.0F);
worldIn.setBlockState(pos, Blocks.FIRE.getDefaultState());
}