fixing some serializer errors

This commit is contained in:
nossr50 2019-04-24 21:38:32 -07:00
parent 5fc416a457
commit 9d9b5464c3
4 changed files with 8 additions and 6 deletions

View File

@ -311,7 +311,7 @@ public final class ConfigManager {
DEFAULT_SERIALIZERS.registerType(TypeToken.of(Pattern.class), new PatternSerializer()); 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..."); mcMMO.p.getLogger().info("Registering custom type serializers for Configurate...");
customSerializers.registerType(new TypeToken<Material>() {}, new CustomEnumValueSerializer()); customSerializers.registerType(new TypeToken<Material>() {}, new CustomEnumValueSerializer());

View File

@ -56,7 +56,7 @@ public class SalvageableSerializer implements TypeSerializer<Salvageable> {
public void serialize(TypeToken<?> type, Salvageable obj, ConfigurationNode value) { public void serialize(TypeToken<?> type, Salvageable obj, ConfigurationNode value) {
value.getNode(ITEM_NODE_NAME).setValue(obj.getItemMaterial().getKey().toString()); 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(MAXIMUM_QUANTITY_RETURNED).setValue(obj.getMaximumQuantity());
value.getNode(OVERRIDE_LEVEL_REQUIREMENT).setValue(obj.getMinimumLevel()); value.getNode(OVERRIDE_LEVEL_REQUIREMENT).setValue(obj.getMinimumLevel());
} }

View File

@ -13,14 +13,14 @@ public class ConfigAcrobatics {
"\nSettings related to preventing abuse of this skill can be found in the anti_exploit config file.") "\nSettings related to preventing abuse of this skill can be found in the anti_exploit config file.")
private ConfigRoll roll = new ConfigRoll(); private ConfigRoll roll = new ConfigRoll();
public ConfigRoll getRoll() {
return roll;
}
@Setting(value = "Dodge", comment = "Settings related to the Dodge Sub-Skill." + @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.") "\nSettings related to preventing abuse of this skill can be found in the anti_exploit config file.")
private ConfigDodge dodge = new ConfigDodge(); private ConfigDodge dodge = new ConfigDodge();
public ConfigRoll getRoll() {
return roll;
}
public ConfigDodge getDodge() { public ConfigDodge getDodge() {
return dodge; return dodge;
} }

View File

@ -1,8 +1,10 @@
package com.gmail.nossr50.config.hocon.skills.salvage.general; package com.gmail.nossr50.config.hocon.skills.salvage.general;
import ninja.leaping.configurate.objectmapping.Setting; import ninja.leaping.configurate.objectmapping.Setting;
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
import org.bukkit.Material; import org.bukkit.Material;
@ConfigSerializable
public class ConfigSalvageGeneral { public class ConfigSalvageGeneral {
public static final boolean ANVIL_USE_SOUNDS_DEFAULT = true; public static final boolean ANVIL_USE_SOUNDS_DEFAULT = true;