mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-26 15:03:01 +00:00
fixed several tools
This commit is contained in:
1 parent
3d5cdf6ee6
commit
d914004bde
27 files changed
+86
-85
No files matched your search
@@ -45,7 +45,7 @@ public class Battleaxe extends HarvestTool
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed (ItemStack itemstack, World world, Block b, int x, int y, int z, EntityLivingBase player)
|
||||
public boolean func_150894_a (ItemStack itemstack, World world, Block b, int x, int y, int z, EntityLivingBase player)
|
||||
{
|
||||
if (b != null && b.func_149688_o() == Material.field_151584_j)
|
||||
return false;
|
||||
@@ -277,11 +277,11 @@ public class Battleaxe extends HarvestTool
|
||||
{
|
||||
if (block.removeBlockByPlayer(world, player, x, yPos, z))
|
||||
{
|
||||
block.onBlockDestroyedByPlayer(world, x, yPos, z, localMeta);
|
||||
block.func_149664_b(world, x, yPos, z, localMeta);
|
||||
}
|
||||
block.harvestBlock(world, player, x, yPos, z, localMeta);
|
||||
block.onBlockHarvested(world, x, yPos, z, localMeta, player);
|
||||
onBlockDestroyed(stack, world, block, x, yPos, z, player);
|
||||
block.func_149636_a(world, player, x, yPos, z, localMeta);
|
||||
block.func_149681_a(world, x, yPos, z, localMeta, player);
|
||||
func_150894_a(stack, world, block, x, yPos, z, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -149,11 +149,11 @@ public abstract class BowBase extends ToolCore
|
||||
//if (tinkerArrow != null)
|
||||
if (slotID != -1 && (arrowID == -1 || slotID < arrowID))
|
||||
{
|
||||
player.inventory.consumeInventoryItem(TRepo.arrow);
|
||||
player.inventory.func_146026_a(TRepo.arrow);
|
||||
}
|
||||
else
|
||||
{
|
||||
player.inventory.consumeInventoryItem(Items.arrow);
|
||||
player.inventory.func_146026_a(Items.arrow);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ public class Chisel extends ToolCore
|
||||
{
|
||||
return itemstack;
|
||||
}
|
||||
if (movingobjectposition.typeOfHit == MovingObjectType.TILE)
|
||||
if (movingobjectposition.typeOfHit == MovingObjectType.BLOCK)
|
||||
{
|
||||
int x = movingobjectposition.blockX;
|
||||
int y = movingobjectposition.blockY;
|
||||
@@ -100,7 +100,7 @@ public class Chisel extends ToolCore
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
DetailInput details = TConstruct.chiselDetailing.getDetailing(block, meta);
|
||||
if (details != null && details.outputID < 4096)
|
||||
if (details != null)
|
||||
{
|
||||
world.func_147465_d(x, y, z, BlockUtils.getBlockFromItemStack(details.output), details.outputMeta, 3);
|
||||
if (!(entityplayer.capabilities.isCreativeMode))
|
||||
|
||||
@@ -38,7 +38,7 @@ public class Excavator extends HarvestTool
|
||||
return "shovel";
|
||||
}
|
||||
|
||||
static Material[] materials = { Material.field_151577_b, Material.field_151578_c, Material.sand, Material.snow, Material.crafedSnow, Material.clay };
|
||||
static Material[] materials = { Material.field_151577_b, Material.field_151578_c, Material.field_151595_p, Material.snow, Material.crafedSnow, Material.clay };
|
||||
|
||||
@Override
|
||||
public Item getHeadItem ()
|
||||
@@ -142,14 +142,14 @@ public class Excavator extends HarvestTool
|
||||
|
||||
World world = player.worldObj;
|
||||
final int meta = world.getBlockMetadata(x, y, z);
|
||||
Block block = world.getBlock(x, y, z);
|
||||
Block block = world.func_147439_a(x, y, z);
|
||||
if (!stack.hasTagCompound())
|
||||
return false;
|
||||
|
||||
if (block == null)
|
||||
return super.onBlockStartBreak(stack, x, y, z, player);
|
||||
|
||||
float blockHardness = block.getBlockHardness(world, x, y, z);
|
||||
float blockHardness = block.func_149712_f(world, x, y, z);
|
||||
|
||||
boolean validStart = false;
|
||||
for (int iter = 0; iter < materials.length; iter++)
|
||||
@@ -192,11 +192,11 @@ public class Excavator extends HarvestTool
|
||||
{
|
||||
if (!(tags.getBoolean("Broken")))
|
||||
{
|
||||
Block localblock = world.getBlock(xPos, yPos, zPos);
|
||||
Block localblock = world.func_147439_a(xPos, yPos, zPos);
|
||||
block = localblock;
|
||||
int localMeta = world.getBlockMetadata(xPos, yPos, zPos);
|
||||
int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType());
|
||||
float localHardness = block == null ? Float.MAX_VALUE : block.getBlockHardness(world, xPos, yPos, zPos);
|
||||
float localHardness = block == null ? Float.MAX_VALUE : block.func_149712_f(world, xPos, yPos, zPos);
|
||||
|
||||
if (hlvl <= tags.getInteger("HarvestLevel") && localHardness - 1.5 <= blockHardness)
|
||||
{
|
||||
@@ -219,12 +219,12 @@ public class Excavator extends HarvestTool
|
||||
{
|
||||
if (block.removeBlockByPlayer(world, player, xPos, yPos, zPos))
|
||||
{
|
||||
block.onBlockDestroyedByPlayer(world, xPos, yPos, zPos, localMeta);
|
||||
block.func_149664_b(world, xPos, yPos, zPos, localMeta);
|
||||
}
|
||||
block.harvestBlock(world, player, xPos, yPos, zPos, localMeta);
|
||||
block.onBlockHarvested(world, xPos, yPos, zPos, localMeta, player);
|
||||
block.func_149636_a(world, player, xPos, yPos, zPos, localMeta);
|
||||
block.func_149681_a(world, xPos, yPos, zPos, localMeta, player);
|
||||
if (blockHardness > 0f)
|
||||
onBlockDestroyed(stack, world, localblock, xPos, yPos, zPos, player);
|
||||
func_150894_a(stack, world, localblock, xPos, yPos, zPos, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -86,7 +86,7 @@ public class FryingPan extends Weapon
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (!world.getBlockMaterial(x, y, z).isSolid())
|
||||
else if (!world.func_147439_a(x, y, z).func_149688_o().isSolid())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -121,17 +121,17 @@ public class FryingPan extends Weapon
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (!TRepo.heldItemBlock.canPlaceBlockAt(world, x, y, z))
|
||||
else if (!TRepo.heldItemBlock.func_149742_c(world, x, y, z))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
world.func_147465_d(x, y, z, TRepo.heldItemBlock, 0, 3);
|
||||
TRepo.heldItemBlock.onBlockPlacedBy(world, x, y, z, player, stack);
|
||||
TRepo.heldItemBlock.func_149689_a(world, x, y, z, player, stack);
|
||||
world.playSoundEffect(x, y, z, "tinker:frypan_hit", 1.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 0.65F);
|
||||
|
||||
EquipLogic logic = (EquipLogic) world.getBlockTileEntity(x, y, z);
|
||||
EquipLogic logic = (EquipLogic) world.func_147438_o(x, y, z);
|
||||
logic.setEquipmentItem(stack);
|
||||
--stack.stackSize;
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ public class Hammer extends HarvestTool
|
||||
return materials;
|
||||
}
|
||||
|
||||
static Material[] materials = new Material[] { Material.rock, Material.field_151573_f, Material.ice, Material.field_151592_s, Material.piston, Material. field_151574_g };
|
||||
static Material[] materials = new Material[] { Material.field_151576_e, Material.field_151573_f, Material.field_151588_w, Material.field_151592_s, Material.piston, Material. field_151574_g };
|
||||
|
||||
@Override
|
||||
public Item getHeadItem ()
|
||||
@@ -242,7 +242,7 @@ public class Hammer extends HarvestTool
|
||||
if (block == null)
|
||||
return super.onBlockStartBreak(stack, x, y, z, player);
|
||||
|
||||
float blockHardness = block.getBlockHardness(world, x, y, z);
|
||||
float blockHardness = block.func_149712_f(world, x, y, z);
|
||||
|
||||
boolean validStart = false;
|
||||
for (int iter = 0; iter < materials.length; iter++)
|
||||
@@ -290,7 +290,7 @@ public class Hammer extends HarvestTool
|
||||
{
|
||||
if (!(tags.getBoolean("Broken")))
|
||||
{
|
||||
Block localBlock = world.getBlock(xPos, yPos, zPos);
|
||||
Block localBlock = world.func_147439_a(xPos, yPos, zPos);
|
||||
int localMeta = world.getBlockMetadata(xPos, yPos, zPos);
|
||||
int hlvl = MinecraftForge.getBlockHarvestLevel(localBlock, meta, getHarvestType());
|
||||
float localHardness = localBlock == null ? Float.MAX_VALUE : localBlock.getBlockHardness(world, xPos, yPos, zPos);
|
||||
@@ -316,12 +316,12 @@ public class Hammer extends HarvestTool
|
||||
{
|
||||
if (localBlock.removeBlockByPlayer(world, player, xPos, yPos, zPos))
|
||||
{
|
||||
localBlock.onBlockDestroyedByPlayer(world, xPos, yPos, zPos, localMeta);
|
||||
localBlock.func_149664_b(world, xPos, yPos, zPos, localMeta);
|
||||
}
|
||||
localBlock.harvestBlock(world, player, xPos, yPos, zPos, localMeta);
|
||||
localBlock.onBlockHarvested(world, xPos, yPos, zPos, localMeta, player);
|
||||
localBlock.func_149636_a(world, player, xPos, yPos, zPos, localMeta);
|
||||
localBlock.func_149681_a(world, xPos, yPos, zPos, localMeta, player);
|
||||
if (blockHardness > 0f)
|
||||
onBlockDestroyed(stack, world, localBlock, xPos, yPos, zPos, player);
|
||||
func_150894_a(stack, world, localBlock, xPos, yPos, zPos, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ public class Hatchet extends HarvestTool
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed (ItemStack itemstack, World world, Block block, int x, int y, int z, EntityLivingBase player)
|
||||
public boolean func_150894_a (ItemStack itemstack, World world, Block block, int x, int y, int z, EntityLivingBase player)
|
||||
{
|
||||
if (block != null && block.func_149688_o() == Material.field_151584_j)
|
||||
return false;
|
||||
|
||||
@@ -55,7 +55,7 @@ public class LumberAxe extends HarvestTool
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed (ItemStack itemstack, World world, Block block, int x, int y, int z, EntityLivingBase player)
|
||||
public boolean func_150894_a (ItemStack itemstack, World world, Block block, int x, int y, int z, EntityLivingBase player)
|
||||
{
|
||||
if (block != null && block.func_149688_o() == Material.field_151584_j)
|
||||
return false;
|
||||
@@ -242,11 +242,11 @@ public class LumberAxe extends HarvestTool
|
||||
{
|
||||
if (block.removeBlockByPlayer(world, player, xPos, yPos, zPos))
|
||||
{
|
||||
block.onBlockDestroyedByPlayer(world, xPos, yPos, zPos, meta);
|
||||
block.func_149664_b(world, xPos, yPos, zPos, meta);
|
||||
}
|
||||
block.harvestBlock(world, player, xPos, yPos, zPos, meta);
|
||||
block.onBlockHarvested(world, xPos, yPos, zPos, meta, player);
|
||||
onBlockDestroyed(stack, world, localblock, xPos, yPos, zPos, player);
|
||||
block.func_149636_a(world, player, xPos, yPos, zPos, meta);
|
||||
block.func_149681_a(world, xPos, yPos, zPos, meta, player);
|
||||
func_150894_a(stack, world, localblock, xPos, yPos, zPos, player);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -308,7 +308,7 @@ public class LumberAxe extends HarvestTool
|
||||
{
|
||||
//TODO harvestBlock
|
||||
block.func_149636_a(world, player, xPos, yPos, zPos, meta);
|
||||
onBlockDestroyed(stack, world, block, xPos, yPos, zPos, player);
|
||||
func_150894_a(stack, world, block, xPos, yPos, zPos, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ public class Pickaxe extends HarvestTool
|
||||
return materials;
|
||||
}
|
||||
|
||||
static Material[] materials = new Material[] { Material.rock, Material.field_151573_f, Material.ice, Material.field_151592_s, Material.piston, Material.field_151574_g, Material.field_151594_q };
|
||||
static Material[] materials = new Material[] { Material.field_151576_e, Material.field_151573_f, Material.field_151588_w, Material.field_151592_s, Material.piston, Material.field_151574_g, Material.field_151594_q };
|
||||
|
||||
@Override
|
||||
public Item getHeadItem ()
|
||||
|
||||
@@ -111,7 +111,7 @@ public class PotionLauncher extends Item
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems (Item b, CreativeTabs tabs, List list)
|
||||
public void func_150895_a (Item b, CreativeTabs tabs, List list)
|
||||
{
|
||||
ItemStack stack = new ItemStack(b, 1, 0);
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
|
||||
@@ -155,7 +155,7 @@ public class Scythe extends Weapon
|
||||
return false;
|
||||
|
||||
World world = player.worldObj;
|
||||
final int blockID = world.getBlockId(x, y, z);
|
||||
final Block blockB = world.func_147439_a(x, y, z);
|
||||
final int meta = world.getBlockMetadata(x, y, z);
|
||||
if (!stack.hasTagCompound())
|
||||
return false;
|
||||
@@ -177,7 +177,7 @@ public class Scythe extends Weapon
|
||||
|
||||
if (!cancelHarvest)
|
||||
{
|
||||
Block block = world.getBlock(xPos, yPos, zPos);
|
||||
Block block = world.func_147439_a(xPos, yPos, zPos);
|
||||
if (block != null)// && (block.func_149688_o() == Material.field_151584_j || block.isLeaves(world, xPos, yPos, zPos)))
|
||||
{
|
||||
for (int iter = 0; iter < materials.length; iter++)
|
||||
@@ -188,10 +188,10 @@ public class Scythe extends Weapon
|
||||
WorldHelper.setBlockToAir(world, xPos, yPos, zPos);
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
block.onBlockDestroyedByPlayer(world, x, y, z, meta);
|
||||
block.harvestBlock(world, player, xPos, yPos, zPos, localMeta);
|
||||
block.onBlockHarvested(world, x, y, z, localMeta, player);
|
||||
onBlockDestroyed(stack, world, localblock, xPos, yPos, zPos, player);
|
||||
block.func_149664_b(world, x, y, z, meta);
|
||||
block.func_149636_a(world, player, xPos, yPos, zPos, localMeta);
|
||||
block.func_149681_a(world, x, y, z, localMeta, player);
|
||||
func_150894_a(stack, world, blockB, xPos, yPos, zPos, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public class Shovel extends HarvestTool
|
||||
return "shovel";
|
||||
}
|
||||
|
||||
static Material[] materials = { Material.field_151577_b, Material.field_151578_c, Material.sand, Material.snow, Material.craftedSnow, Material.clay };
|
||||
static Material[] materials = { Material.field_151577_b, Material.field_151578_c, Material.field_151595_p, Material.snow, Material.craftedSnow, Material.clay };
|
||||
|
||||
@Override
|
||||
public Item getHeadItem ()
|
||||
|
||||
Reference in new issue
Block a user