From 9d9b5464c3a3ef64b26d17ecddc3d4a89dcc411d Mon Sep 17 00:00:00 2001 From: nossr50 Date: Wed, 24 Apr 2019 21:38:32 -0700 Subject: [PATCH] fixing some serializer errors --- src/main/java/com/gmail/nossr50/config/ConfigManager.java | 2 +- .../gmail/nossr50/config/hocon/SalvageableSerializer.java | 2 +- .../config/hocon/skills/acrobatics/ConfigAcrobatics.java | 8 ++++---- .../skills/salvage/general/ConfigSalvageGeneral.java | 2 ++ 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/config/ConfigManager.java b/src/main/java/com/gmail/nossr50/config/ConfigManager.java index 7f2079127..e79012b27 100644 --- a/src/main/java/com/gmail/nossr50/config/ConfigManager.java +++ b/src/main/java/com/gmail/nossr50/config/ConfigManager.java @@ -311,7 +311,7 @@ public final class ConfigManager { DEFAULT_SERIALIZERS.registerType(TypeToken.of(Pattern.class), new PatternSerializer()); */ - customSerializers = TypeSerializers.newCollection(); + customSerializers = TypeSerializers.getDefaultSerializers().newChild(); mcMMO.p.getLogger().info("Registering custom type serializers for Configurate..."); customSerializers.registerType(new TypeToken() {}, new CustomEnumValueSerializer()); diff --git a/src/main/java/com/gmail/nossr50/config/hocon/SalvageableSerializer.java b/src/main/java/com/gmail/nossr50/config/hocon/SalvageableSerializer.java index e0941e7f6..4e9d28bbb 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/SalvageableSerializer.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/SalvageableSerializer.java @@ -56,7 +56,7 @@ public class SalvageableSerializer implements TypeSerializer { public void serialize(TypeToken type, Salvageable obj, ConfigurationNode value) { value.getNode(ITEM_NODE_NAME).setValue(obj.getItemMaterial().getKey().toString()); - value.getNode(ITEM_RETURNED_BY_SALVAGE).setValue(obj.getSalvagedItemMaterial()); + value.getNode(ITEM_RETURNED_BY_SALVAGE).setValue(obj.getSalvagedItemMaterial().getKey().toString()); value.getNode(MAXIMUM_QUANTITY_RETURNED).setValue(obj.getMaximumQuantity()); value.getNode(OVERRIDE_LEVEL_REQUIREMENT).setValue(obj.getMinimumLevel()); } diff --git a/src/main/java/com/gmail/nossr50/config/hocon/skills/acrobatics/ConfigAcrobatics.java b/src/main/java/com/gmail/nossr50/config/hocon/skills/acrobatics/ConfigAcrobatics.java index 8f69f633f..cb751b75c 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/skills/acrobatics/ConfigAcrobatics.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/skills/acrobatics/ConfigAcrobatics.java @@ -13,14 +13,14 @@ public class ConfigAcrobatics { "\nSettings related to preventing abuse of this skill can be found in the anti_exploit config file.") private ConfigRoll roll = new ConfigRoll(); - public ConfigRoll getRoll() { - return roll; - } - @Setting(value = "Dodge", comment = "Settings related to the Dodge Sub-Skill." + "\nSettings related to preventing abuse of this skill can be found in the anti_exploit config file.") private ConfigDodge dodge = new ConfigDodge(); + public ConfigRoll getRoll() { + return roll; + } + public ConfigDodge getDodge() { return dodge; } diff --git a/src/main/java/com/gmail/nossr50/config/hocon/skills/salvage/general/ConfigSalvageGeneral.java b/src/main/java/com/gmail/nossr50/config/hocon/skills/salvage/general/ConfigSalvageGeneral.java index c45911ed7..c68cefb41 100644 --- a/src/main/java/com/gmail/nossr50/config/hocon/skills/salvage/general/ConfigSalvageGeneral.java +++ b/src/main/java/com/gmail/nossr50/config/hocon/skills/salvage/general/ConfigSalvageGeneral.java @@ -1,8 +1,10 @@ package com.gmail.nossr50.config.hocon.skills.salvage.general; import ninja.leaping.configurate.objectmapping.Setting; +import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable; import org.bukkit.Material; +@ConfigSerializable public class ConfigSalvageGeneral { public static final boolean ANVIL_USE_SOUNDS_DEFAULT = true;