-
Notifications
You must be signed in to change notification settings - Fork 753
/
GlassBlockStained.java
51 lines (43 loc) · 1.46 KB
/
GlassBlockStained.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package tconstruct.blocks;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
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;
public GlassBlockStained(String tex)
{
super(Material.field_151592_s, 3f, blockTextures);
this.textureName = tex;
}
@Override
public int getRenderBlockPass ()
{
return 1;
}
public boolean isOpaqueCube ()
{
return false;
}
@SideOnly(Side.CLIENT)
public boolean func_149646_a (IBlockAccess world, int x, int y, int z, int side)
{
Block block = world.getBlock(x, y, z);
return block == this ? false : super. func_149646_a(world, x, y, z, side);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons (IIconRegister iconRegister)
{
this.icons = new IIcon[textureNames.length];
for (int i = 0; i < this.icons.length; ++i)
{
this.icons[i] = iconRegister.registerIcon("tinker:glass/" + textureName + textureNames[i]);
}
}
}