mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-03 22:16:34 +00:00
Add permission node for /delhome all and /delwarp all
Signed-off-by: BuildTools <[email protected]>
This commit is contained in:
1 parent
280a37ef5b
commit
77ed1a307e
4 files changed
+25
-3
No files matched your search
@@ -15,7 +15,11 @@ public class DelHomeCommand extends CommandBase {
|
|||||||
return;
|
return;
|
||||||
} else if (args.length == 2) {
|
} else if (args.length == 2) {
|
||||||
if (args[0].equalsIgnoreCase("all") && args[1].equalsIgnoreCase("confirm")) {
|
if (args[0].equalsIgnoreCase("all") && args[1].equalsIgnoreCase("confirm")) {
|
||||||
SettingHandler.deleteAllHomes(p);
|
if (p.hasPermission("huskhomes.delhome.all")) {
|
||||||
|
SettingHandler.deleteAllHomes(p);
|
||||||
|
} else {
|
||||||
|
MessageManager.sendMessage(p, "error_no_permission");
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,11 @@ public class DelWarpCommand extends CommandBase {
|
|||||||
return;
|
return;
|
||||||
} else if (args.length == 2) {
|
} else if (args.length == 2) {
|
||||||
if (args[0].equalsIgnoreCase("all") && args[1].equalsIgnoreCase("confirm")) {
|
if (args[0].equalsIgnoreCase("all") && args[1].equalsIgnoreCase("confirm")) {
|
||||||
SettingHandler.deleteAllWarps(p);
|
if (p.hasPermission("huskhomes.delwarp.all")) {
|
||||||
|
SettingHandler.deleteAllWarps(p);
|
||||||
|
} else {
|
||||||
|
MessageManager.sendMessage(p, "error_no_permission");
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -214,6 +214,10 @@ public class SettingHandler {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (homeName.equalsIgnoreCase("all")) {
|
if (homeName.equalsIgnoreCase("all")) {
|
||||||
|
if (!player.hasPermission("huskhomes.delhome.all")) {
|
||||||
|
MessageManager.sendMessage(player, "error_no_permission");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (DataManager.getPlayerHomes(player.getName(), connection).size() == 0) {
|
if (DataManager.getPlayerHomes(player.getName(), connection).size() == 0) {
|
||||||
MessageManager.sendMessage(player, "error_no_homes_set");
|
MessageManager.sendMessage(player, "error_no_homes_set");
|
||||||
return;
|
return;
|
||||||
@@ -278,6 +282,10 @@ public class SettingHandler {
|
|||||||
WarpCommand.Tab.updateWarpsTabCache();
|
WarpCommand.Tab.updateWarpsTabCache();
|
||||||
} else {
|
} else {
|
||||||
if (warpName.equalsIgnoreCase("all")) {
|
if (warpName.equalsIgnoreCase("all")) {
|
||||||
|
if (!player.hasPermission("huskhomes.delwarp.all")) {
|
||||||
|
MessageManager.sendMessage(player, "error_no_permission");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (DataManager.getWarps(connection).size() == 0) {
|
if (DataManager.getWarps(connection).size() == 0) {
|
||||||
MessageManager.sendMessage(player, "error_no_warps_set");
|
MessageManager.sendMessage(player, "error_no_warps_set");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -180,6 +180,9 @@ permissions:
|
|||||||
huskhomes.delhome:
|
huskhomes.delhome:
|
||||||
description: Allows you to delete a home
|
description: Allows you to delete a home
|
||||||
default: true
|
default: true
|
||||||
|
huskhomes.delhome.all:
|
||||||
|
description: Allows you to delete all your homes
|
||||||
|
default: true
|
||||||
huskhomes.warp:
|
huskhomes.warp:
|
||||||
description: Allows you to teleport to a warp
|
description: Allows you to teleport to a warp
|
||||||
default: true
|
default: true
|
||||||
@@ -190,7 +193,10 @@ permissions:
|
|||||||
description: Allows you to set server warps
|
description: Allows you to set server warps
|
||||||
default: op
|
default: op
|
||||||
huskhomes.delwarp:
|
huskhomes.delwarp:
|
||||||
description: Allows you to delete a home
|
description: Allows you to delete a server warp
|
||||||
|
default: op
|
||||||
|
huskhomes.delwarp.all:
|
||||||
|
description: Allows you to delete all server warps
|
||||||
default: op
|
default: op
|
||||||
huskhomes.publichome:
|
huskhomes.publichome:
|
||||||
description: Allows you to teleport to public homes
|
description: Allows you to teleport to public homes
|
||||||
|
|||||||
Reference in new issue
Block a user