Don't render tank sides where stacked

This commit is contained in:
CovertJaguar 2013-07-22 22:20:45 -07:00
parent e581841eaa
commit a8f43acfbd

View file

@ -1,12 +1,10 @@
/**
* Copyright (c) SpaceToad, 2011
* http://www.mod-buildcraft.com
* Copyright (c) SpaceToad, 2011 http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* BuildCraft is distributed under the terms of the Minecraft Mod Public License
* 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft.factory;
import buildcraft.BuildCraftCore;
@ -31,10 +29,10 @@ import net.minecraftforge.fluids.FluidStack;
public class BlockTank extends BlockContainer {
private Icon textureStackedSide;
private Icon textureBottomSide;
private Icon textureTop;
private Icon textureBottomSide;
private Icon textureTop;
public BlockTank(int i) {
public BlockTank(int i) {
super(i, Material.glass);
setBlockBounds(0.125F, 0F, 0.125F, 0.875F, 1F, 0.875F);
setHardness(0.5F);
@ -63,26 +61,26 @@ public class BlockTank extends BlockContainer {
@Override
@SideOnly(Side.CLIENT)
public Icon getIcon(int par1, int par2) {
switch(par1){
case 0:
case 1:
return textureTop;
default:
return textureBottomSide;
switch (par1) {
case 0:
case 1:
return textureTop;
default:
return textureBottomSide;
}
}
@SuppressWarnings({ "all" })
@SuppressWarnings({"all"})
public Icon getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l) {
switch (l) {
case 0:
case 1:
return textureTop;
default:
if (iblockaccess.getBlockId(i, j - 1, k) == blockID)
return textureStackedSide;
else
return textureBottomSide;
case 0:
case 1:
return textureTop;
default:
if (iblockaccess.getBlockId(i, j - 1, k) == blockID)
return textureStackedSide;
else
return textureBottomSide;
}
}
@ -138,7 +136,14 @@ public class BlockTank extends BlockContainer {
return false;
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
if (side <= 1)
return world.getBlockId(x, y, z) != blockID;
return super.shouldSideBeRendered(world, x, y, z, side);
}
@SuppressWarnings({"unchecked", "rawtypes"})
@Override
public void addCreativeItems(ArrayList itemList) {
itemList.add(new ItemStack(this));
@ -146,11 +151,9 @@ public class BlockTank extends BlockContainer {
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister par1IconRegister)
{
textureStackedSide = par1IconRegister.registerIcon("buildcraft:tank_stacked_side");
textureBottomSide = par1IconRegister.registerIcon("buildcraft:tank_bottom_side");
textureTop = par1IconRegister.registerIcon("buildcraft:tank_top");
public void registerIcons(IconRegister par1IconRegister) {
textureStackedSide = par1IconRegister.registerIcon("buildcraft:tank_stacked_side");
textureBottomSide = par1IconRegister.registerIcon("buildcraft:tank_bottom_side");
textureTop = par1IconRegister.registerIcon("buildcraft:tank_top");
}
}