mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 21:26:45 +01:00
Probably fixes #1953
This commit is contained in:
parent
550df7f232
commit
40635255e3
@ -15,6 +15,7 @@ import org.bukkit.event.EventException;
|
|||||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.bukkit.permissions.PermissionAttachmentInfo;
|
import org.bukkit.permissions.PermissionAttachmentInfo;
|
||||||
@ -122,7 +123,9 @@ public class BukkitPlayer extends PlotPlayer {
|
|||||||
}
|
}
|
||||||
int max = 0;
|
int max = 0;
|
||||||
String stubPlus = stub + ".";
|
String stubPlus = stub + ".";
|
||||||
for (PermissionAttachmentInfo attach : player.getEffectivePermissions()) {
|
Set<PermissionAttachmentInfo> effective = player.getEffectivePermissions();
|
||||||
|
if (!effective.isEmpty()) {
|
||||||
|
for (PermissionAttachmentInfo attach : effective) {
|
||||||
String perm = attach.getPermission();
|
String perm = attach.getPermission();
|
||||||
if (perm.startsWith(stubPlus)) {
|
if (perm.startsWith(stubPlus)) {
|
||||||
String end = perm.substring(stubPlus.length());
|
String end = perm.substring(stubPlus.length());
|
||||||
@ -133,6 +136,13 @@ public class BukkitPlayer extends PlotPlayer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
for (int i = range; i > 0; i--) {
|
||||||
|
if (hasPermission(stub + "." + i)) {
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return max;
|
return max;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
package com.intellectualcrafters.plot.commands;
|
package com.intellectualcrafters.plot.commands;
|
||||||
|
|
||||||
import com.google.common.base.Optional;
|
import com.google.common.base.Optional;
|
||||||
|
import com.intellectualcrafters.plot.PS;
|
||||||
import com.intellectualcrafters.plot.config.C;
|
import com.intellectualcrafters.plot.config.C;
|
||||||
|
import com.intellectualcrafters.plot.config.Settings;
|
||||||
import com.intellectualcrafters.plot.database.DBFunc;
|
import com.intellectualcrafters.plot.database.DBFunc;
|
||||||
import com.intellectualcrafters.plot.flag.Flag;
|
import com.intellectualcrafters.plot.flag.Flag;
|
||||||
import com.intellectualcrafters.plot.flag.FlagManager;
|
import com.intellectualcrafters.plot.flag.FlagManager;
|
||||||
@ -37,7 +39,8 @@ public class FlagCmd extends SubCommand {
|
|||||||
try {
|
try {
|
||||||
int numeric = Integer.parseInt(value);
|
int numeric = Integer.parseInt(value);
|
||||||
perm.substring(0, perm.length() - value.length() - 1);
|
perm.substring(0, perm.length() - value.length() - 1);
|
||||||
return player.hasPermissionRange(perm, numeric) >= numeric;
|
int checkRange = PS.get().getPlatform().equalsIgnoreCase("bukkit") ? numeric : Settings.Limit.MAX_PLOTS;
|
||||||
|
return player.hasPermissionRange(perm, checkRange) >= numeric;
|
||||||
|
|
||||||
} catch (NumberFormatException ignore) {}
|
} catch (NumberFormatException ignore) {}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user