diff --git a/src/main/java/kamkeel/npcs/controllers/ProfileController.java b/src/main/java/kamkeel/npcs/controllers/ProfileController.java index 6c657b70c..cf8a34928 100644 --- a/src/main/java/kamkeel/npcs/controllers/ProfileController.java +++ b/src/main/java/kamkeel/npcs/controllers/ProfileController.java @@ -434,7 +434,7 @@ public class ProfileController implements IProfileHandler { } if (profile.player != null) { if (ConfigMain.RegionProfileSwitching) { - boolean allowed = hasPermission(profile.player, PROFILE_REGION_BYPASS); + boolean allowed = hasCustomPermission(profile.player, PROFILE_REGION_BYPASS.name); if (!allowed) { int playerDim = profile.player.dimension; int playerX = (int) profile.player.posX; @@ -676,8 +676,8 @@ public class ProfileController implements IProfileHandler { highestAllowed = i; } } - if (highestAllowed == 0) { - highestAllowed = 1; + if (highestAllowed == 0 || highestAllowed < ConfigMain.DefaultProfileSlots) { + highestAllowed = ConfigMain.DefaultProfileSlots; } return currentSlots < highestAllowed; } diff --git a/src/main/java/noppes/npcs/CustomNpcsPermissions.java b/src/main/java/noppes/npcs/CustomNpcsPermissions.java index a41e4a7d8..3363c0351 100644 --- a/src/main/java/noppes/npcs/CustomNpcsPermissions.java +++ b/src/main/java/noppes/npcs/CustomNpcsPermissions.java @@ -150,11 +150,14 @@ public class CustomNpcsPermissions { } public static boolean hasCustomPermission(EntityPlayer player, String permission) { - if (Developer.Instance.hasUniversal(player.getUniqueID())) { - return true; - } - if (Instance.bukkit != null) { - return Instance.bukkitPermission(player.getCommandSenderName(), permission); + if (player != null) { + if (FMLCommonHandler.instance().getSide() == Side.SERVER && NoppesUtilServer.isOp(player)) + return true; + if (Developer.Instance.hasUniversal(player.getUniqueID())) + return true; + if (Instance.bukkit != null) { + return Instance.bukkitPermission(player.getCommandSenderName(), permission); + } } return false; } diff --git a/src/main/java/noppes/npcs/config/ConfigMain.java b/src/main/java/noppes/npcs/config/ConfigMain.java index 46c6aee63..c53d3c91b 100644 --- a/src/main/java/noppes/npcs/config/ConfigMain.java +++ b/src/main/java/noppes/npcs/config/ConfigMain.java @@ -21,7 +21,6 @@ public class ConfigMain { public final static String PARTY = "PARTY"; public final static String PROFILES = "Profile"; public final static String ATTRIBUTES = "Attributes"; - public final static String ITEM = "Item"; /** * General Main Properties @@ -94,6 +93,8 @@ public class ConfigMain { public static Property RestrictedProfileRegionsProperty; public static List> RestrictedProfileRegions = new ArrayList<>(); + public static int DefaultProfileSlots = 5; + /** * General NPC Properties @@ -234,6 +235,8 @@ public class ConfigMain { "1, 50, 60, 50, 150, 75, 150" }, "List of restricted regions where profile switching is enabled. Format: DIM, X1, Y1, Z1, X2, Y2, Z2"); + DefaultProfileSlots = config.get(PROFILES, "Default Profile Slots", 5, "This is the default amount without any permission handling").getInt(5); + RestrictedProfileRegions.clear(); for (String region : RestrictedProfileRegionsProperty.getStringList()) { String[] parts = region.split(", ");