package common.block.artificial;

import common.block.Block;
import common.block.Material;
import common.entity.Entity;
import common.item.CheatTab;
import common.model.BlockLayer;
import common.rng.Random;
import common.util.BlockPos;
import common.util.Facing;
import common.world.IWorldAccess;
import common.world.State;
import common.world.World;

public class BlockGlass extends Block {
	public BlockGlass() {
		super(Material.TRANSLUCENT);
		this.setTab(CheatTab.BLOCKS);
	}

	public int quantityDropped(Random rand) {
		return 0;
	}

	public BlockLayer getBlockLayer() {
		return BlockLayer.CUTOUT;
	}

	public boolean isOpaqueCube() {
		return false;
	}

	public boolean isFullCube() {
		return false;
	}

	public boolean canSilkHarvest() {
		return true;
	}

	public boolean shouldSideBeRendered(IWorldAccess world, BlockPos pos, Facing side) {
		State state = world.getState(pos);
		Block block = state.getBlock();
		return world.getState(pos.offset(side.getOpposite())) != state || (block != this && super.shouldSideBeRendered(world, pos, side));
	}
	
	public boolean onShot(World world, BlockPos pos, State state, Entity projectile) {
		world.destroyBlock(pos, true);
		return false;
	}
}
