Bump adventure and fix startup issues

This commit is contained in:
Draycia committed 2020-10-16 22:04:10 -07:00
1 parent 61a2b4cd0f
commit 8e7a625ad6
5 files changed
+19 -12

No files matched your search

+5 -5
View File
@@ -7,12 +7,12 @@ description 'CarbonChat-API'
dependencies {
compile 'org.checkerframework:checker-qual:3.6.1'
compile 'net.kyori:adventure-api:4.0.0'
compile 'net.kyori:adventure-nbt:4.0.0-SNAPSHOT'
compile 'net.kyori:adventure-api:4.1.1'
compile 'net.kyori:adventure-nbt:4.1.1'
compile 'net.kyori:adventure-platform-api:4.0.0-SNAPSHOT'
compile 'net.kyori:adventure-text-serializer-plain:4.0.0-SNAPSHOT'
compile 'net.kyori:adventure-text-serializer-gson:4.0.0-SNAPSHOT'
compile 'net.kyori:adventure-text-serializer-legacy:4.0.0-SNAPSHOT'
compile 'net.kyori:adventure-text-serializer-plain:4.1.1'
compile 'net.kyori:adventure-text-serializer-gson:4.1.1'
compile 'net.kyori:adventure-text-serializer-legacy:4.1.1'
compile 'net.kyori:adventure-text-minimessage:4.0.0-SNAPSHOT'
compile 'de.themoep:minedown-adventure:1.6.1-SNAPSHOT'
@@ -29,14 +29,13 @@ import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.UUID;
public class BukkitPlayerUser implements PlayerUser, ForwardingAudience {
public class BukkitPlayerUser implements PlayerUser, ForwardingAudience.Single {
private @NonNull final transient CarbonChatBukkit carbonChat;
private @NonNull final Map<@NonNull String, @NonNull SimpleUserChannelSettings> channelSettings = new HashMap<>();
@@ -61,8 +60,8 @@ public class BukkitPlayerUser implements PlayerUser, ForwardingAudience {
}
@Override
public @NonNull Iterable<@NonNull ? extends Audience> audiences() {
return Collections.singleton(this.carbonChat.messageProcessor().audiences().player(this.uuid()));
public @NonNull Audience audience() {
return this.carbonChat.messageProcessor().audiences().player(this.uuid());
}
@Override
@@ -7,7 +7,6 @@ import net.draycia.carbon.api.channels.ChannelRegistry;
import net.draycia.carbon.api.channels.ChatChannel;
import net.draycia.carbon.api.events.misc.CarbonEvents;
import net.draycia.carbon.api.events.ChannelRegisterEvent;
import net.draycia.carbon.common.commands.AliasedChannelCommand;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
@@ -101,7 +100,6 @@ public class ChannelManager {
if (channel instanceof TextChannel) {
prefix = ((TextChannel) channel).messagePrefix();
new AliasedChannelCommand(this.carbonChat.commandManager(), (TextChannel) channel);
}
if (prefix != null && !prefix.trim().isEmpty()) {
@@ -16,7 +16,7 @@ import java.util.stream.StreamSupport;
public final class PlayerUserArgument<C> extends CommandArgument<C, PlayerUser> {
private PlayerUserArgument(final boolean required) {
super(required, "channel", PlayerUserArgument::parser,
super(required, "user", PlayerUserArgument::parser,
"",
PlayerUser.class, PlayerUserArgument::suggestions);
}
@@ -1,7 +1,11 @@
package net.draycia.carbon.common.commands.misc;
import cloud.commandframework.CommandManager;
import net.draycia.carbon.api.CarbonChatProvider;
import net.draycia.carbon.api.channels.ChatChannel;
import net.draycia.carbon.api.channels.TextChannel;
import net.draycia.carbon.api.users.CarbonUser;
import net.draycia.carbon.common.commands.AliasedChannelCommand;
import net.draycia.carbon.common.commands.ChannelCommand;
import net.draycia.carbon.common.commands.ChannelListCommand;
import net.draycia.carbon.common.commands.ChatReloadCommand;
@@ -41,6 +45,12 @@ public final class CommandRegistrar {
new SpyChannelCommand(commandManager);
new SudoChannelCommand(commandManager);
new ToggleCommand(commandManager);
for (final ChatChannel channel : CarbonChatProvider.carbonChat().channelRegistry()) {
if (channel instanceof TextChannel) {
new AliasedChannelCommand(commandManager, (TextChannel) channel);
}
}
}
}