From abd54b013b3005784aea1300afef31c76987e1e2 Mon Sep 17 00:00:00 2001 From: noil Date: Sun, 14 Feb 2021 23:01:02 -0500 Subject: [PATCH] Fixes String value saving bug --- .../java/me/rigamortis/seppuku/impl/config/ModuleConfig.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/me/rigamortis/seppuku/impl/config/ModuleConfig.java b/src/main/java/me/rigamortis/seppuku/impl/config/ModuleConfig.java index 6b7d42b..d264249 100644 --- a/src/main/java/me/rigamortis/seppuku/impl/config/ModuleConfig.java +++ b/src/main/java/me/rigamortis/seppuku/impl/config/ModuleConfig.java @@ -61,6 +61,8 @@ public class ModuleConfig extends Configurable { } else if (val.getValue().getClass() == Integer.class) { val.setValue(entry.getValue().getAsInt()); } + } else if (val.getValue() instanceof String && !(val.getValue() instanceof Enum)) { + val.setValue(entry.getValue().getAsString()); } else if (val.getValue() instanceof Enum) { val.setEnumValue(entry.getValue().getAsString()); } else if (val.getValue() instanceof Color) { @@ -91,6 +93,8 @@ public class ModuleConfig extends Configurable { } else if (value.getValue().getClass() == Integer.class) { moduleJsonObject.addProperty(value.getName(), (Integer) value.getValue()); } + } else if (value.getValue() instanceof String && !(value.getValue() instanceof Enum)) { + moduleJsonObject.addProperty(value.getName(), (String) value.getValue()); } else if (value.getValue() instanceof Enum) { moduleJsonObject.addProperty(value.getName(), ((Enum) value.getValue()).name()); } else if (value.getValue() instanceof Color) {