It compiles!

This commit is contained in:
Draycia committed 2020-09-25 01:45:35 -07:00
1 parent 3a69d0d74b
commit 3878be3563
6 files changed
+110 -26

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.getConfig().getBoolean("pings.enabled")) {
if (!carbonChat.carbonSettings().pings().enabled()) {
return;
}
@@ -23,8 +23,8 @@ public class PingHandler {
}
final String targetName = event.target().name();
final String prefix = carbonChat.getConfig().getString("pings.prefix", "");
final boolean caseSensitive = carbonChat.getConfig().getBoolean("pings.case-sensitive", false);
final String prefix = carbonChat.carbonSettings().pings().prefix();
final boolean caseSensitive = carbonChat.carbonSettings().pings().caseSensitive();
if (caseSensitive) {
if (!event.originalMessage().contains(prefix + targetName)) {
@@ -36,10 +36,10 @@ public class PingHandler {
}
}
final Key key = Key.of(carbonChat.getConfig().getString("pings.sound"));
final Sound.Source source = Sound.Source.valueOf(carbonChat.getConfig().getString("pings.source"));
final float volume = (float) carbonChat.getConfig().getDouble("pings.volume");
final float pitch = (float) carbonChat.getConfig().getDouble("pings.pitch");
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();
event.target().playSound(Sound.of(key, source, volume, pitch));
});
@@ -21,7 +21,7 @@ public class PlayerJoinListener {
user.nickname(user.nickname());
}
final String channel = carbonChat.getConfig().getString("channel-on-join");
final String channel = carbonChat.carbonSettings().channelOnJoin();
if (channel == null || channel.isEmpty()) {
return;
@@ -22,14 +22,14 @@ public class WhisperPingHandler {
return;
}
if (!carbonChat.getConfig().getBoolean("whisper.pings.enabled")) {
if (!carbonChat.carbonSettings().whisperPings().enabled()) {
return;
}
final Key key = Key.of(carbonChat.getConfig().getString("whisper.pings.sound"));
final Sound.Source source = Sound.Source.valueOf(carbonChat.getConfig().getString("whisper.pings.source"));
final float volume = (float) carbonChat.getConfig().getDouble("whisper.pings.volume");
final float pitch = (float) carbonChat.getConfig().getDouble("whisper.pings.pitch");
final Key key = carbonChat.carbonSettings().whisperPings().sound();
final Sound.Source source = carbonChat.carbonSettings().whisperPings().source();
final float volume = carbonChat.carbonSettings().whisperPings().volume();
final float pitch = carbonChat.carbonSettings().whisperPings().pitch();
event.sender().playSound(Sound.of(key, source, volume, pitch));
});
@@ -18,7 +18,6 @@ import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Type;
import java.util.Timer;
import java.util.TimerTask;