Update for cloud deprecations

This commit is contained in:
Jason Penilla committed 2022-12-15 14:02:50 -07:00
1 parent 4a53bc85b5
commit 8ab0f9d782
17 files changed
+22 -22

No files matched your search

@@ -377,7 +377,7 @@ public class CarbonChannelRegistry implements ChannelRegistry, DefaultedRegistry
var builder = commandManager.commandBuilder(channel.commandName(),
channel.commandAliases(), commandManager.createDefaultCommandMeta())
.argument(StringArgument.<Commander>newBuilder("message").greedy().asOptional().build());
.argument(StringArgument.<Commander>builder("message").greedy().asOptional().build());
if (channel.permission() != null) {
builder = builder.permission(channel.permission());
@@ -66,7 +66,7 @@ public final class CarbonPlayerArgument extends CommandArgument<Commander, Carbo
* @param name name of the component
* @return created builder
*/
public static @NonNull Builder newBuilder(final @NonNull String name) {
public static @NonNull Builder builder(final @NonNull String name) {
return new Builder(name);
}
@@ -77,7 +77,7 @@ public final class CarbonPlayerArgument extends CommandArgument<Commander, Carbo
* @return created component
*/
public static @NonNull CommandArgument<Commander, CarbonPlayer> of(final @NonNull String name) {
return CarbonPlayerArgument.newBuilder(name).asRequired().build();
return CarbonPlayerArgument.builder(name).asRequired().build();
}
/**
@@ -87,7 +87,7 @@ public final class CarbonPlayerArgument extends CommandArgument<Commander, Carbo
* @return created component
*/
public static @NonNull CommandArgument<Commander, CarbonPlayer> optional(final @NonNull String name) {
return CarbonPlayerArgument.newBuilder(name).asOptional().build();
return CarbonPlayerArgument.builder(name).asOptional().build();
}
/**
@@ -101,10 +101,10 @@ public final class CarbonPlayerArgument extends CommandArgument<Commander, Carbo
final @NonNull String name,
final @NonNull String defaultCarbonPlayer
) {
return CarbonPlayerArgument.newBuilder(name).asOptionalWithDefault(defaultCarbonPlayer).build();
return CarbonPlayerArgument.builder(name).asOptionalWithDefault(defaultCarbonPlayer).build();
}
public static final class Builder extends CommandArgument.Builder<Commander, CarbonPlayer> {
public static final class Builder extends CommandArgument.TypedBuilder<Commander, CarbonPlayer, Builder> {
private CarbonMessages carbonMessages;
@@ -70,7 +70,7 @@ public class DebugCommand extends CarbonCommand {
@Override
public void init() {
final var command = this.commandManager.commandBuilder(this.commandSettings().name(), this.commandSettings().aliases())
.argument(CarbonPlayerArgument.newBuilder("player").withMessages(this.carbonMessages).withSuggestionsProvider(this.playerSuggestions).asOptional(),
.argument(CarbonPlayerArgument.builder("player").withMessages(this.carbonMessages).withSuggestionsProvider(this.playerSuggestions).asOptional(),
RichDescription.of(this.carbonMessages.commandDebugArgumentPlayer().component()))
.permission("carbon.debug")
.senderType(PlayerCommander.class)
@@ -79,7 +79,7 @@ public final class HelpCommand extends CarbonCommand {
final var command = this.commandManager.commandBuilder(this.commandSettings().name(), this.commandSettings().aliases())
.literal("help",
RichDescription.of(this.carbonMessages.commandHelpDescription().component()))
.argument(StringArgument.<Commander>newBuilder("query")
.argument(StringArgument.<Commander>builder("query")
.greedy().withSuggestionsProvider(this::suggestQueries).asOptional(),
RichDescription.of(this.carbonMessages.commandHelpArgumentQuery().component()))
.permission("carbon.help")
@@ -94,7 +94,7 @@ public final class HelpCommand extends CarbonCommand {
}
private List<String> suggestQueries(final CommandContext<Commander> ctx, final String input) {
final var topic = (CommandHelpHandler.IndexHelpTopic<Commander>) this.commandManager.createCommandHelpHandler().queryHelp(ctx.getSender(), "");
final var topic = this.commandManager.createCommandHelpHandler().queryRootIndex(ctx.getSender());
return topic.getEntries().stream().map(CommandHelpHandler.VerboseHelpEntry::getSyntaxString).toList();
}
@@ -72,7 +72,7 @@ public class IgnoreCommand extends CarbonCommand {
@Override
public void init() {
final var command = this.commandManager.commandBuilder(this.commandSettings().name(), this.commandSettings().aliases())
.argument(CarbonPlayerArgument.newBuilder("player").withMessages(this.carbonMessages).withSuggestionsProvider(this.playerSuggestions).asOptional(),
.argument(CarbonPlayerArgument.builder("player").withMessages(this.carbonMessages).withSuggestionsProvider(this.playerSuggestions).asOptional(),
RichDescription.of(this.carbonMessages.commandIgnoreArgumentPlayer().component()))
.flag(this.commandManager.flagBuilder("uuid")
.withAliases("u")
@@ -72,7 +72,7 @@ public class MuteCommand extends CarbonCommand {
@Override
public void init() {
final var command = this.commandManager.commandBuilder(this.commandSettings().name(), this.commandSettings().aliases())
.argument(CarbonPlayerArgument.newBuilder("player").withMessages(this.carbonMessages).withSuggestionsProvider(this.playerSuggestions).asOptional(),
.argument(CarbonPlayerArgument.builder("player").withMessages(this.carbonMessages).withSuggestionsProvider(this.playerSuggestions).asOptional(),
RichDescription.of(this.carbonMessages.commandMuteArgumentPlayer().component()))
.flag(this.commandManager.flagBuilder("uuid")
.withAliases("u")
@@ -72,7 +72,7 @@ public class MuteInfoCommand extends CarbonCommand {
@Override
public void init() {
final var command = this.commandManager.commandBuilder(this.commandSettings().name(), this.commandSettings().aliases())
.argument(CarbonPlayerArgument.newBuilder("player").withMessages(this.carbonMessages).withSuggestionsProvider(this.playerSuggestions).asOptional(),
.argument(CarbonPlayerArgument.builder("player").withMessages(this.carbonMessages).withSuggestionsProvider(this.playerSuggestions).asOptional(),
RichDescription.of(this.carbonMessages.commandMuteInfoArgumentPlayer().component()))
.flag(this.commandManager.flagBuilder("uuid")
.withAliases("u")
@@ -78,7 +78,7 @@ public class NicknameCommand extends CarbonCommand {
.flag(this.commandManager.flagBuilder("player")
.withAliases("p")
.withDescription(RichDescription.of(this.carbonMessages.commandNicknameArgumentPlayer().component()))
.withArgument(CarbonPlayerArgument.newBuilder("player").withMessages(this.carbonMessages).withSuggestionsProvider(this.playerSuggestions).asOptional())
.withArgument(CarbonPlayerArgument.builder("player").withMessages(this.carbonMessages).withSuggestionsProvider(this.playerSuggestions).asOptional())
.withPermission(Permission.of("carbon.nickname.others"))
)
.flag(this.commandManager.flagBuilder("nickname")
@@ -73,7 +73,7 @@ public class UnignoreCommand extends CarbonCommand {
public void init() {
final var command = this.commandManager.commandBuilder(this.commandSettings().name(), this.commandSettings().aliases())
// TODO: Filter, and only show muted players, but allow inputting any player name.
.argument(CarbonPlayerArgument.newBuilder("player").withMessages(this.carbonMessages).withSuggestionsProvider(this.playerSuggestions).asOptional(),
.argument(CarbonPlayerArgument.builder("player").withMessages(this.carbonMessages).withSuggestionsProvider(this.playerSuggestions).asOptional(),
RichDescription.of(this.carbonMessages.commandUnignoreArgumentPlayer().component()))
.flag(this.commandManager.flagBuilder("uuid")
.withAliases("u")
@@ -72,7 +72,7 @@ public class UnmuteCommand extends CarbonCommand {
@Override
public void init() {
final var command = this.commandManager.commandBuilder(this.commandSettings().name(), this.commandSettings().aliases())
.argument(CarbonPlayerArgument.newBuilder("player").withMessages(this.carbonMessages).withSuggestionsProvider(this.playerSuggestions).asOptional(),
.argument(CarbonPlayerArgument.builder("player").withMessages(this.carbonMessages).withSuggestionsProvider(this.playerSuggestions).asOptional(),
RichDescription.of(this.carbonMessages.commandUnmuteArgumentPlayer().component()))
.flag(this.commandManager.flagBuilder("uuid")
.withAliases("u")
@@ -74,7 +74,7 @@ public class UpdateUsernameCommand extends CarbonCommand {
@Override
public void init() {
final var command = this.commandManager.commandBuilder(this.commandSettings().name(), this.commandSettings().aliases())
.argument(CarbonPlayerArgument.newBuilder("player").withMessages(this.messageService).withSuggestionsProvider(this.playerSuggestions).asOptional(),
.argument(CarbonPlayerArgument.builder("player").withMessages(this.messageService).withSuggestionsProvider(this.playerSuggestions).asOptional(),
RichDescription.of(this.messageService.commandUpdateUsernameArgumentPlayer().component()))
.flag(this.commandManager.flagBuilder("uuid")
.withAliases("u")
@@ -74,7 +74,7 @@ public class WhisperCommand extends CarbonCommand {
@Override
public void init() {
final var command = this.commandManager.commandBuilder(this.commandSettings().name(), this.commandSettings().aliases())
.argument(CarbonPlayerArgument.newBuilder("player").withMessages(this.carbonMessages).withSuggestionsProvider(this.playerSuggestions).asRequired(),
.argument(CarbonPlayerArgument.builder("player").withMessages(this.carbonMessages).withSuggestionsProvider(this.playerSuggestions).asRequired(),
RichDescription.of(this.carbonMessages.commandWhisperArgumentPlayer().component()))
.argument(StringArgument.greedy("message"),
RichDescription.of(this.carbonMessages.commandWhisperArgumentMessage().component()))