This commit is contained in:
mfnalex 2019-05-03 04:03:53 +02:00
parent cc874d2796
commit 6ce0e98a58
4 changed files with 25 additions and 3 deletions

View File

@ -80,12 +80,16 @@ public class JeffChestSortOrganizer {
// Returns an array with all typematches listed in the category file
TypeMatchPositionPair[] loadCategoryFile(File file) throws FileNotFoundException {
// This is called "sticky" in the category files. When it is enabled, it has the same effect as when you set {keepCategoryOrder} in your sorting-method, but you can set it per category
boolean appendLineNumber = false;
Scanner sc = new Scanner(file);
List<TypeMatchPositionPair> lines = new ArrayList<TypeMatchPositionPair>();
short currentLine=1;
short currentLineNumber=1;
while (sc.hasNextLine()) {
lines.add(new TypeMatchPositionPair(sc.nextLine(),currentLine));
currentLine++;
String currentLine = sc.nextLine();
lines.add(new TypeMatchPositionPair(currentLine,currentLineNumber));
currentLineNumber++;
}
TypeMatchPositionPair[] result = lines.toArray(new TypeMatchPositionPair[0]);
sc.close();

View File

@ -0,0 +1,18 @@
#
# ChestSort Default Category File
#
# If you want to change this file, rename it.
# Please do NOT use file prefixed between 900 and 999 for
# your custom files because ChestSort will overwrite them
#
# When sticky is set to true, order the items in this
# category exactly as defined in this file.
# When set to false, the items are only grouped together
# and then sorted according to the other variables
# in your sorting-method
sticky=true
bow
*_sword
trident