Sfoglia il codice sorgente

More fixes for serializers

nossr50 5 anni fa
parent
commit
f0636ef47e

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

@@ -288,7 +288,7 @@ public final class ConfigManager {
     }
 
     private void registerSkillConfig(PrimarySkillType primarySkillType, Class clazz) {
-        skillConfigLoaders.put(primarySkillType, SkillConfigFactory.initSkillConfig(primarySkillType, clazz));
+        skillConfigLoaders.put(primarySkillType, SkillConfigFactory.initSkillConfig(pluginRef, primarySkillType, clazz));
     }
 
     /**

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

@@ -24,7 +24,7 @@ public class ItemStackSerializer implements TypeSerializer<MMOItem<?>> {
         Material itemMatch = Material.matchMaterial(itemIdentifier);
 
         if(itemMatch == null) {
-            pluginRef.getLogger().info("Could not find a match for "+itemIdentifier);
+            System.out.println("[mcMMO Deserializer Debug] Could not find a match for "+itemIdentifier);
             return null;
         }
 

+ 1 - 0
src/main/java/com/gmail/nossr50/config/hocon/serializers/RepairCostSerializer.java

@@ -6,6 +6,7 @@ import com.gmail.nossr50.skills.repair.SimpleRepairCost;
 import com.google.common.reflect.TypeToken;
 import ninja.leaping.configurate.ConfigurationNode;
 import ninja.leaping.configurate.objectmapping.ObjectMappingException;
+import ninja.leaping.configurate.objectmapping.serialize.TypeSerializer;
 import org.checkerframework.checker.nullness.qual.NonNull;
 import org.checkerframework.checker.nullness.qual.Nullable;
 

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

@@ -30,7 +30,7 @@ public class SkillRankPropertySerializer implements TypeSerializer<SkillRankProp
             retroHashMap = new HashMap<>(retroMap);
 
         } catch (ObjectMappingException e) {
-            pluginRef.getLogger().severe("Unable to deserialize rank property information from the config, make sure the ranks are correctly set in the config. You can delete the rank config to generate a new one if problems persist.");
+            System.out.println("[mcMMO Deserializer Debug] Unable to deserialize rank property information from the config, make sure the ranks are correctly set in the config. You can delete the rank config to generate a new one if problems persist.");
             throw e;
         }
 

+ 1 - 1
src/main/java/com/gmail/nossr50/mcMMO.java

@@ -166,7 +166,7 @@ public class mcMMO extends JavaPlugin {
             databaseManager = getDatabaseManagerFactory().getDatabaseManager();
 
             //Check for the newer API and tell them what to do if its missing
-            CompatibilityCheck.checkForOutdatedAPI(serverAPIOutdated, getServerSoftwareStr());
+            CompatibilityCheck.checkForOutdatedAPI(this, serverAPIOutdated, getServerSoftwareStr());
 
             if (serverAPIOutdated) {
                 Bukkit

+ 3 - 1
src/main/java/com/gmail/nossr50/util/CompatibilityCheck.java

@@ -1,12 +1,14 @@
 package com.gmail.nossr50.util;
 
+import com.gmail.nossr50.mcMMO;
+
 import java.lang.reflect.Method;
 
 public class CompatibilityCheck {
     /**
      * Uses reflection to check for incompatible server software
      */
-    public static void checkForOutdatedAPI(boolean serverAPIOutdated, String software) {
+    public static void checkForOutdatedAPI(mcMMO pluginRef, boolean serverAPIOutdated, String software) {
         try {
             Class<?> checkForClass = Class.forName("org.bukkit.event.block.BlockDropItemEvent");
             Method newerAPIMethod = checkForClass.getMethod("getItems");