2013-07-26 21:18:53 -07:00
|
|
|
package tconstruct.blocks;
|
|
|
|
|
|
2013-12-14 14:11:41 +11:00
|
|
|
import cpw.mods.fml.relauncher.*;
|
2014-01-07 13:50:35 -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;
|
2013-07-26 21:18:53 -07:00
|
|
|
import net.minecraft.entity.Entity;
|
2013-12-31 11:26:08 -05:00
|
|
|
import net.minecraft.util.IIcon;
|
2013-12-14 14:11:41 +11:00
|
|
|
import net.minecraft.world.*;
|
2013-07-26 21:18:53 -07:00
|
|
|
|
|
|
|
|
public class GlassBlock extends TConstructBlock
|
|
|
|
|
{
|
|
|
|
|
static String blockTextures[] = { "glass_clear", "soulglass", "soulglass_clear" };
|
|
|
|
|
|
2013-12-31 11:26:08 -05:00
|
|
|
public GlassBlock()
|
2013-07-26 21:18:53 -07:00
|
|
|
{
|
2013-12-31 11:26:08 -05:00
|
|
|
super(Material.glass, 3f, blockTextures);
|
2013-07-26 21:18:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean isOpaqueCube ()
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
|
public boolean shouldSideBeRendered (IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
|
|
|
|
{
|
2014-01-07 13:50:35 -05:00
|
|
|
Block i1 = par1IBlockAccess.func_147439_a(par2, par3, par4);
|
|
|
|
|
return i1 == (Block) this ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5);
|
2013-07-26 21:18:53 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
2014-01-10 17:03:06 -05:00
|
|
|
public float func_149712_f (World world, int x, int y, int z)
|
2013-07-26 21:18:53 -07:00
|
|
|
{
|
|
|
|
|
int meta = world.getBlockMetadata(x, y, z);
|
|
|
|
|
switch (meta)
|
|
|
|
|
{
|
|
|
|
|
case 0:
|
|
|
|
|
return 0.3F;
|
|
|
|
|
case 1:
|
|
|
|
|
return 50.0F;
|
|
|
|
|
case 2:
|
|
|
|
|
return 50.0F;
|
|
|
|
|
default:
|
2014-01-10 17:03:06 -05:00
|
|
|
return field_149782_v;
|
2013-07-26 21:18:53 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public float getExplosionResistance (Entity entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ)
|
|
|
|
|
{
|
|
|
|
|
int meta = world.getBlockMetadata(x, y, z);
|
|
|
|
|
switch (meta)
|
|
|
|
|
{
|
|
|
|
|
case 0:
|
|
|
|
|
return 1.5F;
|
|
|
|
|
case 1:
|
|
|
|
|
return 2000F;
|
|
|
|
|
case 2:
|
|
|
|
|
return 2000F;
|
|
|
|
|
default:
|
2014-01-10 17:03:06 -05:00
|
|
|
return func_149638_a(entity);
|
2013-07-26 21:18:53 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@SideOnly(Side.CLIENT)
|
2013-12-31 11:26:08 -05:00
|
|
|
public void registerIcons (IIconRegister iconRegister)
|
2013-07-26 21:18:53 -07:00
|
|
|
{
|
2013-12-31 11:26:08 -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/" + textureNames[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|