diff --git a/src/main/java/me/libraryaddict/disguise/DisguiseConfig.java b/src/main/java/me/libraryaddict/disguise/DisguiseConfig.java index c1b997f3..71225fcb 100644 --- a/src/main/java/me/libraryaddict/disguise/DisguiseConfig.java +++ b/src/main/java/me/libraryaddict/disguise/DisguiseConfig.java @@ -254,6 +254,12 @@ public class DisguiseConfig { } public static Entry getCustomDisguise(String disguise) { + if (!Bukkit.isPrimaryThread()) { + DisguiseUtilities.getLogger().warning( + "Custom Disguises should not be called async! This operation will become impossible in the " + + "future!"); + } + Entry entry = getRawCustomDisguise(disguise); if (entry == null) { @@ -273,6 +279,12 @@ public class DisguiseConfig { public static Entry getCustomDisguise(Entity target, String disguise) throws IllegalAccessException, DisguiseParseException, InvocationTargetException { + if (!Bukkit.isPrimaryThread()) { + DisguiseUtilities.getLogger().warning( + "Custom Disguises should not be called async! This operation will become impossible in the " + + "future!"); + } + Entry entry = getRawCustomDisguise(disguise); if (entry == null) { @@ -285,6 +297,12 @@ public class DisguiseConfig { public static Entry getCustomDisguise(CommandSender invoker, Entity target, String disguise) throws IllegalAccessException, DisguiseParseException, InvocationTargetException { + if (!Bukkit.isPrimaryThread()) { + DisguiseUtilities.getLogger().warning( + "Custom Disguises should not be called async! This operation will become impossible in the " + + "future!"); + } + Entry entry = getRawCustomDisguise(disguise); if (entry == null) { @@ -633,6 +651,12 @@ public class DisguiseConfig { } public static void addCustomDisguise(String disguiseName, String toParse) throws DisguiseParseException { + if (!Bukkit.isPrimaryThread()) { + DisguiseUtilities.getLogger().warning( + "Custom Disguises should not be called async! This operation will become impossible in the " + + "future!"); + } + if (getRawCustomDisguise(toParse) != null) { throw new DisguiseParseException(LibsMsg.CUSTOM_DISGUISE_NAME_CONFLICT, disguiseName); }