mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 22:17:17 +00:00
Fix wrong permissions getting registered
This commit is contained in:
6 files changed
+21
-12
No files matched your search
@@ -9,12 +9,14 @@ import net.william278.huskhomes.user.OnlineUser;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
public class BackCommand extends InGameCommand {
|
||||
|
||||
protected BackCommand(@NotNull HuskHomes plugin) {
|
||||
super("back", List.of(), "", plugin);
|
||||
addAdditionalPermissions(Map.of("death", false));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -20,6 +20,7 @@ public class EditWarpCommand extends SavedPositionCommand<Warp> {
|
||||
|
||||
public EditWarpCommand(@NotNull HuskHomes plugin) {
|
||||
super("editwarp", List.of(), Warp.class, List.of("rename", "description", "relocate"), plugin);
|
||||
setOperatorCommand(true);
|
||||
addAdditionalPermissions(arguments.stream()
|
||||
.collect(HashMap::new, (m, e) -> m.put(getPermission(e), false), HashMap::putAll));
|
||||
}
|
||||
|
||||
@@ -43,11 +43,13 @@ public abstract class Node implements Executable {
|
||||
|
||||
@NotNull
|
||||
public String getPermission(@NotNull String... child) {
|
||||
return new StringJoiner(".")
|
||||
final StringJoiner joiner = new StringJoiner(".")
|
||||
.add(PERMISSION_PREFIX)
|
||||
.add(getName())
|
||||
.add(String.join(".", child))
|
||||
.toString();
|
||||
.add(getName());
|
||||
for (final String node : child) {
|
||||
joiner.add(node);
|
||||
}
|
||||
return joiner.toString().trim();
|
||||
}
|
||||
|
||||
public boolean isOperatorCommand() {
|
||||
|
||||
@@ -13,7 +13,6 @@ public class WarpCommand extends SavedPositionCommand<Warp> {
|
||||
|
||||
protected WarpCommand(@NotNull HuskHomes plugin) {
|
||||
super("warp", List.of(), Warp.class, List.of(), plugin);
|
||||
setOperatorCommand(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user