Fixed "island.maxhomes" permission not being appended with the addon's permission prefix

This may help for #256.
This commit is contained in:
Florian CUNY 2018-10-20 11:45:41 +02:00
parent 95bfab916e
commit 5391544e9c
2 changed files with 2 additions and 2 deletions

View File

@ -33,7 +33,7 @@ public class IslandGoCommand extends CompositeCommand {
} }
if (!args.isEmpty() && NumberUtils.isDigits(args.get(0))) { if (!args.isEmpty() && NumberUtils.isDigits(args.get(0))) {
int homeValue = Integer.parseInt(args.get(0)); int homeValue = Integer.parseInt(args.get(0));
int maxHomes = user.getPermissionValue("island.maxhomes", getIWM().getMaxHomes(getWorld())); int maxHomes = user.getPermissionValue(getPermissionPrefix() + "island.maxhomes", getIWM().getMaxHomes(getWorld()));
if (homeValue > 1 && homeValue <= maxHomes) { if (homeValue > 1 && homeValue <= maxHomes) {
getIslands().homeTeleport(getWorld(), user.getPlayer(), homeValue); getIslands().homeTeleport(getWorld(), user.getPlayer(), homeValue);
user.sendMessage("commands.island.go.tip", TextVariables.LABEL, getTopLabel()); user.sendMessage("commands.island.go.tip", TextVariables.LABEL, getTopLabel());

View File

@ -39,7 +39,7 @@ public class IslandSethomeCommand extends CompositeCommand {
user.sendMessage("commands.island.sethome.home-set"); user.sendMessage("commands.island.sethome.home-set");
} else { } else {
// Dynamic home sizes with permissions // Dynamic home sizes with permissions
int maxHomes = user.getPermissionValue("island.maxhomes", getIWM().getMaxHomes(getWorld())); int maxHomes = user.getPermissionValue(getPermissionPrefix() + "island.maxhomes", getIWM().getMaxHomes(getWorld()));
if (maxHomes > 1) { if (maxHomes > 1) {
// Check the number given is a number // Check the number given is a number
int number; int number;