Fix for sort error

This commit is contained in:
Raoul Van den Berge
2016-04-29 22:42:30 +02:00
parent a2e2a3a95e
commit ae5f390d18

View File

@@ -143,6 +143,10 @@ public class TileController extends TileBase implements IEnergyReceiver, INetwor
Collections.sort(storages, new Comparator<IStorage>() { Collections.sort(storages, new Comparator<IStorage>() {
@Override @Override
public int compare(IStorage s1, IStorage s2) { public int compare(IStorage s1, IStorage s2) {
if (s1.getPriority() == s2.getPriority()) {
return 0;
}
return (s1.getPriority() > s2.getPriority()) ? -1 : 1; return (s1.getPriority() > s2.getPriority()) ? -1 : 1;
} }
}); });