Puts everywhere brackets

This commit is contained in:
thatsIch
2015-04-29 02:30:53 +02:00
parent 23aa8fd72d
commit 64ed05a1b4
465 changed files with 6726 additions and 14 deletions
@@ -40,7 +40,9 @@ public class ItemSorters
public int compare( IAEItemStack o1, IAEItemStack o2 )
{
if( Direction == SortDir.ASCENDING )
{
return Platform.getItemDisplayName( o1 ).compareToIgnoreCase( Platform.getItemDisplayName( o2 ) );
}
return Platform.getItemDisplayName( o2 ).compareToIgnoreCase( Platform.getItemDisplayName( o1 ) );
}
};
@@ -54,14 +56,18 @@ public class ItemSorters
AEItemStack op2 = (AEItemStack) o2;
if( Direction == SortDir.ASCENDING )
{
return this.secondarySort( op2.getModID().compareToIgnoreCase( op1.getModID() ), o1, o2 );
}
return this.secondarySort( op1.getModID().compareToIgnoreCase( op2.getModID() ), o2, o1 );
}
private int secondarySort( int compareToIgnoreCase, IAEItemStack o1, IAEItemStack o2 )
{
if( compareToIgnoreCase == 0 )
{
return Platform.getItemDisplayName( o2 ).compareToIgnoreCase( Platform.getItemDisplayName( o1 ) );
}
return compareToIgnoreCase;
}
@@ -73,7 +79,9 @@ public class ItemSorters
public int compare( IAEItemStack o1, IAEItemStack o2 )
{
if( Direction == SortDir.ASCENDING )
{
return compareLong( o2.getStackSize(), o1.getStackSize() );
}
return compareLong( o1.getStackSize(), o2.getStackSize() );
}
};
@@ -85,12 +93,16 @@ public class ItemSorters
public int compare( IAEItemStack o1, IAEItemStack o2 )
{
if( api == null )
{
return CONFIG_BASED_SORT_BY_NAME.compare( o1, o2 );
}
int cmp = api.compareItems( o1.getItemStack(), o2.getItemStack() );
if( Direction == SortDir.ASCENDING )
{
return cmp;
}
return -cmp;
}
};
@@ -98,38 +110,56 @@ public class ItemSorters
public static void init()
{
if( api != null )
{
return;
}
if( AppEng.instance.isIntegrationEnabled( IntegrationType.InvTweaks ) )
{
api = (IInvTweaks) AppEng.instance.getIntegration( IntegrationType.InvTweaks );
}
else
{
api = null;
}
}
public static int compareInt( int a, int b )
{
if( a == b )
{
return 0;
}
if( a < b )
{
return -1;
}
return 1;
}
public static int compareLong( long a, long b )
{
if( a == b )
{
return 0;
}
if( a < b )
{
return -1;
}
return 1;
}
public static int compareDouble( double a, double b )
{
if( a == b )
{
return 0;
}
if( a < b )
{
return -1;
}
return 1;
}
}