Skip to content

Commit

Permalink
moar fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
progwml6 committed Jan 7, 2014
1 parent 3cc541e commit f52b2f6
Show file tree
Hide file tree
Showing 21 changed files with 725 additions and 723 deletions.
5 changes: 3 additions & 2 deletions src/main/java/tconstruct/blocks/GlassBlock.java
@@ -1,6 +1,7 @@
package tconstruct.blocks;

import cpw.mods.fml.relauncher.*;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
Expand All @@ -24,8 +25,8 @@ public boolean isOpaqueCube ()
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered (IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
{
int i1 = par1IBlockAccess.getBlockId(par2, par3, par4);
return i1 == this.blockID ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5);
Block i1 = par1IBlockAccess.func_147439_a(par2, par3, par4);
return i1 == (Block) this ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5);
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/tconstruct/blocks/GlassBlockConnected.java
Expand Up @@ -65,9 +65,9 @@ public int getRenderBlockPass ()
* @param par6 Metadata of the block this block is trying to connect to
* @return true if should connect
*/
public boolean shouldConnectToBlock (IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5, int par6)
public boolean shouldConnectToBlock (IBlockAccess par1IBlockAccess, int par2, int par3, int par4, Block par5, int par6)
{
return par5 == this.blockID;
return par5 == (Block) this;
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/tconstruct/blocks/GlassPaneConnected.java
Expand Up @@ -667,9 +667,9 @@ public IIcon getSideTextureIndex ()
return this.theIcon;
}

public final boolean canThisPaneConnectToThisBlockID (int par1)
public final boolean canThisPaneConnectToThisBlock (Block b)
{
return Block.opaqueCubeLookup[par1] || par1 == this.blockID || par1 == Blocks.glass.blockID;
return Block.opaqueCubeLookup[b] || b == (Block) this || b == Blocks.glass;
}

