mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-03 22:16:34 +00:00
Fix oversight with permission restricted warps
This commit is contained in:
1 parent
824ada0bc5
commit
dc099b84fc
1 file changed
+6
-2
@@ -38,14 +38,18 @@ public class WarpCommand extends CommandBase implements TabCompletable, ConsoleE
|
|||||||
plugin.getDatabase()
|
plugin.getDatabase()
|
||||||
.getWarp(warpName)
|
.getWarp(warpName)
|
||||||
.thenAccept(warpResult -> warpResult.ifPresentOrElse(warp -> {
|
.thenAccept(warpResult -> warpResult.ifPresentOrElse(warp -> {
|
||||||
|
// Handle permission restrictions
|
||||||
if (plugin.getSettings().permissionRestrictWarps) {
|
if (plugin.getSettings().permissionRestrictWarps) {
|
||||||
@Subst("huskhomes.command.warp") final String warpPermission = Permission.COMMAND_WARP + "." + warp.meta.name;
|
@Subst("huskhomes.command.warp")
|
||||||
if (!onlineUser.hasPermission(Permission.COMMAND_SET_WARP.node) && !onlineUser.hasPermission(warpPermission)) {
|
final String warpPermission = Permission.COMMAND_WARP.node + "." + warp.meta.name;
|
||||||
|
|
||||||
|
if (!onlineUser.hasPermission(warpPermission) && !onlineUser.hasPermission(Permission.COMMAND_SET_WARP.node)) {
|
||||||
plugin.getLocales().getLocale("error_no_permission")
|
plugin.getLocales().getLocale("error_no_permission")
|
||||||
.ifPresent(onlineUser::sendMessage);
|
.ifPresent(onlineUser::sendMessage);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Teleport.builder(plugin, onlineUser)
|
Teleport.builder(plugin, onlineUser)
|
||||||
.setTarget(warp)
|
.setTarget(warp)
|
||||||
.toTimedTeleport()
|
.toTimedTeleport()
|
||||||
|
|||||||
Reference in new issue
Block a user