mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 01:39:52 +03:00
16 lines
992 B
Diff
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());
|
|
}
|