mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-26 15:03:01 +00:00
Merge branch 'master' into weaponry
This commit is contained in:
commit
a1434c0e33
8 files changed
+117
-33
No files matched your search
@@ -1,5 +1,6 @@
|
||||
package tconstruct.library;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.*;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -20,11 +21,17 @@ public class ActiveToolMod
|
||||
return false;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public boolean afterBlockBreak () // Unfinished, not called
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public void afterBlockBreak(ToolCore tool, ItemStack stack, Block block, int x, int y, int z, EntityLivingBase entity)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/* Attacking */
|
||||
|
||||
public int baseAttackDamage (int earlyModDamage, int damage, ToolCore tool, NBTTagCompound tags, NBTTagCompound toolTags, ItemStack stack, EntityLivingBase player, Entity entity)
|
||||
|
||||
@@ -549,6 +549,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)
|
||||
{
|
||||
@@ -562,6 +565,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);
|
||||
|
||||
Reference in new issue
Block a user