mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-03 22:15:45 +00:00
Update for cloud deprecations
This commit is contained in:
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(),
|
var builder = commandManager.commandBuilder(channel.commandName(),
|
||||||
channel.commandAliases(), commandManager.createDefaultCommandMeta())
|
channel.commandAliases(), commandManager.createDefaultCommandMeta())
|
||||||
.argument(StringArgument.<Commander>newBuilder("message").greedy().asOptional().build());
|
.argument(StringArgument.<Commander>builder("message").greedy().asOptional().build());
|
||||||
|
|
||||||
if (channel.permission() != null) {
|
if (channel.permission() != null) {
|
||||||
builder = builder.permission(channel.permission());
|
builder = builder.permission(channel.permission());
|
||||||
|
|||||||
+5
-5
@@ -66,7 +66,7 @@ public final class CarbonPlayerArgument extends CommandArgument<Commander, Carbo
|
|||||||
* @param name name of the component
|
* @param name name of the component
|
||||||
* @return created builder
|
* @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);
|
return new Builder(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ public final class CarbonPlayerArgument extends CommandArgument<Commander, Carbo
|
|||||||
* @return created component
|
* @return created component
|
||||||
*/
|
*/
|
||||||
public static @NonNull CommandArgument<Commander, CarbonPlayer> of(final @NonNull String name) {
|
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
|
* @return created component
|
||||||
*/
|
*/
|
||||||
public static @NonNull CommandArgument<Commander, CarbonPlayer> optional(final @NonNull String name) {
|
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 name,
|
||||||
final @NonNull String defaultCarbonPlayer
|
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;
|
private CarbonMessages carbonMessages;
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ public class DebugCommand extends CarbonCommand {
|
|||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
final var command = this.commandManager.commandBuilder(this.commandSettings().name(), this.commandSettings().aliases())
|
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()))
|
RichDescription.of(this.carbonMessages.commandDebugArgumentPlayer().component()))
|
||||||
.permission("carbon.debug")
|
.permission("carbon.debug")
|
||||||
.senderType(PlayerCommander.class)
|
.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())
|
final var command = this.commandManager.commandBuilder(this.commandSettings().name(), this.commandSettings().aliases())
|
||||||
.literal("help",
|
.literal("help",
|
||||||
RichDescription.of(this.carbonMessages.commandHelpDescription().component()))
|
RichDescription.of(this.carbonMessages.commandHelpDescription().component()))
|
||||||
.argument(StringArgument.<Commander>newBuilder("query")
|
.argument(StringArgument.<Commander>builder("query")
|
||||||
.greedy().withSuggestionsProvider(this::suggestQueries).asOptional(),
|
.greedy().withSuggestionsProvider(this::suggestQueries).asOptional(),
|
||||||
RichDescription.of(this.carbonMessages.commandHelpArgumentQuery().component()))
|
RichDescription.of(this.carbonMessages.commandHelpArgumentQuery().component()))
|
||||||
.permission("carbon.help")
|
.permission("carbon.help")
|
||||||
@@ -94,7 +94,7 @@ public final class HelpCommand extends CarbonCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private List<String> suggestQueries(final CommandContext<Commander> ctx, final String input) {
|
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();
|
return topic.getEntries().stream().map(CommandHelpHandler.VerboseHelpEntry::getSyntaxString).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public class IgnoreCommand extends CarbonCommand {
|
|||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
final var command = this.commandManager.commandBuilder(this.commandSettings().name(), this.commandSettings().aliases())
|
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()))
|
RichDescription.of(this.carbonMessages.commandIgnoreArgumentPlayer().component()))
|
||||||
.flag(this.commandManager.flagBuilder("uuid")
|
.flag(this.commandManager.flagBuilder("uuid")
|
||||||
.withAliases("u")
|
.withAliases("u")
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public class MuteCommand extends CarbonCommand {
|
|||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
final var command = this.commandManager.commandBuilder(this.commandSettings().name(), this.commandSettings().aliases())
|
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()))
|
RichDescription.of(this.carbonMessages.commandMuteArgumentPlayer().component()))
|
||||||
.flag(this.commandManager.flagBuilder("uuid")
|
.flag(this.commandManager.flagBuilder("uuid")
|
||||||
.withAliases("u")
|
.withAliases("u")
|
||||||
|
|||||||
+1
-1
@@ -72,7 +72,7 @@ public class MuteInfoCommand extends CarbonCommand {
|
|||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
final var command = this.commandManager.commandBuilder(this.commandSettings().name(), this.commandSettings().aliases())
|
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()))
|
RichDescription.of(this.carbonMessages.commandMuteInfoArgumentPlayer().component()))
|
||||||
.flag(this.commandManager.flagBuilder("uuid")
|
.flag(this.commandManager.flagBuilder("uuid")
|
||||||
.withAliases("u")
|
.withAliases("u")
|
||||||
|
|||||||
+1
-1
@@ -78,7 +78,7 @@ public class NicknameCommand extends CarbonCommand {
|
|||||||
.flag(this.commandManager.flagBuilder("player")
|
.flag(this.commandManager.flagBuilder("player")
|
||||||
.withAliases("p")
|
.withAliases("p")
|
||||||
.withDescription(RichDescription.of(this.carbonMessages.commandNicknameArgumentPlayer().component()))
|
.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"))
|
.withPermission(Permission.of("carbon.nickname.others"))
|
||||||
)
|
)
|
||||||
.flag(this.commandManager.flagBuilder("nickname")
|
.flag(this.commandManager.flagBuilder("nickname")
|
||||||
|
|||||||
+1
-1
@@ -73,7 +73,7 @@ public class UnignoreCommand extends CarbonCommand {
|
|||||||
public void init() {
|
public void init() {
|
||||||
final var command = this.commandManager.commandBuilder(this.commandSettings().name(), this.commandSettings().aliases())
|
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.
|
// 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()))
|
RichDescription.of(this.carbonMessages.commandUnignoreArgumentPlayer().component()))
|
||||||
.flag(this.commandManager.flagBuilder("uuid")
|
.flag(this.commandManager.flagBuilder("uuid")
|
||||||
.withAliases("u")
|
.withAliases("u")
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public class UnmuteCommand extends CarbonCommand {
|
|||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
final var command = this.commandManager.commandBuilder(this.commandSettings().name(), this.commandSettings().aliases())
|
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()))
|
RichDescription.of(this.carbonMessages.commandUnmuteArgumentPlayer().component()))
|
||||||
.flag(this.commandManager.flagBuilder("uuid")
|
.flag(this.commandManager.flagBuilder("uuid")
|
||||||
.withAliases("u")
|
.withAliases("u")
|
||||||
|
|||||||
+1
-1
@@ -74,7 +74,7 @@ public class UpdateUsernameCommand extends CarbonCommand {
|
|||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
final var command = this.commandManager.commandBuilder(this.commandSettings().name(), this.commandSettings().aliases())
|
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()))
|
RichDescription.of(this.messageService.commandUpdateUsernameArgumentPlayer().component()))
|
||||||
.flag(this.commandManager.flagBuilder("uuid")
|
.flag(this.commandManager.flagBuilder("uuid")
|
||||||
.withAliases("u")
|
.withAliases("u")
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ public class WhisperCommand extends CarbonCommand {
|
|||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
final var command = this.commandManager.commandBuilder(this.commandSettings().name(), this.commandSettings().aliases())
|
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()))
|
RichDescription.of(this.carbonMessages.commandWhisperArgumentPlayer().component()))
|
||||||
.argument(StringArgument.greedy("message"),
|
.argument(StringArgument.greedy("message"),
|
||||||
RichDescription.of(this.carbonMessages.commandWhisperArgumentMessage().component()))
|
RichDescription.of(this.carbonMessages.commandWhisperArgumentMessage().component()))
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public final class CarbonChatFabricModule extends AbstractModule {
|
|||||||
@Singleton
|
@Singleton
|
||||||
public CommandManager<Commander> commandManager() {
|
public CommandManager<Commander> commandManager() {
|
||||||
final FabricServerCommandManager<Commander> commandManager = new FabricServerCommandManager<>(
|
final FabricServerCommandManager<Commander> commandManager = new FabricServerCommandManager<>(
|
||||||
AsynchronousCommandExecutionCoordinator.<Commander>newBuilder().build(),
|
AsynchronousCommandExecutionCoordinator.<Commander>builder().build(),
|
||||||
FabricCommander::from,
|
FabricCommander::from,
|
||||||
commander -> ((FabricCommander) commander).commandSourceStack()
|
commander -> ((FabricCommander) commander).commandSourceStack()
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public class DeleteMessageCommand extends CarbonCommand {
|
|||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
final var command = this.commandManager.commandBuilder(this.commandSettings().name(), this.commandSettings().aliases())
|
final var command = this.commandManager.commandBuilder(this.commandSettings().name(), this.commandSettings().aliases())
|
||||||
.argument(UUIDArgument.<Commander>newBuilder("messageid").withSuggestionsProvider((sender, input) -> {
|
.argument(UUIDArgument.<Commander>builder("messageid").withSuggestionsProvider((sender, input) -> {
|
||||||
final List<String> messageIds = CarbonChatFabric.messageIdSuggestions();
|
final List<String> messageIds = CarbonChatFabric.messageIdSuggestions();
|
||||||
|
|
||||||
if (input.isEmpty()) {
|
if (input.isEmpty()) {
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ public final class CarbonChatPaperModule extends AbstractModule {
|
|||||||
try {
|
try {
|
||||||
commandManager = new PaperCommandManager<>(
|
commandManager = new PaperCommandManager<>(
|
||||||
this.carbonChat,
|
this.carbonChat,
|
||||||
AsynchronousCommandExecutionCoordinator.<Commander>newBuilder().build(),
|
AsynchronousCommandExecutionCoordinator.<Commander>builder().build(),
|
||||||
commandSender -> {
|
commandSender -> {
|
||||||
if (commandSender instanceof Player player) {
|
if (commandSender instanceof Player player) {
|
||||||
return new PaperPlayerCommander(this.carbonChat, player);
|
return new PaperPlayerCommander(this.carbonChat, player);
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public final class CarbonChatSpongeModule extends AbstractModule {
|
|||||||
public CommandManager<Commander> commandManager() {
|
public CommandManager<Commander> commandManager() {
|
||||||
final SpongeCommandManager<Commander> commandManager = new SpongeCommandManager<>(
|
final SpongeCommandManager<Commander> commandManager = new SpongeCommandManager<>(
|
||||||
this.pluginContainer,
|
this.pluginContainer,
|
||||||
AsynchronousCommandExecutionCoordinator.<Commander>newBuilder().build(),
|
AsynchronousCommandExecutionCoordinator.<Commander>builder().build(),
|
||||||
commander -> ((SpongeCommander) commander).commandCause(),
|
commander -> ((SpongeCommander) commander).commandCause(),
|
||||||
commandCause -> {
|
commandCause -> {
|
||||||
if (commandCause.subject() instanceof ServerPlayer player) {
|
if (commandCause.subject() instanceof ServerPlayer player) {
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ public final class CarbonChatVelocityModule extends AbstractModule {
|
|||||||
final VelocityCommandManager<Commander> commandManager = new VelocityCommandManager<>(
|
final VelocityCommandManager<Commander> commandManager = new VelocityCommandManager<>(
|
||||||
this.pluginContainer,
|
this.pluginContainer,
|
||||||
this.proxyServer,
|
this.proxyServer,
|
||||||
AsynchronousCommandExecutionCoordinator.<Commander>newBuilder().build(),
|
AsynchronousCommandExecutionCoordinator.<Commander>builder().build(),
|
||||||
commandSender -> {
|
commandSender -> {
|
||||||
if (commandSender instanceof Player player) {
|
if (commandSender instanceof Player player) {
|
||||||
return new VelocityPlayerCommander(this.carbonChatVelocity, player);
|
return new VelocityPlayerCommander(this.carbonChatVelocity, player);
|
||||||
|
|||||||
Reference in new issue
Block a user