Warn about illegal async operations

This commit is contained in:
libraryaddict 2020-03-25 15:52:23 +13:00
parent a598884def
commit 203f2adeb5
No known key found for this signature in database
GPG Key ID: 052E4FBCD257AEA4

View File

@ -571,6 +571,11 @@ public class DisguiseParser {
public static Disguise parseDisguise(CommandSender sender, Entity target, String permNode, String[] args,
DisguisePermissions permissions) throws DisguiseParseException, IllegalAccessException,
InvocationTargetException {
if (!Bukkit.isPrimaryThread()) {
DisguiseUtilities.getLogger().warning(
"DisguiseParser should not be called async! This operation will become impossible in the future!");
}
if (sender instanceof Player) {
DisguiseUtilities.setCommandsUsed();
}