mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-26 15:03:04 +00:00
Fix java 8u20. Closes #501 and a bunch of other bugs too.
This commit is contained in:
1 parent
bd8bd65ca1
commit
70c115588c
1 file changed
+9
-1
@@ -534,7 +534,10 @@ public class CoreModManager {
|
||||
{
|
||||
@SuppressWarnings("unchecked")
|
||||
List<ITweaker> tweakers = (List<ITweaker>) Launch.blackboard.get("Tweaks");
|
||||
Collections.sort(tweakers, new Comparator<ITweaker>() {
|
||||
// Basically a copy of Collections.sort pre 8u20, optimized as we know we're an array list.
|
||||
// Thanks unhelpful fixer of http://bugs.java.com/view_bug.do?bug_id=8032636
|
||||
ITweaker[] toSort = tweakers.toArray(new ITweaker[tweakers.size()]);
|
||||
Arrays.sort(toSort, new Comparator<ITweaker>() {
|
||||
@Override
|
||||
public int compare(ITweaker o1, ITweaker o2)
|
||||
{
|
||||
@@ -577,6 +580,11 @@ public class CoreModManager {
|
||||
return Ints.saturatedCast((long)first - (long)second);
|
||||
}
|
||||
});
|
||||
// Basically a copy of Collections.sort, optimized as we know we're an array list.
|
||||
// Thanks unhelpful fixer of http://bugs.java.com/view_bug.do?bug_id=8032636
|
||||
for (int j = 0; j < toSort.length; j++) {
|
||||
tweakers.set(j, toSort[j]);
|
||||
}
|
||||
}
|
||||
|
||||
public static List<String> getAccessTransformers()
|
||||
|
||||
Reference in new issue
Block a user