package JAKJ . RedstoneInMotion ;

public class CarriageItem extends BlockItem
{
	public CarriageItem ( int Id )
	{
		super ( Id ) ;
	}

	public static int GetDecorationMeta ( net . minecraft . item . ItemStack Item )
	{
		return ( ( Item . itemDamage >>> 4 ) & 0xF ) ;
	}

	public static int GetDecorationId ( net . minecraft . item . ItemStack Item )
	{
		return ( Item . itemDamage >>> 8 ) ;
	}

	public static boolean DecorationWillResultInValidItemStack ( int DecorationId )
	{
		return ( ( DecorationId << 8 ) <= Short . MAX_VALUE ) ;
	}

	public static net . minecraft . item . ItemStack Stack ( int Type )
	{
		return ( Stack ( Type , 0 , 0 ) ) ;
	}

	public static net . minecraft . item . ItemStack Stack ( int Type , int DecorationId , int DecorationMeta )
	{
		return ( Stack . New ( Blocks . Carriage , ( DecorationId << 8 ) | ( DecorationMeta << 4 ) | Type ) ) ;
	}

	@Override
	public String getItemDisplayName ( net . minecraft . item . ItemStack Item )
	{
		try
		{
			switch ( Carriage . Types . values ( ) [ GetBlockType ( Item ) ] )
			{
				case Frame :

					return ( "Frame Carriage" ) ;

				case Platform :

					return ( "Platform Carriage" ) ;

				case Structure :

					return ( "Structure Carriage" ) ;

				case Support :

					return ( "Support Carriage" ) ;

				case Template :

					return ( "Template Carriage" ) ;
			}
		}
		catch ( Throwable Throwable )
		{
			Throwable . printStackTrace ( ) ;
		}

		return ( "INVALID CARRIAGE" ) ;
	}

	@Override
	public void AddTooltip ( net . minecraft . item . ItemStack Item , java . util . List TooltipLines )
	{
		try
		{
			switch ( Carriage . Types . values ( ) [ GetBlockType ( Item ) ] )
			{
				case Frame :

					TooltipLines . add ( "Carries blocks directly touching it" ) ;

					break ;

				case Platform :

					TooltipLines . add ( "Carries entire body of blocks it's connected to" ) ;
					TooltipLines . add ( "(In a future release, this will be renamed to 'Support Carriage'.)" ) ;

					break ;

				case Structure :

					TooltipLines . add ( "Carries entire cuboid of world" ) ;

					break ;

				case Support :

					TooltipLines . add ( "Carries straight line of blocks" ) ;
					TooltipLines . add ( "(In a future release, this will be renamed to 'Platform Carriage'.)" ) ;

					break ;

				case Template :

					TooltipLines . add ( "Carries blocks in the exact pattern prepared" ) ;

					break ;
			}
		}
		catch ( Throwable Throwable )
		{
			Throwable . printStackTrace ( ) ;

			return ;
		}

		int DecorationId = GetDecorationId ( Item ) ;

		if ( DecorationId == 0 )
		{
			return ;
		}

		net . minecraft . item . ItemStack Decoration = Stack . New ( DecorationId , GetDecorationMeta ( Item ) ) ;

		try
		{
			TooltipLines . add ( "Decoration: " + Decoration . getItem ( ) . getItemDisplayName ( Decoration ) ) ;
		}
		catch ( Throwable Throwable )
		{
			Throwable . printStackTrace ( ) ;

			TooltipLines . add ( "Decoration: <invalid>" ) ;
		}
	}
}
