More configuration progress

This commit is contained in:
Draycia committed 2020-09-25 01:45:35 -07:00
1 parent 3878be3563
commit f588f3b24b
13 files changed
+318 -256

No files matched your search

@@ -14,7 +14,7 @@ public class PingHandler {
final CarbonChat carbonChat = CarbonChatProvider.carbonChat();
CarbonEvents.register(ChatComponentEvent.class, PostOrders.LAST, false, event -> {
if (!carbonChat.carbonSettings().pings().enabled()) {
if (!carbonChat.carbonSettings().channelPings().enabled()) {
return;
}
@@ -23,8 +23,8 @@ public class PingHandler {
}
final String targetName = event.target().name();
final String prefix = carbonChat.carbonSettings().pings().prefix();
final boolean caseSensitive = carbonChat.carbonSettings().pings().caseSensitive();
final String prefix = carbonChat.carbonSettings().channelPings().prefix();
final boolean caseSensitive = carbonChat.carbonSettings().channelPings().caseSensitive();
if (caseSensitive) {
if (!event.originalMessage().contains(prefix + targetName)) {
@@ -36,10 +36,10 @@ public class PingHandler {
}
}
final Key key = carbonChat.carbonSettings().pings().sound();
final Sound.Source source = carbonChat.carbonSettings().pings().source();
final float volume = carbonChat.carbonSettings().pings().volume();
final float pitch = carbonChat.carbonSettings().pings().pitch();
final Key key = carbonChat.carbonSettings().channelPings().sound();
final Sound.Source source = carbonChat.carbonSettings().channelPings().source();
final float volume = carbonChat.carbonSettings().channelPings().volume();
final float pitch = carbonChat.carbonSettings().channelPings().pitch();
event.target().playSound(Sound.of(key, source, volume, pitch));
});
@@ -10,7 +10,7 @@ import io.lettuce.core.pubsub.api.sync.RedisPubSubCommands;
import net.draycia.carbon.api.CarbonChat;
import net.draycia.carbon.api.messaging.MessageService;
import net.draycia.carbon.api.users.ChatUser;
import net.draycia.carbon.common.utils.RedisCredentials;
import net.draycia.carbon.api.config.RedisCredentials;
import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.Base64;
@@ -1,36 +0,0 @@
package net.draycia.carbon.common.utils;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
public class RedisCredentials {
private final @NonNull String host;
private final @Nullable String password;
private final int port;
private final int database;
public RedisCredentials(final @NonNull String host, final @Nullable String password, final int port, final int database) {
this.host = host;
this.password = password;
this.port = port;
this.database = database;
}
public @NonNull String host() {
return this.host;
}
public @Nullable String password() {
return this.password;
}
public int port() {
return this.port;
}
public int database() {
return this.database;
}
}