aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/config
diff options
context:
space:
mode:
authorDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-06-14 20:21:25 +0200
committerDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-06-14 20:21:25 +0200
commitd5416f1442dc80c816ab8d76c8cceaf391d0f481 (patch)
tree1b3f004341365faa294b98afa7bbd2f4b9ec5482 /src/main/java/cc/polyfrost/oneconfig/config
parentb6fc6b825455bd2ea3237463044e4e6c53fa2c5a (diff)
downloadOneConfig-d5416f1442dc80c816ab8d76c8cceaf391d0f481.tar.gz
OneConfig-d5416f1442dc80c816ab8d76c8cceaf391d0f481.tar.bz2
OneConfig-d5416f1442dc80c816ab8d76c8cceaf391d0f481.zip
new sorting behavior
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/config')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/config/data/Mod.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/config/data/Mod.java b/src/main/java/cc/polyfrost/oneconfig/config/data/Mod.java
index ca931b7..bb3cccc 100644
--- a/src/main/java/cc/polyfrost/oneconfig/config/data/Mod.java
+++ b/src/main/java/cc/polyfrost/oneconfig/config/data/Mod.java
@@ -3,16 +3,17 @@ package cc.polyfrost.oneconfig.config.data;
import cc.polyfrost.oneconfig.config.Config;
import cc.polyfrost.oneconfig.config.elements.OptionPage;
import cc.polyfrost.oneconfig.config.migration.Migrator;
+import cc.polyfrost.oneconfig.internal.config.OneConfigConfig;
+import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-public class Mod {
+public class Mod implements Comparable<Mod> {
public final String name;
public final ModType modType;
public final String modIcon;
public final Migrator migrator;
public final OptionPage defaultPage;
public Config config;
- public boolean isShortCut = false;
/**
* @param name Friendly name of the mod
@@ -53,4 +54,13 @@ public class Mod {
public Mod(String name, ModType modType) {
this(name, modType, null, null);
}
+
+ @Override
+ public int compareTo(@NotNull Mod mod) {
+ int result = name.compareTo(mod.name);
+ //if (mod.modType != ModType.THIRD_PARTY) result *= 10;
+ //if (OneConfigConfig.favoriteMods.contains(name)) result *= 100;
+ System.out.println(name + " " + mod.name + " " + result);
+ return result;
+ }
}