mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 06:36:45 +01:00
More fixes for serializers
This commit is contained in:
parent
68f6fea66a
commit
f0636ef47e
@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user