Changed resource settings to not use dot

This commit is contained in:
Risto Lahtela 2020-03-19 18:14:45 +02:00
parent dae96ef53d
commit 7860557a2d

View File

@ -16,6 +16,8 @@
*/ */
package com.djrapitops.plan.settings.config; package com.djrapitops.plan.settings.config;
import org.apache.commons.lang3.StringUtils;
import java.io.IOException; import java.io.IOException;
import java.io.UncheckedIOException; import java.io.UncheckedIOException;
@ -32,10 +34,11 @@ public class ResourceSettings {
public boolean shouldBeCustomized(String plugin, String fileName) { public boolean shouldBeCustomized(String plugin, String fileName) {
ConfigNode fileCustomization = config.getNode("Customized_files").orElseGet(() -> config.addNode("Customized_files")); ConfigNode fileCustomization = config.getNode("Customized_files").orElseGet(() -> config.addNode("Customized_files"));
ConfigNode pluginCustomization = fileCustomization.getNode(plugin).orElseGet(() -> fileCustomization.addNode(plugin)); ConfigNode pluginCustomization = fileCustomization.getNode(plugin).orElseGet(() -> fileCustomization.addNode(plugin));
if (pluginCustomization.contains(fileName)) { String fileNameNonPath = StringUtils.replaceChars(fileName, '.', ',');
return pluginCustomization.getBoolean(fileName); if (pluginCustomization.contains(fileNameNonPath)) {
return pluginCustomization.getBoolean(fileNameNonPath);
} else { } else {
pluginCustomization.set(fileName, false); pluginCustomization.set(fileNameNonPath, false);
try { try {
pluginCustomization.save(); pluginCustomization.save();
} catch (IOException e) { } catch (IOException e) {