Files
TinkersConstruct/src/main/java/tconstruct/blocks/GlassBlock.java
T

76 lines
2.0 KiB
Java
Raw Normal View History

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;
import net.minecraft.block.material.Material;
2013-12-31 11:26:08 -05:00
import net.minecraft.client.renderer.texture.IIconRegister;
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.*;
public class GlassBlock extends TConstructBlock
{
static String blockTextures[] = { "glass_clear", "soulglass", "soulglass_clear" };
2013-12-31 11:26:08 -05:00
public GlassBlock()
{
2014-01-10 21:14:54 -05:00
super(Material.field_151592_s, 3f, blockTextures);
}
public boolean isOpaqueCube ()
{
return false;
}
@SideOnly(Side.CLIENT)
2014-01-15 23:19:27 -05:00
public boolean func_149646_a (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);
2014-01-15 23:19:27 -05:00
return i1 == (Block) this ? false : super.func_149646_a(par1IBlockAccess, par2, par3, par4, par5);
}
@Override
public float func_149712_f (World world, int x, int y, int z)
{
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:
return field_149782_v;
}
}
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:
return func_149638_a(entity);
}
}
@Override
@SideOnly(Side.CLIENT)
2013-12-31 11:26:08 -05:00
public void registerIcons (IIconRegister iconRegister)
{
2013-12-31 11:26:08 -05:00
this.icons = new IIcon[textureNames.length];
for (int i = 0; i < this.icons.length; ++i)
{
this.icons[i] = iconRegister.registerIcon("tinker:glass/" + textureNames[i]);
}
}
}