mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-25 10:14:42 +02:00
feat: Add border bypass permission (#3302)
* Add border bypass permission - Fixes #3297 * Add permission to plots.admin permpack * Implement messages on leaving/entering border area * Rename to border.denied and make border msg red * change too le/ge as tthey are likely to be equal to border when hit. - Since we check for being across the border beforehand, it will hopefully not be spammed too much? - If it's spammed then either we use meta to set if a player's left the border, or we just remove the come-back-in altogether because it's a little looong
This commit is contained in:
@ -183,10 +183,12 @@ public class Claim extends SubCommand {
|
||||
);
|
||||
}
|
||||
}
|
||||
int border = area.getBorder();
|
||||
if (border != Integer.MAX_VALUE && plot.getDistanceFromOrigin() > border && !force) {
|
||||
player.sendMessage(TranslatableCaption.of("border.border"));
|
||||
return false;
|
||||
if (!Permissions.hasPermission(player, Permission.PERMISSION_ADMIN_BYPASS_BORDER)) {
|
||||
int border = area.getBorder();
|
||||
if (border != Integer.MAX_VALUE && plot.getDistanceFromOrigin() > border && !force) {
|
||||
player.sendMessage(TranslatableCaption.of("border.denied"));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
plot.setOwnerAbs(player.getUUID());
|
||||
final String finalSchematic = schematic;
|
||||
|
@ -274,7 +274,7 @@ public class MainCommand extends Command {
|
||||
}
|
||||
tp = true;
|
||||
} else {
|
||||
player.sendMessage(TranslatableCaption.of("border.border"));
|
||||
player.sendMessage(TranslatableCaption.of("border.denied"));
|
||||
}
|
||||
// Trim command
|
||||
args = Arrays.copyOfRange(args, 1, args.length);
|
||||
|
@ -204,7 +204,8 @@ public enum Permission {
|
||||
PERMISSION_ADMIN_DEBUG_OTHER("plots.admin.debug.other"),
|
||||
PERMISSION_RATE("plots.rate"),
|
||||
PERMISSION_ADMIN_FLIGHT("plots.admin.flight"),
|
||||
PERMISSION_ADMIN_COMPONENTS_OTHER("plots.admin.component.other");
|
||||
PERMISSION_ADMIN_COMPONENTS_OTHER("plots.admin.component.other"),
|
||||
PERMISSION_ADMIN_BYPASS_BORDER("plots.admin.border.bypass");
|
||||
//</editor-fold>
|
||||
|
||||
private final String text;
|
||||
|
@ -53,7 +53,9 @@
|
||||
"cluster.cluster_regenerated": "<prefix><dark_aqua>Successfully started cluster regeneration.</dark_aqua>",
|
||||
"cluster.cluster_teleporting": "<prefix><dark_aqua>Teleporting...</dark_aqua>",
|
||||
"cluster.cluster_info": "<prefix><gold>Current cluster: </gold><gray><id></gray>\n<gold>Name: </gold><gray><name></gray>\n<gold>Owner: </gold><gray><owner></gray>\n<gold>Size: </gold><gray><size></gray>\n<gold>Rights: </gold><gray><rights></gray>",
|
||||
"border.border": "<prefix><gray>You are outside the current map border.</gray>",
|
||||
"border.denied": "<prefix><red>You are outside the current map border.</red>",
|
||||
"border.bypass.exited": "<prefix><red>You have bypassed the current map border area.</red>",
|
||||
"border.bypass.entered": "<prefix><gray>You have re-entered the current map border area.</gray>",
|
||||
"worldedit.worldedit_bypass": "<prefix><gray><italic>To bypass your restrictions use </gray><dark_aqua><command></dark_aqua></italic>",
|
||||
"worldedit.worldedit_bypassed": "<prefix><gray>Currently bypassing WorldEdit restriction.</gray>",
|
||||
"gamemode.gamemode_was_bypassed": "<prefix><gold>You bypassed the gamemode (</gold><gray><gamemode></gray><gold>) <gold>set for </gold><gray><plot>.</gray>",
|
||||
|
Reference in New Issue
Block a user