-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7b17191
commit 76e8ede
Showing
10 changed files
with
211 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 9 additions & 8 deletions
17
src/main/java/com/skellybuilds/SCMC/config/ModMenuConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
package com.skellybuilds.SCMC.config; | ||
|
||
import com.skellybuilds.SCMC.config.option.*; | ||
import net.minecraft.text.Text; | ||
|
||
import java.util.HashSet; | ||
|
||
|
||
public class ModMenuConfig { | ||
// Move default comments to langs? | ||
//public static final BooleanConfigOption ALLOWSERVERMODMENUCONNECTION = new BooleanConfigOption("allowservermodmenudownloads", true); | ||
public static final BooleanConfigOption USEONLYCLIENTMODS = new BooleanConfigOption("useonlyuniversalmods", true, "Universal mods basically are both client side & server side mods. So one for both! \n If you leave this enabled, server mods will not be used unless you specified otherwise"); | ||
public static final BooleanConfigOption CANKICKPLAYERSWITHNOMODS = new BooleanConfigOption("cankickplayerswithnomods", true, "This gives you the choice to allow the mod to kick players if they are missing a mod or otherwise \n If you choose false, it won't kick the player but notify the player about the missing mods so they can be aware!"); | ||
public static final StringSetConfigOption USETHISMODSONLY = new StringSetConfigOption("usethismodsonly", new HashSet<>(), "This is an array that will only use the mod ids provided for the mod, nothing else. \n If you leave it empty, All mods will be used by SCMC unless you configurated it otherwise"); | ||
public static final StringSetConfigOption DONTUSETHISMODS = new StringSetConfigOption("dontusethismods", new HashSet<>(), "This will basically blacklist a mod from being registered in SCMC, if you have it usethismods, the blacklist won't be checked since the whitelist is always checked first. "); | ||
public static final StringSetConfigOption USETHISMODS = new StringSetConfigOption("usethismods", new HashSet<>(), "This is basically an exception, which ignores everything and registers anyways, sort of like a whitelist"); | ||
public static final StringSetConfigOption OPTIONALMODS = new StringSetConfigOption("optionalmods", new HashSet<>(), "This list of mods won't be required to download, meaning they won't show up in the missing mod screen and there will be a GUI difference for the mod to clarify via servermodmenu"); | ||
public static final BooleanConfigOption USEONLYCLIENTMODS = new BooleanConfigOption("useonlyuniversalmods", true, Text.translatable("scmc.config.desc.useonlyuniversalmods").getString()); | ||
public static final BooleanConfigOption CANKICKPLAYERSWITHNOMODS = new BooleanConfigOption("cankickplayerswithnomods", true, Text.translatable("scmc.config.desc.cankickplayerswithnomods").getString()); | ||
public static final StringSetConfigOption USETHISMODSONLY = new StringSetConfigOption("usethismodsonly", new HashSet<>(), Text.translatable("scmc.config.desc.usethismodsonly").getString()); | ||
public static final StringSetConfigOption DONTUSETHISMODS = new StringSetConfigOption("dontusethismods", new HashSet<>(), Text.translatable("scmc.config.desc.dontusethismods").getString()); | ||
public static final StringSetConfigOption USETHISMODS = new StringSetConfigOption("usethismods", new HashSet<>(), Text.translatable("scmc.config.desc.useonlyuniversalmods").getString()); | ||
public static final StringSetConfigOption OPTIONALMODS = new StringSetConfigOption("optionalmods", new HashSet<>(), Text.translatable("scmc.config.desc.optionalmods").getString()); | ||
public static final IntConfigOption CPORT = new IntConfigOption("port", 27752, Text.translatable("scmc.config.desc.port").getString()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/main/java/com/skellybuilds/SCMC/config/option/IntConfigOption.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.skellybuilds.SCMC.config.option; | ||
|
||
|
||
public class IntConfigOption { | ||
private final String key; | ||
private final Integer defaultValue; | ||
private final String defaultComment; | ||
|
||
public IntConfigOption(String key, Integer defaultValue, String defaultComment) { | ||
ConfigOptionStorage.setInt(key, defaultValue); | ||
this.key = key; | ||
this.defaultValue = defaultValue; | ||
this.defaultComment = defaultComment; | ||
ConfigOptionStorage.setComment(key, defaultComment); | ||
} | ||
|
||
public IntConfigOption(String key, Integer defaultValue){this(key, defaultValue, "");} | ||
|
||
public String getKey() { | ||
return key; | ||
} | ||
|
||
public Integer getValue() { | ||
return ConfigOptionStorage.getInt(key); | ||
} | ||
|
||
public String getComment() {return ConfigOptionStorage.getComment(key); } // I don't know when i'll will use this but maybe some day it will be useful for experimenting | ||
|
||
public void setComment(String comment){ConfigOptionStorage.setComment(key, comment);} | ||
|
||
public void setValue(Integer value) { | ||
ConfigOptionStorage.setInt(key, value); | ||
} | ||
|
||
|
||
public Integer getDefaultValue() { | ||
return defaultValue; | ||
} | ||
|
||
public String getDefaultComment(){ return defaultComment; } | ||
|
||
|
||
|
||
|
||
|
||
} |
Oops, something went wrong.