package micdoodle8.mods.galacticraft.core.items; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; public class ItemBlockGlassGC extends ItemBlockDesc { public ItemBlockGlassGC(Block block) { super(block); this.setMaxDamage(0); this.setHasSubtypes(true); } @Override public int getMetadata(int damage) { return damage; } @Override public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, IBlockState newState) { if (!world.setBlockState(pos, newState, 3)) return false; IBlockState state = world.getBlockState(pos); if (state.getBlock().getClass() == this.block.getClass()) { setTileEntityNBT(world, player, pos, stack); this.block.onBlockPlacedBy(world, pos, state, player, stack); } return true; } }