public void registerIcons (IIconRegister par1IconRegister)
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/tconstruct/blocks/LavaTankBlock.java
Expand Up @@ -92,8 +92,8 @@ public boolean shouldSideBeRendered (IBlockAccess world, int x, int y, int z, in
{
//if (side == 0 && world.getBlockMetadata(x, y, z) == 0)
//return super.shouldSideBeRendered(world, x, y, z, side);
int bID = world.getBlockId(x, y, z);
return bID == this.blockID ? false : super.shouldSideBeRendered(world, x, y, z, side);
Block b = world.func_147439_a(x, y, z);
return b == (Block)this ? false : super.shouldSideBeRendered(world, x, y, z, side);
//return true;
}

Expand Down Expand Up @@ -265,7 +265,7 @@ public boolean removeBlockByPlayer (World world, EntityPlayer player, int x, int
{
player.addExhaustion(0.025F);
int meta = world.getBlockMetadata(x, y, z);
ItemStack stack = new ItemStack(this.blockID, 1, meta);
ItemStack stack = new ItemStack(this, 1, meta);
LavaTankLogic logic = (LavaTankLogic) world.getBlockTileEntity(x, y, z);
FluidStack liquid = logic.tank.getFluid();
if (liquid != null)
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/tconstruct/blocks/SearedBlock.java
Expand Up @@ -7,6 +7,7 @@
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.*;
Expand Down Expand Up @@ -206,8 +207,9 @@ public String[] getTextureNames ()
return textureNames;
}

//TODO getIcon
@Override
public IIcon getIcon (int side, int meta)
public IIcon func_149691_a (int side, int meta)
{
if (meta == 0)
return icons[getTextureIndex(side)];
Expand Down Expand Up @@ -246,7 +248,7 @@ public boolean shouldSideBeRendered (IBlockAccess par1IBlockAccess, int par2, in
}

@Override
public void getSubBlocks (Block b, CreativeTabs tab, List list)
public void func_149666_a (Item b, CreativeTabs tab, List list)
{
for (int iter = 0; iter < 3; iter++)
{
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/tconstruct/blocks/StoneLadder.java
Expand Up @@ -19,7 +19,7 @@ public StoneLadder()
{
super();
this.setUnlocalizedName("decoration.stoneladder");
this.setCreativeTab(CreativeTabs.tabDecorations);
this.func_149647_a(CreativeTabs.tabDecorations);
}

@Override
Expand Down
13 changes: 7 additions & 6 deletions src/main/java/tconstruct/blocks/component/SmelteryScan.java
Expand Up @@ -6,6 +6,7 @@
import mantle.blocks.iface.IServantLogic;
import mantle.world.CoordTuple;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagIntArray;
import net.minecraft.nbt.NBTTagList;
Expand All @@ -32,8 +33,8 @@ public void checkValidStructure ()

protected boolean checkAir (int x, int y, int z)
{
Block block = Block.blocksList[world.getBlockId(x, y, z)];
if (block == null || block.isAirBlock(world, x, y, z) || block == TRepo.tankAir)
Block block = world.func_147439_a(x, y, z);
if (block == null || block == Blocks.air || block == TRepo.tankAir)
return true;

return false;
Expand All @@ -42,8 +43,8 @@ protected boolean checkAir (int x, int y, int z)
@Override
protected boolean checkServant (int x, int y, int z)
{
Block block = Block.blocksList[world.getBlockId(x, y, z)];
if (block == null || block.isAirBlock(world, x, y, z) || !isValidBlock(x, y, z))
Block block = world.func_147439_a(x, y, z)];
if (block == null || world.func_147439_a( x, y, z) == Blocks.air || !isValidBlock(x, y, z))
return false;

if (!block.hasTileEntity(world.getBlockMetadata(x, y, z)))
Expand Down Expand Up @@ -71,9 +72,9 @@ protected void finalizeStructure ()
{
for (CoordTuple coord : airCoords)
{
if (world.getBlockId(coord.x, coord.y, coord.z) != TRepo.tankAir.blockID)
if (world.func_147439_a(coord.x, coord.y, coord.z) != TRepo.tankAir)
{
world.setBlock(coord.x, coord.y, coord.z, TRepo.tankAir.blockID);
world.setBlock(coord.x, coord.y, coord.z, TRepo.tankAir);
IServantLogic servant = (IServantLogic) world.getBlockTileEntity(coord.x, coord.y, coord.z);
servant.verifyMaster(imaster, world, master.xCoord, master.yCoord, master.zCoord);
}
Expand Down
11 changes: 5 additions & 6 deletions src/main/java/tconstruct/blocks/logic/FurnaceLogic.java
Expand Up @@ -206,7 +206,6 @@ public static int getItemBurnTime (ItemStack stack)
}
else
{
int i = stack.getItem().itemID;
Item item = stack.getItem();

if (stack.getItem() instanceof ItemBlock && Block.blocksList[i] != null)
Expand Down Expand Up @@ -240,15 +239,15 @@ public static int getItemBurnTime (ItemStack stack)
return 200;
if (item instanceof ItemHoe && ((ItemHoe) item).getMaterialName().equals("WOOD"))
return 200;
if (i == Items.stick.itemID)
if (item == Items.stick)
return 100;
if (i == Items.coal.itemID)
if (item == Items.coal)
return 1600;
if (i == Items.bucketLava.itemID)
if (item == Items.lava_bucket)
return 20000;
if (i == Blocks.sapling.blockID)
if (item == new ItemStack(Blocks.sapling).getItem())
return 100;
if (i == Items.blaze_rod.itemID)
if (item == Items.blaze_rod)
return 2400;
return GameRegistry.getFuelValue(stack);
}
Expand Down
19 changes: 10 additions & 9 deletions src/main/java/tconstruct/blocks/slime/SlimeGrass.java
Expand Up @@ -9,6 +9,7 @@
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
Expand Down Expand Up @@ -79,7 +80,7 @@ else if (side == 1)
}

@Override
public void getSubBlocks (Block b, CreativeTabs tab, List list)
public void getSubBlocks (Item b, CreativeTabs tab, List list)
{
for (int iter = 0; iter < 1; iter++)
{
Expand All @@ -96,7 +97,7 @@ public boolean canSustainPlant (World world, int x, int y, int z, ForgeDirection

public void onPlantGrow (World world, int x, int y, int z, int sourceX, int sourceY, int sourceZ)
{
world.setBlock(x, y, z, TRepo.craftedSoil.blockID, 5, 3);
world.setBlock(x, y, z, TRepo.craftedSoil, 5, 3);
}

public void updateTick (World par1World, int par2, int par3, int par4, Random par5Random)
Expand All @@ -105,7 +106,7 @@ public void updateTick (World par1World, int par2, int par3, int par4, Random pa
{
if (par1World.getBlockLightValue(par2, par3 + 1, par4) < 4 && par1World.getBlockLightOpacity(par2, par3 + 1, par4) > 2)
{
par1World.setBlock(par2, par3, par4, TRepo.craftedSoil.blockID, 5, 3);
par1World.setBlock(par2, par3, par4, TRepo.craftedSoil, 5, 3);
}
else if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9)
{
Expand All @@ -114,21 +115,21 @@ else if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9)
int posX = par2 + par5Random.nextInt(3) - 1;
int posY = par3 + par5Random.nextInt(5) - 3;
int posZ = par4 + par5Random.nextInt(3) - 1;
int l1 = par1World.getBlockId(posX, posY + 1, posZ);
Block l1 = par1World.func_147439_a(posX, posY + 1, posZ);

if (par1World.getBlockLightValue(posX, posY + 1, posZ) >= 4 && par1World.getBlockLightOpacity(posX, posY + 1, posZ) <= 2)
{
int blockID = par1World.getBlockId(posX, posY, posZ);
if (blockID == Blocks.dirt.blockID)
Block block = par1World.func_147439_a(posX, posY, posZ);
if (block == Blocks.dirt)
{
par1World.setBlock(posX, posY, posZ, this.blockID, 1, 3);
par1World.setBlock(posX, posY, posZ,(Block) this, 1, 3);
return;
}
int blockMeta = par1World.getBlockMetadata(posX, posY, posZ);
if (blockID == TRepo.craftedSoil.blockID)
if (block == TRepo.craftedSoil)
{
if (blockMeta == 5)
par1World.setBlock(posX, posY, posZ, this.blockID, 0, 3);
par1World.setBlock(posX, posY, posZ, (Block) this, 0, 3);
}
}
}
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/tconstruct/blocks/slime/SlimeSapling.java
Expand Up @@ -9,6 +9,7 @@
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
Expand Down Expand Up @@ -47,9 +48,9 @@ public void registerIcons (IIconRegister iconRegister)
}
}

public boolean canThisPlantGrowOnThisBlockID (int id)
public boolean canThisPlantGrowOnThisBlockID (Block b)
{
return id == Blocks.grass.blockID || id == Blocks.dirt.blockID || id == TRepo.slimeGrass.blockID || id == TRepo.craftedSoil.blockID;
return b == Blocks.grass || b == Blocks.dirt || b == TRepo.slimeGrass || b == TRepo.craftedSoil;
}

public void updateTick (World world, int x, int y, int z, Random random)
Expand Down Expand Up @@ -121,7 +122,7 @@ public int damageDropped (int i)

@SideOnly(Side.CLIENT)
@Override
public void getSubBlocks (Block b, CreativeTabs par2CreativeTabs, List par3List)
public void getSubBlocks (Item b, CreativeTabs par2CreativeTabs, List par3List)
{
for (int i = 0; i < 1; i++)
par3List.add(new ItemStack(b, 1, i));
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/tconstruct/blocks/traps/Punji.java
Expand Up @@ -57,7 +57,7 @@ public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer
if (meta < 4)
{
ItemStack stack = player.getCurrentEquippedItem();
if (stack != null && stack.itemID == TRepo.punji.blockID)
if (stack != null && stack == new ItemStack(TRepo.punji))
{
world.setBlockMetadataWithNotify(x, y, z, meta + 1, 3);
world.playSoundEffect((double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), this.stepSound.getPlaceSound(),
Expand Down

0 comments on commit f52b2f6

Please sign in to comment.