Add permission restricted warps

This commit is contained in:
William committed 2022-08-20 18:41:30 +01:00
1 parent d4f4d5b0b0
commit 18673f3936
6 files changed
+49 -27

No files matched your search

@@ -23,7 +23,7 @@ public class WarpCommand extends CommandBase implements TabCompletable, ConsoleE
return;
}
onlineUser.sendMessage(plugin.getCache().getWarpList(onlineUser, plugin.getLocales(), warps,
plugin.getSettings().listItemsPerPage, 1));
plugin.getSettings().permissionRestrictWarps, plugin.getSettings().listItemsPerPage, 1));
});
case 1 -> {
final String warpName = args[0];
@@ -32,7 +32,7 @@ public class WarpListCommand extends CommandBase implements ConsoleExecutable {
/**
* Show a (cached) list of server warps
*
* @param onlineUser the user to display warps to
* @param onlineUser the user to display warps to
* @param pageNumber page number to display
*/
private void showWarpList(@NotNull OnlineUser onlineUser, int pageNumber) {
@@ -40,14 +40,14 @@ public class WarpListCommand extends CommandBase implements ConsoleExecutable {
onlineUser.sendMessage(plugin.getCache().warpLists.get(onlineUser.uuid).getNearestValidPage(pageNumber));
return;
}
plugin.getDatabase().getWarps().thenAccept(warps -> {
if (warps.isEmpty()) {
plugin.getLocales().getLocale("error_no_warps_set").ifPresent(onlineUser::sendMessage);
return;
}
onlineUser.sendMessage(plugin.getCache().getWarpList(onlineUser, plugin.getLocales(), warps,
plugin.getSettings().listItemsPerPage, pageNumber));
plugin.getSettings().permissionRestrictWarps, plugin.getSettings().listItemsPerPage, pageNumber));
});
}