Fix bad load order

This commit is contained in:
libraryaddict 2023-11-15 20:29:28 +13:00
parent e8b6f7a8e6
commit d14fb65959
2 changed files with 4 additions and 5 deletions

View File

@ -14,6 +14,7 @@ import me.libraryaddict.disguise.utilities.packets.PacketsManager;
import me.libraryaddict.disguise.utilities.parser.DisguiseParseException; import me.libraryaddict.disguise.utilities.parser.DisguiseParseException;
import me.libraryaddict.disguise.utilities.parser.DisguiseParser; import me.libraryaddict.disguise.utilities.parser.DisguiseParser;
import me.libraryaddict.disguise.utilities.parser.DisguisePerm; import me.libraryaddict.disguise.utilities.parser.DisguisePerm;
import me.libraryaddict.disguise.utilities.parser.DisguisePermissions;
import me.libraryaddict.disguise.utilities.reflection.NmsVersion; import me.libraryaddict.disguise.utilities.reflection.NmsVersion;
import me.libraryaddict.disguise.utilities.reflection.ReflectionManager; import me.libraryaddict.disguise.utilities.reflection.ReflectionManager;
import me.libraryaddict.disguise.utilities.translations.LibsMsg; import me.libraryaddict.disguise.utilities.translations.LibsMsg;
@ -969,6 +970,8 @@ public class DisguiseConfig {
} }
DisguiseUtilities.getLogger().info("Loaded " + customDisguises.size() + " custom disguise" + (customDisguises.size() == 1 ? "" : "s")); DisguiseUtilities.getLogger().info("Loaded " + customDisguises.size() + " custom disguise" + (customDisguises.size() == 1 ? "" : "s"));
// Reload the permissions here because otherwise our cached permissions doesn't know about the custom disguises
DisguisePermissions.onReload();
} }
public static void addCustomDisguise(String disguiseName, String toParse) throws DisguiseParseException { public static void addCustomDisguise(String disguiseName, String toParse) throws DisguiseParseException {

View File

@ -125,7 +125,7 @@ public class DisguisePermissions {
public static DisguisePermissions getPermissions(Permissible permissionHolder, String commandName) { public static DisguisePermissions getPermissions(Permissible permissionHolder, String commandName) {
if (permissionHolder == Bukkit.getConsoleSender() && CONSOLE_PERMISSIONS.containsKey(commandName)) { if (permissionHolder == Bukkit.getConsoleSender() && CONSOLE_PERMISSIONS.containsKey(commandName)) {
// return CONSOLE_PERMISSIONS.get(commandName); return CONSOLE_PERMISSIONS.get(commandName);
} }
return new DisguisePermissions(permissionHolder, commandName); return new DisguisePermissions(permissionHolder, commandName);
@ -539,10 +539,6 @@ public class DisguisePermissions {
} }
public boolean isAllowedDisguise(DisguisePerm disguisePerm) { public boolean isAllowedDisguise(DisguisePerm disguisePerm) {
if (this == Bukkit.getConsoleSender()) {
return true;
}
return getStorage(disguisePerm) != null; return getStorage(disguisePerm) != null;
} }