package lumaceon.mods.clockworkphase2.block.temporal; import lumaceon.mods.clockworkphase2.block.BlockClockworkPhase; import lumaceon.mods.clockworkphase2.tile.TileCelestialCompass; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumBlockRenderType; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class BlockCelestialCompass extends BlockClockworkPhase implements ITileEntityProvider { public BlockCelestialCompass(Material blockMaterial, String unlocalizedName) { super(blockMaterial, unlocalizedName); this.setResistance(1000000.0F); this.setCreativeTab(null); } @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { if(!player.isSneaking()) { TileEntity te = world.getTileEntity(pos); if(te != null && te instanceof TileCelestialCompass) return ((TileCelestialCompass) te).onSubBlockClicked(player, 8); } return false; } @Override public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { TileEntity te = worldIn.getTileEntity(pos); if(te != null && te instanceof TileCelestialCompass && !((TileCelestialCompass) te).isBeingDestroyed) TileCelestialCompass.destroyMultiblock((TileCelestialCompass) te, worldIn, pos); super.breakBlock(worldIn, pos, state); } @Override public TileEntity createNewTileEntity(World world, int p_149915_2_) { return new TileCelestialCompass(); } @Override public EnumBlockRenderType getRenderType(IBlockState state) { return EnumBlockRenderType.INVISIBLE; } @Override public boolean isOpaqueCube(IBlockState state) { return false; } @Override public boolean isFullCube(IBlockState state) { return false; } }