idek anymore dude

This commit is contained in:
Draycia committed 2020-11-29 18:25:17 -08:00
1 parent 224c7723d6
commit 8a7ab5f858
9 files changed
+80 -8

No files matched your search

@@ -38,17 +38,23 @@ public class CarbonChatChannel implements TextChannel {
private final @NonNull CarbonChat carbonChat;
private final @NonNull ChannelOptions options;
private @NonNull ChannelOptions options;
public CarbonChatChannel(final @NonNull CarbonChat carbonChat, final @NonNull ChannelOptions options) {
this.carbonChat = carbonChat;
this.options = options;
}
@Override
public @NonNull ChannelOptions options() {
return this.options;
}
@Override
public void options(final @NonNull ChannelOptions options) {
this.options = options;
}
public @NonNull CarbonChat carbonChat() {
return this.carbonChat;
}
@@ -3,6 +3,7 @@ package net.draycia.carbon.common.channels;
import net.draycia.carbon.api.CarbonChat;
import net.draycia.carbon.api.CarbonChatProvider;
import net.draycia.carbon.api.channels.WhisperChannel;
import net.draycia.carbon.api.config.ChannelOptions;
import net.draycia.carbon.api.events.ChatComponentEvent;
import net.draycia.carbon.api.events.ChatFormatEvent;
import net.draycia.carbon.api.events.misc.CarbonEvents;
@@ -37,6 +38,16 @@ public class CarbonWhisperChannel implements WhisperChannel {
this.audience = audience;
}
@Override
public @NonNull ChannelOptions options() {
return ChannelOptions.defaultChannel();
}
@Override
public void options(final @NonNull ChannelOptions options) {
}
@Override
public @NonNull PlayerUser sender() {
return this.sender;
@@ -112,4 +112,16 @@ public class ChannelManager {
}
}
public void reloadChannels() {
for (final Map.Entry<String, ChannelOptions> options :
this.carbonChat.channelSettings().channelOptions().entrySet()) {
final ChatChannel channel = this.registry().get(options.getValue().key());
if (channel != null) {
channel.options(options.getValue());
}
}
}
}
@@ -35,7 +35,7 @@ public class ChatReloadCommand {
}
private void reloadConfig(final @NonNull CommandContext<CarbonUser> context) {
this.carbonChat.reloadConfig();
this.carbonChat.reload();
final Component message = this.carbonChat.messageProcessor()
.processMessage(this.carbonChat.translations().reloaded().replace("br", "\n"));