Skip to content

Commit

Permalink
fixed several tools
Browse files Browse the repository at this point in the history
  • Loading branch information
progwml6 committed Jan 16, 2014
1 parent 3d5cdf6 commit d914004
Show file tree
Hide file tree
Showing 27 changed files with 86 additions and 85 deletions.
6 changes: 3 additions & 3 deletions src/main/java/tconstruct/client/gui/PartCrafterGui.java
Expand Up @@ -184,7 +184,7 @@ protected void drawGuiContainerBackgroundLayer (float par1, int par2, int par3)
if (drawChestPart)
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(minichest);
this.field_146297_k.getTextureManager().bindTexture(minichest);
this.drawTexturedModalRect(cornerX - 116, cornerY + 11, 0, 0, this.xSize, this.ySize);
}

Expand All @@ -199,7 +199,7 @@ protected void drawGuiContainerBackgroundLayer (float par1, int par2, int par3)
@Override
protected void mouseClicked (int mouseX, int mouseY, int clickNum)
{
boolean flag = clickNum == this.mc.gameSettings.keyBindPickBlock.keyCode + 100;
boolean flag = clickNum == this.field_146297_k.gameSettings.keyBindPickBlock.keyCode + 100;
Slot slot = this.getSlotAtPosition(mouseX, mouseY);
long l = Minecraft.getSystemTime();
this.field_94074_J = this.field_94072_H == slot && l - this.field_94070_G < 250L && this.field_94073_I == clickNum;
Expand All @@ -224,7 +224,7 @@ protected void mouseClicked (int mouseX, int mouseY, int clickNum)
k1 = -999;
}

if (this.field_146297_k.gameSettings.touchscreen && flag1 && this.mc.thePlayer.inventory.getItemStack() == null)
if (this.field_146297_k.gameSettings.touchscreen && flag1 && this.field_146297_k.thePlayer.inventory.getItemStack() == null)
{
this.field_146297_k.displayGuiScreen((GuiScreen) null);
return;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/tconstruct/client/gui/SmelteryGui.java
Expand Up @@ -164,7 +164,7 @@ protected void drawGuiContainerBackgroundLayer (float f, int mouseX, int mouseY)
drawTexturedModalRect(cornerX + 46, cornerY, 0, 0, 176, ySize);

//Fuel - Lava
this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
this.field_146297_k.getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
if (logic.fuelGague > 0)
{
IIcon lavaIcon = Blocks.lava.getIcon(0, 0);
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/tconstruct/items/tools/Battleaxe.java
Expand Up @@ -45,7 +45,7 @@ protected String getHarvestType ()
}

@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;
Expand Down Expand Up @@ -277,11 +277,11 @@ public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPl
{
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
{
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/tconstruct/items/tools/BowBase.java
Expand Up @@ -149,11 +149,11 @@ public void onPlayerStoppedUsing (ItemStack stack, World world, EntityPlayer pla
//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);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/tconstruct/items/tools/Chisel.java
Expand Up @@ -91,7 +91,7 @@ public ItemStack onEaten (ItemStack itemstack, World world, EntityPlayer entityp
{
return itemstack;
}
if (movingobjectposition.typeOfHit == MovingObjectType.TILE)
if (movingobjectposition.typeOfHit == MovingObjectType.BLOCK)
{
int x = movingobjectposition.blockX;
int y = movingobjectposition.blockY;
Expand All @@ -100,7 +100,7 @@ public ItemStack onEaten (ItemStack itemstack, World world, EntityPlayer entityp
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))
Expand Down
18 changes: 9 additions & 9 deletions src/main/java/tconstruct/items/tools/Excavator.java
Expand Up @@ -38,7 +38,7 @@ protected String getHarvestType ()
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 ()
Expand Down Expand Up @@ -142,14 +142,14 @@ public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPl

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++)
Expand Down Expand Up @@ -192,11 +192,11 @@ public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPl
{
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)
{
Expand All @@ -219,12 +219,12 @@ public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPl
{
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
{
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/tconstruct/items/tools/FryingPan.java
Expand Up @@ -86,7 +86,7 @@ public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int
{
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;
}
Expand Down Expand Up @@ -121,17 +121,17 @@ else if (!world.getBlockMaterial(x, y, z).isSolid())
{
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;

Expand Down
14 changes: 7 additions & 7 deletions src/main/java/tconstruct/items/tools/Hammer.java
Expand Up @@ -68,7 +68,7 @@ protected Material[] getEffectiveMaterials ()
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 ()
Expand Down Expand Up @@ -242,7 +242,7 @@ public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPl
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++)
Expand Down Expand Up @@ -290,7 +290,7 @@ public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPl
{
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);
Expand All @@ -316,12 +316,12 @@ public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPl
{
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
{
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/tconstruct/items/tools/Hatchet.java
Expand Up @@ -34,7 +34,7 @@ protected String getHarvestType ()
}

@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;
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/tconstruct/items/tools/LumberAxe.java
Expand Up @@ -55,7 +55,7 @@ public String getToolName ()
}

@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;
Expand Down Expand Up @@ -242,11 +242,11 @@ void breakTree (World world, int x, int y, int z, ItemStack stack, NBTTagCompoun
{
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
{
Expand Down Expand Up @@ -308,7 +308,7 @@ void destroyWood (World world, int x, int y, int z, ItemStack stack, NBTTagCompo
{
//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);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/tconstruct/items/tools/Pickaxe.java
Expand Up @@ -25,7 +25,7 @@ protected Material[] getEffectiveMaterials ()
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 ()
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/tconstruct/items/tools/PotionLauncher.java
Expand Up @@ -111,7 +111,7 @@ public IIcon getIconFromDamage (int meta)
}

@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();
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/tconstruct/items/tools/Scythe.java
Expand Up @@ -155,7 +155,7 @@ public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPl
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;
Expand All @@ -177,7 +177,7 @@ public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPl

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++)
Expand All @@ -188,10 +188,10 @@ public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPl
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);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/tconstruct/items/tools/Shovel.java
Expand Up @@ -27,7 +27,7 @@ protected String getHarvestType ()
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 ()
Expand Down

0 comments on commit d914004

Please sign in to comment.