Skip to content

Commit

Permalink
Fixed config file loading
Browse files Browse the repository at this point in the history
  • Loading branch information
legoraft committed Aug 17, 2024
1 parent 9422db9 commit b547117
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/survivaltweaks/config.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static void write(Properties properties) {
properties.setProperty("phantom_mobcap", Boolean.toString(PHANTOM_MOBCAP));
}

public void read(Properties properties) {
public static void read(Properties properties) {
SURVIVAL_DEBUG_STICK = Boolean.parseBoolean(properties.getProperty("survival_debug_stick"));
NO_EXPENSIVE = Boolean.parseBoolean(properties.getProperty("no_too_expensive"));
CHEAP_RENAME = Boolean.parseBoolean(properties.getProperty("cheap_rename"));
Expand Down Expand Up @@ -53,7 +53,7 @@ public static void save(Path configPath) {
}
}

public void load(Path configPath) {
public static void load(Path configPath) {
Properties properties = new Properties();
if (!Files.exists(configPath)) {
try {
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/survivaltweaks/survivalTweaks.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public void onInitialize() {
}

CONFIG_PATH = configDir.resolve("survivaltweaks.properties");
config.load(CONFIG_PATH);
}));

ServerWorldEvents.UNLOAD.register(((server, world) -> {
Expand Down

0 comments on commit b547117

Please sign in to comment.