package erebus.blocks;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import erebus.ModTabs;
public class BlockAmber extends Block {
public BlockAmber() {
super(Material.GLASS);
setHardness(1.5F);
setLightOpacity(3);
setResistance(10.0F);
setSoundType(SoundType.GLASS);
setCreativeTab(ModTabs.BLOCKS);
setHarvestLevel("pickaxe", 0);
}
@Override
@SideOnly(Side.CLIENT)
public BlockRenderLayer getBlockLayer() {
return BlockRenderLayer.TRANSLUCENT;
}
@Override
public int quantityDropped(Random rand) {
return 1;
}
@Override
public boolean isOpaqueCube(IBlockState state) {
return false;
}
@Override
@SideOnly(Side.CLIENT)
@SuppressWarnings("deprecation")
public boolean shouldSideBeRendered(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
IBlockState iblockstate = world.getBlockState(pos.offset(side));
Block block = iblockstate.getBlock();
if (state != iblockstate)
return true;
if (block == this)
return false;
return block == this ? false : super.shouldSideBeRendered(state, world, pos, side);
}
}