mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-03 14:38:53 +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
|
@NotNull
|
||||||
public List<String> getUsableWarps(@NotNull CommandUser user) {
|
public List<String> getUsableWarps(@NotNull CommandUser user) {
|
||||||
if (!plugin.getSettings().doPermissionRestrictWarps()) {
|
if (!plugin.getSettings().doPermissionRestrictWarps() || user.hasPermission(Warp.getWildcardPermission())) {
|
||||||
return getWarps();
|
return getWarps();
|
||||||
}
|
}
|
||||||
return warps.stream()
|
return warps.stream()
|
||||||
.filter(warp -> user.hasPermission(warp.getPermission()) || user.hasPermission(Warp.getWildcardPermission()))
|
.filter(warp -> user.hasPermission(warp.getPermission()))
|
||||||
.map(Warp::getName)
|
.map(Warp::getName)
|
||||||
.toList();
|
.toList();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user