Browse Source

fixing some serializer errors

nossr50 6 years ago
parent
commit
9d9b5464c3

+ 1 - 1
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<Material>() {}, new CustomEnumValueSerializer());

+ 1 - 1
src/main/java/com/gmail/nossr50/config/hocon/SalvageableSerializer.java

@@ -56,7 +56,7 @@ public class SalvageableSerializer implements TypeSerializer<Salvageable> {
     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());
     }

+ 4 - 4
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;
     }

+ 2 - 0
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;