package JAKJ . RedstoneInMotion ;

public class Spectre extends Block
{
	public Spectre ( )
	{
		super ( Configuration . BlockIds . Spectre , bedrock , SpectreItem . class ) ;

		RegisterTileEntity ( MotiveSpectreEntity . class ) ;

		RegisterTileEntity ( TeleportativeSpectreEntity . class ) ;
	}

	public enum Types
	{
		Motive ,
		Supportive ,
		Teleportative ;
	}

	@Override
	public boolean hasTileEntity ( int Meta )
	{
		return ( Meta != Types . Supportive . ordinal ( ) ) ;
	}

	@Override
	public net . minecraft . tileentity . TileEntity createTileEntity ( net . minecraft . world . World World , int Meta )
	{
		try
		{
			switch ( Types . values ( ) [ Meta ] )
			{
				case Motive :

					return ( new MotiveSpectreEntity ( ) ) ;

				case Teleportative :

					return ( new TeleportativeSpectreEntity ( ) ) ;
			}
		}
		catch ( Throwable Throwable )
		{
			Throwable . printStackTrace ( ) ;
		}

		return ( null ) ;
	}

	@Override
	public boolean onBlockActivated ( net . minecraft . world . World World , int X , int Y , int Z , net . minecraft . entity . player . EntityPlayer Player , int Side , float HitX , float HitY , float HitZ )
	{
		if ( World . isRemote )
		{
			return ( false ) ;
		}

		if ( World . getBlockMetadata ( X , Y , Z ) != Types . Supportive . ordinal ( ) )
		{
			return ( false ) ;
		}

		if ( ! ToolItemSet . IsScrewdriverOrEquivalent ( Player . inventory . getCurrentItem ( ) ) )
		{
			return ( false ) ;
		}

		WorldUtil . ClearBlock ( World , X , Y , Z ) ;

		return ( true ) ;
	}

	@Override
	public int quantityDropped ( int Meta , int Fortune , java . util . Random Random )
	{
		return ( 0 ) ;
	}

	@Override
	public int getRenderType ( )
	{
		return ( -1 ) ;
	}

	@Override
	public boolean isOpaqueCube ( )
	{
		return ( false ) ;
	}

	@Override
	public boolean renderAsNormalBlock ( )
	{
		return ( false ) ;
	}
}
