mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
When choosing adapters, allow ones that aren't best, but prioritize best.
This commit is contained in:
parent
9f24f84c2b
commit
04d4e89541
@ -21,7 +21,6 @@ package com.sk89q.worldedit.sponge.adapter;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.sk89q.worldedit.util.io.Closer;
|
||||
import org.spongepowered.api.Sponge;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@ -180,7 +179,14 @@ public class SpongeImplLoader {
|
||||
if (suitableAdapters.size() == 1) {
|
||||
return suitableAdapters.get(0);
|
||||
} else {
|
||||
return suitableAdapters.stream().filter(SpongeImplAdapter::isBest).findFirst().orElse(suitableAdapters.get(0));
|
||||
return suitableAdapters.stream().sorted((o1, o2) -> {
|
||||
if (o1.isBest() && !o2.isBest()) {
|
||||
return -1;
|
||||
} else if (!o1.isBest() && o2.isBest()) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}).findFirst().orElse(suitableAdapters.get(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user