Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/mods/tinker/tconstruct/items/tools/Hatchet.java b/mods/tinker/tconstruct/items/tools/Hatchet.java
- index bf3c584..9fd8246 100644
- --- a/mods/tinker/tconstruct/items/tools/Hatchet.java
- +++ b/mods/tinker/tconstruct/items/tools/Hatchet.java
- @@ -45,7 +45,7 @@ public class Hatchet extends HarvestTool
- if (block != null && block.blockMaterial == Material.leaves)
- return false;
- - return AbilityHelper.onBlockChanged(itemstack, world, bID, x, y, z, player, random);
- + return super.onBlockDestroyed(itemstack, world, bID, x, y, z, player);
- }
- static Material[] materials = { Material.wood, Material.leaves, Material.vine, Material.circuits, Material.cactus, Material.pumpkin };
- diff --git a/mods/tinker/tconstruct/items/tools/LumberAxe.java b/mods/tinker/tconstruct/items/tools/LumberAxe.java
- index 635ee89..5c66a31 100644
- --- a/mods/tinker/tconstruct/items/tools/LumberAxe.java
- +++ b/mods/tinker/tconstruct/items/tools/LumberAxe.java
- @@ -64,7 +64,7 @@ public class LumberAxe extends HarvestTool
- if (block != null && block.blockMaterial == Material.leaves)
- return false;
- - return AbilityHelper.onBlockChanged(itemstack, world, bID, x, y, z, player, random);
- + return super.onBlockDestroyed(itemstack, world, bID, x, y, z, player);
- }
- static Material[] materials = { Material.wood, Material.circuits, Material.cactus, Material.pumpkin };
- diff --git a/mods/tinker/tconstruct/library/tools/ToolCore.java b/mods/tinker/tconstruct/library/tools/ToolCore.java
- index a2c4935..f3f4b89 100644
- --- a/mods/tinker/tconstruct/library/tools/ToolCore.java
- +++ b/mods/tinker/tconstruct/library/tools/ToolCore.java
- @@ -27,6 +27,8 @@ import net.minecraft.item.crafting.FurnaceRecipes;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.util.Icon;
- import net.minecraft.world.World;
- +import net.minecraftforge.event.ForgeSubscribe;
- +import net.minecraftforge.event.entity.player.PlayerEvent;
- import cpw.mods.fml.relauncher.Side;
- import cpw.mods.fml.relauncher.SideOnly;
- @@ -486,11 +488,14 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
- //Mining
- @Override
- - public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPlayer player)
- - {
- - NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
- - World world = player.worldObj;
- - int bID = player.worldObj.getBlockId(x, y, z);
- + public boolean onBlockDestroyed(ItemStack stack, World world, int bID, int x, int y, int z, EntityLiving player)
- + {
- + if (!AbilityHelper.onBlockChanged(stack, world, bID, x, y, z, player, random))
- + {
- + return false;
- + }
- +
- + NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
- int meta = world.getBlockMetadata(x, y, z);
- Block block = Block.blocksList[bID];
- if (block == null || bID < 1 || bID > 4095)
- @@ -505,8 +510,6 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
- if (result != null)
- {
- world.setBlockToAir(x, y, z);
- - if (!player.capabilities.isCreativeMode)
- - onBlockDestroyed(stack, world, bID, x, y, z, player);
- if (!world.isRemote)
- {
- ItemStack spawnme = result.copy();
- @@ -522,7 +525,6 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
- entityitem.delayBeforeCanPickup = 10;
- world.spawnEntityInWorld(entityitem);
- - world.playAuxSFX(2001, x, y, z, bID + (meta << 12));
- }
- for (int i = 0; i < 6; i++)
- {
- @@ -543,18 +545,36 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox
- world.spawnParticle("smoke", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
- world.spawnParticle("flame", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
- }
- - return true;
- }
- }
- -
- - return false;
- +
- + return true;
- }
- -
- - @Override
- +
- + @ForgeSubscribe
- + public void vanillaDrop(PlayerEvent.HarvestCheck event){
- + if (event.entityPlayer == null)
- + {
- + return;
- + }
- + ItemStack stack = event.entityPlayer.getCurrentEquippedItem();
- + if (stack == null || !stack.hasTagCompound())
- + {
- + return;
- + }
- + NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
- + if (tags == null)
- + {
- + return;
- + }
- + event.success = !tags.getBoolean("Lava");
- + }
- +
- + /*@Override
- public boolean onBlockDestroyed (ItemStack itemstack, World world, int bID, int x, int y, int z, EntityLiving player)
- {
- return AbilityHelper.onBlockChanged(itemstack, world, bID, x, y, z, player, random);
- - }
- + }*/
- @Override
- public float getStrVsBlock (ItemStack stack, Block block, int meta)
Add Comment
Please, Sign In to add comment