mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-12-12 11:10:29 +00:00
Sort the result of FileSystem.list
This ensures fs.list and fs.find always return the same result. For some reason, the ComputerCraft jar was being packaged differently on some platforms, causing files to appear in a different order. As computers depend on the colors API being loaded before colours, we need to ensure that they are loaded in a consistent order.
This commit is contained in:
parent
58e6e9ea46
commit
72dfb0e7cc
@ -10,7 +10,6 @@ import dan200.computercraft.api.filesystem.IMount;
|
||||
import dan200.computercraft.api.filesystem.IWritableMount;
|
||||
|
||||
import java.io.*;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.*;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@ -441,6 +440,7 @@ public class FileSystem
|
||||
// Return list
|
||||
String[] array = new String[ list.size() ];
|
||||
list.toArray(array);
|
||||
Arrays.sort( array );
|
||||
return array;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user