2013-07-26 21:18:53 -07:00
|
|
|
package tconstruct.blocks;
|
|
|
|
|
|
2014-01-01 09:30:55 -05:00
|
|
|
import net.minecraft.block.Block;
|
2013-07-26 21:18:53 -07:00
|
|
|
import net.minecraft.block.material.Material;
|
2013-12-31 11:26:08 -05:00
|
|
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
|
|
|
|
import net.minecraft.util.IIcon;
|
2013-07-26 21:18:53 -07:00
|
|
|
import net.minecraft.world.IBlockAccess;
|
|
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
|
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
|
|
|
|
|
|
|
|
|
public class GlassBlockStained extends TConstructBlock
|
|
|
|
|
{
|
|
|
|
|
static String blockTextures[] = { "white", "orange", "magenta", "lightblue", "yellow", "lime", "pink", "gray", "lightgray", "cyan", "purple", "blue", "brown", "green", "red", "black" };
|
|
|
|
|
String textureName;
|
|
|
|
|
|
2013-12-31 11:26:08 -05:00
|
|
|
public GlassBlockStained(String tex)
|
2013-07-26 21:18:53 -07:00
|
|
|
{
|
2014-01-10 21:14:54 -05:00
|
|
|
super(Material.field_151592_s, 3f, blockTextures);
|
2013-07-26 21:18:53 -07:00
|
|
|
this.textureName = tex;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public int getRenderBlockPass ()
|
|
|
|
|
{
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean isOpaqueCube ()
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@SideOnly(Side.CLIENT)
|
2014-01-15 23:19:27 -05:00
|
|
|
public boolean func_149646_a (IBlockAccess world, int x, int y, int z, int side)
|
2013-07-26 21:18:53 -07:00
|
|
|
{
|
2014-01-01 09:30:55 -05:00
|
|
|
Block block = world.getBlock(x, y, z);
|
2014-01-15 23:19:27 -05:00
|
|
|
return block == this ? false : super. func_149646_a(world, x, y, z, side);
|
2013-07-26 21:18:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@SideOnly(Side.CLIENT)
|
2014-01-18 02:52:49 -05:00
|
|
|
public void func_149651_a (IIconRegister iconRegister)
|
2013-07-26 21:18:53 -07:00
|
|
|
{
|
2014-01-01 08:54:06 -05:00
|
|
|
this.icons = new IIcon[textureNames.length];
|
2013-07-26 21:18:53 -07:00
|
|
|
|
|
|
|
|
for (int i = 0; i < this.icons.length; ++i)
|
|
|
|
|
{
|
|
|
|
|
this.icons[i] = iconRegister.registerIcon("tinker:glass/" + textureName + textureNames[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|