mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-08 17:58:39 +07:00
Comparator cleanup
This commit is contained in:
parent
16f4e300a8
commit
b6acf1af0a
@ -138,10 +138,10 @@ public class Unloader extends Block{
|
||||
}
|
||||
|
||||
//sort so it gives full priority to blocks that can give but not receive (stackConveyors and Storage), and then by load
|
||||
possibleBlocks.sort((e1, e2) -> {
|
||||
int getsPriority = Boolean.compare((e1.building.block instanceof StorageBlock || e1.building.block instanceof StackConveyor), (e2.building.block instanceof StorageBlock || e2.building.block instanceof StackConveyor));
|
||||
return (getsPriority != 0) ? getsPriority : Float.compare(e1.loadFactor, e2.loadFactor);
|
||||
});
|
||||
possibleBlocks.sort(Structs.comps(
|
||||
Structs.comparingBool(e -> e.building.block instanceof StorageBlock || e.building.block instanceof StackConveyor),
|
||||
Structs.comparingFloat(e -> e.loadFactor)
|
||||
));
|
||||
|
||||
ContainerStat dumpingFrom = null;
|
||||
ContainerStat dumpingTo = null;
|
||||
|
Loading…
Reference in New Issue
Block a user