diff options
author | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-05-24 18:15:49 +0200 |
---|---|---|
committer | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-05-24 18:15:49 +0200 |
commit | d69b634615134e294c4eee45827adc1eb73514b9 (patch) | |
tree | 8f3f6059d423a24fd25643c7cdb975ddafda1d12 /src/main/java/cc/polyfrost/oneconfig/config/data/Mod.java | |
parent | 4b0c40c93658fd871876effa371ad9159845293d (diff) | |
download | OneConfig-d69b634615134e294c4eee45827adc1eb73514b9.tar.gz OneConfig-d69b634615134e294c4eee45827adc1eb73514b9.tar.bz2 OneConfig-d69b634615134e294c4eee45827adc1eb73514b9.zip |
OC-23 finish migration system
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/config/data/Mod.java')
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/config/data/Mod.java | 35 |
1 files changed, 27 insertions, 8 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 da069c5..7849124 100644 --- a/src/main/java/cc/polyfrost/oneconfig/config/data/Mod.java +++ b/src/main/java/cc/polyfrost/oneconfig/config/data/Mod.java @@ -1,36 +1,55 @@ package cc.polyfrost.oneconfig.config.data; import cc.polyfrost.oneconfig.config.interfaces.Config; +import cc.polyfrost.oneconfig.config.migration.Migrator; import org.jetbrains.annotations.Nullable; -import java.util.ArrayList; -import java.util.Objects; - public class Mod { public final String name; public final ModType modType; public final String modIcon; + public final Migrator migrator; public Config config; public final OptionPage defaultPage; public boolean isShortCut = false; /** - * @param name Friendly name of the mod - * @param modType Type of the mod (for example ModType.QOL) - * @param modIcon path to icon of the mod (png or svg format) + * @param name Friendly name of the mod + * @param modType Type of the mod (for example ModType.QOL) + * @param modIcon Path to icon of the mod (png or svg format) + * @param migrator Migrator class to port the old config */ - public Mod(String name, ModType modType, @Nullable String modIcon) { + public Mod(String name, ModType modType, @Nullable String modIcon, @Nullable Migrator migrator) { this.name = name; this.modType = modType; this.modIcon = modIcon; + this.migrator = migrator; this.defaultPage = new OptionPage(name, this); } /** * @param name Friendly name of the mod * @param modType Type of the mod (for example ModType.QOL) + * @param modIcon path to icon of the mod (png or svg format) + */ + public Mod(String name, ModType modType, @Nullable String modIcon) { + this(name, modType, modIcon, null); + } + + /** + * @param name Friendly name of the mod + * @param modType Type of the mod (for example ModType.QOL) + * @param migrator Migrator class to port the old config + */ + public Mod(String name, ModType modType, @Nullable Migrator migrator) { + this(name, modType, null, migrator); + } + + /** + * @param name Friendly name of the mod + * @param modType Type of the mod (for example ModType.QOL) */ public Mod(String name, ModType modType) { - this(name, modType, null); + this(name, modType, null, null); } } |