Add afterBlockBreak callback to the ActiveToolMod

This commit is contained in:
Bernhard Bonigl committed 2014-10-21 17:09:55 +02:00
1 parent 35bf8e4303
commit b7bd5755e2
2 files changed
+17

No files matched your search

@@ -581,6 +581,9 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IMo
@Override
public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPlayer player)
{
if(!stack.hasTagCompound())
return false;
boolean cancelHarvest = false;
for (ActiveToolMod mod : TConstructRegistry.activeModifiers)
{
@@ -594,6 +597,13 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IMo
@Override
public boolean onBlockDestroyed (ItemStack itemstack, World world, Block block, int x, int y, int z, EntityLivingBase player)
{
if(!itemstack.hasTagCompound())
return false;
// callbacks!
for (ActiveToolMod mod : TConstructRegistry.activeModifiers)
mod.afterBlockBreak(this, itemstack, block, x, y, z, player);
if (block != null && (double) block.getBlockHardness(world, x, y, z) != 0.0D)
{
return AbilityHelper.onBlockChanged(itemstack, world, block, x, y, z, player, random);