From 5056a794d8d698086a7fa4f67967638def90fa09 Mon Sep 17 00:00:00 2001 From: William Date: Sat, 6 Jul 2024 14:19:04 +0100 Subject: [PATCH] fix: Set execution scopes in commands --- .../net/william278/husksync/command/HuskSyncCommand.java | 2 +- .../java/net/william278/husksync/command/ItemsCommand.java | 2 +- .../java/net/william278/husksync/command/PluginCommand.java | 6 +++--- .../net/william278/husksync/command/UserDataCommand.java | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/src/main/java/net/william278/husksync/command/HuskSyncCommand.java b/common/src/main/java/net/william278/husksync/command/HuskSyncCommand.java index 62a45350..789a253b 100644 --- a/common/src/main/java/net/william278/husksync/command/HuskSyncCommand.java +++ b/common/src/main/java/net/william278/husksync/command/HuskSyncCommand.java @@ -52,7 +52,7 @@ public class HuskSyncCommand extends PluginCommand { private final AboutMenu aboutMenu; public HuskSyncCommand(@NotNull HuskSync plugin) { - super("husksync", List.of(), Permission.Default.TRUE, plugin); + super("husksync", List.of(), Permission.Default.TRUE, ExecutionScope.ALL, plugin); this.updateChecker = plugin.getUpdateChecker(); this.aboutMenu = AboutMenu.builder() .title(Component.text("HuskSync")) diff --git a/common/src/main/java/net/william278/husksync/command/ItemsCommand.java b/common/src/main/java/net/william278/husksync/command/ItemsCommand.java index b088d311..87574e6b 100644 --- a/common/src/main/java/net/william278/husksync/command/ItemsCommand.java +++ b/common/src/main/java/net/william278/husksync/command/ItemsCommand.java @@ -35,7 +35,7 @@ public abstract class ItemsCommand extends PluginCommand { protected ItemsCommand(@NotNull String name, @NotNull List aliases, @NotNull HuskSync plugin) { - super(name, aliases, Permission.Default.IF_OP, plugin); + super(name, aliases, Permission.Default.IF_OP, ExecutionScope.IN_GAME, plugin); } @Override diff --git a/common/src/main/java/net/william278/husksync/command/PluginCommand.java b/common/src/main/java/net/william278/husksync/command/PluginCommand.java index 00ad53c2..b1eda665 100644 --- a/common/src/main/java/net/william278/husksync/command/PluginCommand.java +++ b/common/src/main/java/net/william278/husksync/command/PluginCommand.java @@ -39,9 +39,9 @@ public abstract class PluginCommand extends Command { protected final HuskSync plugin; - protected PluginCommand(@NotNull String name, @NotNull List aliases, - @NotNull Permission.Default permissionDefault, @NotNull HuskSync plugin) { - super(name, aliases, getDescription(plugin, name), new Permission(createPermission(name), permissionDefault)); + protected PluginCommand(@NotNull String name, @NotNull List aliases, @NotNull Permission.Default defPerm, + @NotNull ExecutionScope scope, @NotNull HuskSync plugin) { + super(name, aliases, getDescription(plugin, name), new Permission(createPermission(name), defPerm), scope); this.plugin = plugin; } diff --git a/common/src/main/java/net/william278/husksync/command/UserDataCommand.java b/common/src/main/java/net/william278/husksync/command/UserDataCommand.java index a3acddf1..08f25bfd 100644 --- a/common/src/main/java/net/william278/husksync/command/UserDataCommand.java +++ b/common/src/main/java/net/william278/husksync/command/UserDataCommand.java @@ -44,7 +44,7 @@ public class UserDataCommand extends PluginCommand { public UserDataCommand(@NotNull HuskSync plugin) { - super("userdata", List.of("playerdata"), Permission.Default.IF_OP, plugin); + super("userdata", List.of("playerdata"), Permission.Default.IF_OP, ExecutionScope.ALL, plugin); } @Override