mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-04 06:28:49 +00:00
Fix error registering disabled commands
This commit is contained in:
2 files changed
+5
-3
No files matched your search
@@ -140,7 +140,7 @@ public class BukkitHuskHomes extends JavaPlugin implements HuskHomes, BukkitTask
|
|||||||
.map(type -> {
|
.map(type -> {
|
||||||
final Command command = type.getCommand();
|
final Command command = type.getCommand();
|
||||||
if (settings.isCommandDisabled(command)) {
|
if (settings.isCommandDisabled(command)) {
|
||||||
new BukkitCommand(new DisabledCommand(this), this).register();
|
new BukkitCommand(new DisabledCommand(command.getName(), this), this).register();
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
new BukkitCommand(command, this).register();
|
new BukkitCommand(command, this).register();
|
||||||
|
|||||||
@@ -8,8 +8,9 @@ import java.util.List;
|
|||||||
|
|
||||||
public class DisabledCommand extends Command {
|
public class DisabledCommand extends Command {
|
||||||
|
|
||||||
public DisabledCommand(@NotNull HuskHomes plugin) {
|
public DisabledCommand(@NotNull String name, @NotNull HuskHomes plugin) {
|
||||||
super("", List.of(), "", plugin);
|
super(name, List.of(), "", plugin);
|
||||||
|
setOperatorCommand(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -17,4 +18,5 @@ public class DisabledCommand extends Command {
|
|||||||
plugin.getLocales().getLocale("error_command_disabled")
|
plugin.getLocales().getLocale("error_command_disabled")
|
||||||
.ifPresent(executor::sendMessage);
|
.ifPresent(executor::sendMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user