mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-01 22:16:08 +00:00
Slightly improve TAB completion warp permission filtering
This commit is contained in:
1 file changed
+2
-2
@@ -84,11 +84,11 @@ public class WarpsManager {
|
||||
|
||||
@NotNull
|
||||
public List<String> getUsableWarps(@NotNull CommandUser user) {
|
||||
if (!plugin.getSettings().doPermissionRestrictWarps()) {
|
||||
if (!plugin.getSettings().doPermissionRestrictWarps() || user.hasPermission(Warp.getWildcardPermission())) {
|
||||
return getWarps();
|
||||
}
|
||||
return warps.stream()
|
||||
.filter(warp -> user.hasPermission(warp.getPermission()) || user.hasPermission(Warp.getWildcardPermission()))
|
||||
.filter(warp -> user.hasPermission(warp.getPermission()))
|
||||
.map(Warp::getName)
|
||||
.toList();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user