|
|
@ -34,6 +34,7 @@ import org.jetbrains.annotations.Nullable;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.function.Function;
|
|
|
|
import java.util.function.Function;
|
|
|
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings("unused")
|
|
|
|
@SuppressWarnings("unused")
|
|
|
|
public class LegacyPaperCommand extends BaseCommand<CommandSender> {
|
|
|
|
public class LegacyPaperCommand extends BaseCommand<CommandSender> {
|
|
|
@ -83,12 +84,18 @@ public class LegacyPaperCommand extends BaseCommand<CommandSender> {
|
|
|
|
// Setup command properties
|
|
|
|
// Setup command properties
|
|
|
|
this.setDescription(command.getDescription());
|
|
|
|
this.setDescription(command.getDescription());
|
|
|
|
this.setAliases(command.getAliases());
|
|
|
|
this.setAliases(command.getAliases());
|
|
|
|
this.setUsage(command.build().getUsageText());
|
|
|
|
this.setUsage(getUsageText());
|
|
|
|
if (permission != null) {
|
|
|
|
if (permission != null) {
|
|
|
|
this.setPermission(permission.node());
|
|
|
|
this.setPermission(permission.node());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@NotNull
|
|
|
|
|
|
|
|
private String getUsageText() {
|
|
|
|
|
|
|
|
return dispatcher.getSmartUsage(dispatcher.getRoot(), null).values().stream()
|
|
|
|
|
|
|
|
.map("/%s"::formatted).collect(Collectors.joining("\n"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings("deprecation")
|
|
|
|
@SuppressWarnings("deprecation")
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public boolean execute(@NotNull CommandSender commandSender, @NotNull String alias, @NotNull String[] args) {
|
|
|
|
public boolean execute(@NotNull CommandSender commandSender, @NotNull String alias, @NotNull String[] args) {
|
|
|
|