Fixed wrenchy things

This commit is contained in:
Brian Ricketts 2013-03-25 16:14:40 -05:00
parent f531771e12
commit a8487f8427

View file

@ -16,32 +16,33 @@ import cpw.mods.fml.relauncher.SideOnly;
public class BlockALMachine extends BlockAdvanced
{
public Icon machine_icon;
public BlockALMachine(int id, Material material)
{
super(id, material);
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IconRegister iconReg)
{
this.machine_icon = iconReg.registerIcon(AssemblyLine.TEXTURE_NAME_PREFIX + "machine");
}
@Override
@SideOnly(Side.CLIENT)
public Icon getBlockTexture(IBlockAccess par1iBlockAccess, int par2, int par3, int par4, int par5)
{
return this.machine_icon;
}
@Override
@SideOnly(Side.CLIENT)
public Icon getBlockTextureFromSideAndMetadata(int par1, int par2)
{
return this.machine_icon;
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ)
{
@ -50,14 +51,15 @@ public class BlockALMachine extends BlockAdvanced
*/
if (player.inventory.getCurrentItem() != null)
{
System.out.println(player.inventory.getCurrentItem());
if (isHoldingWrench(player))
{
if (player.isSneaking())
{
if (this.onSneakMachineActivated(world, x, y, z, player, side, hitX, hitY, hitZ))
return true;
if (this.onSneakUseWrench(world, x, y, z, player, side, hitX, hitY, hitZ))
return true;
if (this.onSneakMachineActivated(world, x, y, z, player, side, hitX, hitY, hitZ))
return true;
}
if (this.onUseWrench(world, x, y, z, player, side, hitX, hitY, hitZ))
return true;