Skip to content
This repository has been archived by the owner on Sep 7, 2024. It is now read-only.

Commit

Permalink
Add setting for ITweaker
Browse files Browse the repository at this point in the history
  • Loading branch information
wohaopa committed Sep 6, 2024
1 parent 9ba7ac5 commit 19516be
Show file tree
Hide file tree
Showing 16 changed files with 110 additions and 383 deletions.
38 changes: 38 additions & 0 deletions src/main/java/com/github/wohaopa/GTNHModify/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,44 @@ private static void loadConfig() {
for (Tweakers tweaker : Tweakers.values()) {
tweaker.enabled = config
.getBoolean(tweaker.name, Configuration.CATEGORY_GENERAL, false, tweaker.description);
if (tweaker.setting != null) {
if (tweaker.setting instanceof String) {
tweaker.setting = config.getString(
tweaker.name + "_setting",
Configuration.CATEGORY_GENERAL,
(String) tweaker.setting,
tweaker.description);
} else if (tweaker.setting instanceof Boolean) {
tweaker.setting = config.getBoolean(
tweaker.name + "_setting",
Configuration.CATEGORY_GENERAL,
(Boolean) tweaker.setting,
tweaker.description);
} else if (tweaker.setting instanceof Integer) {
tweaker.setting = config.getInt(
tweaker.name + "_setting",
Configuration.CATEGORY_GENERAL,
(int) tweaker.setting,
Integer.MIN_VALUE,
Integer.MAX_VALUE,
tweaker.description);
} else if (tweaker.setting instanceof String[]) {
tweaker.setting = config.getStringList(
tweaker.name + "_setting",
Configuration.CATEGORY_GENERAL,
(String[]) tweaker.setting,
tweaker.description);
} else if (tweaker.setting instanceof Float) {
tweaker.setting = config.getFloat(
tweaker.name + "_setting",
Configuration.CATEGORY_GENERAL,
(Float) tweaker.setting,
Float.MIN_VALUE,
Float.MAX_VALUE,
tweaker.description);
}

}
}

if (config.hasChanged() || doSave) {
Expand Down

This file was deleted.

This file was deleted.

141 changes: 0 additions & 141 deletions src/main/java/com/github/wohaopa/GTNHModify/strategies/OneTick.java

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 19516be

Please sign in to comment.