Fix warp list permission check using wrong perm

This commit is contained in:
William committed 2023-10-05 17:56:44 +01:00
1 parent 36c8510605
commit 1ab115456e
1 file changed
+1 -3
@@ -88,9 +88,7 @@ public class WarpListCommand extends ListCommand {
private List<Warp> getItems(@NotNull CommandUser executor) {
List<Warp> warps = plugin.getDatabase().getWarps();
if (plugin.getSettings().doPermissionRestrictWarps() && !executor.hasPermission(Warp.getWildcardPermission())) {
warps = warps.stream()
.filter(warp -> executor.hasPermission(getPermission(warp.getPermission())))
.collect(Collectors.toList());
warps = warps.stream().filter(warp -> executor.hasPermission(warp.getPermission())).toList();
}
return warps;
}