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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

71 lines
2.1 KiB
Java
Raw Normal View History

2014-06-04 21:44:48 -08:00
package tconstruct.smeltery.blocks;
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;
2014-09-09 18:30:15 +10:00
import net.minecraft.world.*;
2014-09-09 18:30:15 +10:00
import cpw.mods.fml.relauncher.*;
2023-05-15 15:07:18 +09:00
import tconstruct.blocks.TConstructBlock;
public class GlassBlock extends TConstructBlock {
2023-01-25 21:05:22 +01:00
static String[] blockTextures = { "glass_clear", "soulglass", "soulglass_clear" };
public GlassBlock() {
2014-02-05 08:28:53 -05:00
super(Material.glass, 3f, blockTextures);
}
2014-02-17 00:31:43 -05:00
@Override
public boolean isOpaqueCube() {
return false;
}
2014-02-17 00:31:43 -05:00
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
2014-02-05 08:28:53 -05:00
Block i1 = par1IBlockAccess.getBlock(par2, par3, par4);
return i1 != this && super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5);
}
@Override
public float getBlockHardness(World world, int x, int y, int z) {
int meta = world.getBlockMetadata(x, y, z);
switch (meta) {
case 0:
return 0.3F;
case 1:
case 2:
return 50.0F;
default:
return blockHardness;
}
}
2014-02-17 00:31:43 -05:00
@Override
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:
case 2:
return 2000F;
default:
return getExplosionResistance(entity);
}
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(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]);
}
}
}