Replaces all custom number comparisons with java provided ones. (#3434)
This commit is contained in:
+4
-5
@@ -86,7 +86,6 @@ import appeng.me.helpers.BaseActionSource;
|
||||
import appeng.me.helpers.GenericInterestManager;
|
||||
import appeng.tile.crafting.TileCraftingStorageTile;
|
||||
import appeng.tile.crafting.TileCraftingTile;
|
||||
import appeng.util.ItemSorters;
|
||||
|
||||
|
||||
public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper, ICellProvider, IMEInventoryHandler<IAEItemStack>
|
||||
@@ -550,20 +549,20 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper
|
||||
{
|
||||
if( prioritizePower )
|
||||
{
|
||||
final int comparison = ItemSorters.compareLong( nextCluster.getCoProcessors(), firstCluster.getCoProcessors() );
|
||||
final int comparison = Long.compare( nextCluster.getCoProcessors(), firstCluster.getCoProcessors() );
|
||||
if( comparison != 0 )
|
||||
{
|
||||
return comparison;
|
||||
}
|
||||
return ItemSorters.compareLong( nextCluster.getAvailableStorage(), firstCluster.getAvailableStorage() );
|
||||
return Long.compare( nextCluster.getAvailableStorage(), firstCluster.getAvailableStorage() );
|
||||
}
|
||||
|
||||
final int comparison = ItemSorters.compareLong( firstCluster.getCoProcessors(), nextCluster.getCoProcessors() );
|
||||
final int comparison = Long.compare( firstCluster.getCoProcessors(), nextCluster.getCoProcessors() );
|
||||
if( comparison != 0 )
|
||||
{
|
||||
return comparison;
|
||||
}
|
||||
return ItemSorters.compareLong( firstCluster.getAvailableStorage(), nextCluster.getAvailableStorage() );
|
||||
return Long.compare( firstCluster.getAvailableStorage(), nextCluster.getAvailableStorage() );
|
||||
}
|
||||
} );
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@ import appeng.api.storage.IStorageChannel;
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.me.cache.SecurityCache;
|
||||
import appeng.util.ItemSorters;
|
||||
|
||||
|
||||
public class NetworkInventoryHandler<T extends IAEStack<T>> implements IMEInventoryHandler<T>
|
||||
@@ -48,7 +47,7 @@ public class NetworkInventoryHandler<T extends IAEStack<T>> implements IMEInvent
|
||||
|
||||
private static final ThreadLocal<Deque> DEPTH_MOD = new ThreadLocal<>();
|
||||
private static final ThreadLocal<Deque> DEPTH_SIM = new ThreadLocal<>();
|
||||
private static final Comparator<Integer> PRIORITY_SORTER = ( o1, o2 ) -> ItemSorters.compareInt( o2, o1 );
|
||||
private static final Comparator<Integer> PRIORITY_SORTER = ( o1, o2 ) -> Integer.compare( o2, o1 );
|
||||
|
||||
private static int currentPass = 0;
|
||||
private final IStorageChannel<T> myChannel;
|
||||
|
||||
Reference in New Issue
Block a user