Complete some TODOs

This commit is contained in:
Draycia committed 2020-10-15 02:14:52 -07:00
1 parent 548955134e
commit 4d547f80c7
27 files changed
+155 -67

No files matched your search

@@ -16,7 +16,7 @@ import java.util.Map;
import java.util.regex.Pattern;
@ConfigSerializable
public class CarbonSettings {
public final class CarbonSettings {
private static final ObjectMapper<CarbonSettings> MAPPER;
@@ -7,7 +7,7 @@ import org.spongepowered.configurate.objectmapping.ObjectMappingException;
import org.spongepowered.configurate.objectmapping.meta.Setting;
@ConfigSerializable
public class CarbonTranslations {
public final class CarbonTranslations {
private static final ObjectMapper<CarbonTranslations> MAPPER;
@@ -27,8 +27,9 @@ public class CarbonTranslations {
MAPPER.save(this, node);
}
@Setting
private String reloaded = "<yellow>Chat config has been reloaded!";
private ExceptionMessages exceptionMessages = new ExceptionMessages();
@Setting private String reloaded = "<yellow>Chat config has been reloaded!";
@Setting private String otherPlayerOffline = "<red>That player is offline!";
@Setting private String spyWhispers = "<yellow>Spy [<gray><sender><reset> <gold>-> <gray><target><reset><yellow>] <message>";
@Setting private String noReplyTarget = "<red>You have no one to reply to!";
@@ -64,6 +65,10 @@ public class CarbonTranslations {
@Setting private String clearExempt = "<yellow>You were exempt from the clear due to your permissions!";
@Setting private String cannotWhisperSelf = "<yellow>You cannot whisper yourself!";
public ExceptionMessages exceptionMessages() {
return this.exceptionMessages;
}
public String reloaded() {
return this.reloaded;
}
@@ -15,7 +15,7 @@ import java.util.List;
import java.util.Map;
@ConfigSerializable
public class ChannelOptions {
public final class ChannelOptions {
@Setting
@Comment("What this channel is identified as. This will be what's typed ingame to use the channel.")
@@ -11,7 +11,7 @@ import java.util.Collections;
import java.util.Map;
@ConfigSerializable
public class ChannelSettings {
public final class ChannelSettings {
private static final ObjectMapper<ChannelSettings> MAPPER;
@@ -0,0 +1,26 @@
package net.draycia.carbon.api.config;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.spongepowered.configurate.objectmapping.ConfigSerializable;
import org.spongepowered.configurate.objectmapping.meta.Setting;
@ConfigSerializable
public final class ExceptionMessages {
@Setting private @NonNull String channelNotFound = "Channel not found!";
@Setting private @NonNull String channelNotPublic = "Channel is not public!";
@Setting private @NonNull String playerNotFound = "Player not found!";
public String channelNotFound() {
return this.channelNotFound;
}
public String channelNotPublic() {
return this.channelNotPublic;
}
public String playerNotFound() {
return this.playerNotFound;
}
}
@@ -14,7 +14,7 @@ import java.util.Map;
import java.util.regex.Pattern;
@ConfigSerializable
public class ModerationSettings {
public final class ModerationSettings {
private static final ObjectMapper<ModerationSettings> MAPPER;
@@ -34,8 +34,8 @@ public class ModerationSettings {
MAPPER.save(this, node);
}
// TODO: comment this
@Setting
@Comment("The text that's prepended to someone else's shadowmuted messages.")
private String shadowMutePrefix = "[SM] ";
public String shadowMutePrefix() {
@@ -86,19 +86,19 @@ public class ModerationSettings {
@ConfigSerializable
public static class CapsProtection {
@Setting
@Comment("If caps protection is enabled")
@Comment("If caps protection is enabled")
private boolean enabled = true;
@Setting
@Comment("The minimum message length for caps protection to activate")
@Comment("The minimum message length for caps protection to activate")
private int minimumLength = 10;
@Setting
@Comment("The amount of letters in the message for it to trigger the protection")
@Comment("The amount of letters in the message for it to trigger the protection")
private float percentCaps = 0.80F;
@Setting
@Comment("If true, stops message from sending. If false, simply changes the message to lowercase")
@Comment("If true, stops message from sending. If false, simply changes the message to lowercase")
private boolean blockMessage = false;
public boolean enabled() {
@@ -127,12 +127,11 @@ public class ModerationSettings {
@ConfigSerializable
public static class Filters {
@Setting
private boolean enabled = true;
@Setting
@Comment("The keys (\"****\" for example) are what the text is replaced with.\n" +
@Comment("The keys (\"****\" for example) are what the text is replaced with.\n" +
"The strings in the lists (\"lag\" etc) are what's replaced.\n" +
"Set to filters: {} if you want to disable the filter feature.\n" +
"Set the key to \"_\" for the replacement to be blank (remove the filtered pattern).")
@@ -143,7 +142,7 @@ public class ModerationSettings {
};
@Setting
@Comment("Anything in blocked-words will prevent the message from being sent at all.\n" +
@Comment("Anything in blocked-words will prevent the message from being sent at all.\n" +
"Set to blocked-words: [] if you want to disable the blocked words feature.")
private List<Pattern> blockedPatterns = Collections.singletonList(Pattern.compile("pineapple doesn't belong on pizza"));
@@ -158,7 +157,6 @@ public class ModerationSettings {
public List<Pattern> blockedPatterns() {
return this.blockedPatterns;
}
}
}
@@ -6,7 +6,7 @@ import org.spongepowered.configurate.objectmapping.ConfigSerializable;
import org.spongepowered.configurate.objectmapping.meta.Setting;
@ConfigSerializable
public class RedisCredentials {
public final class RedisCredentials {
@Setting private @NonNull String host = "localhost";
@Setting private @Nullable String password = "";
@@ -5,7 +5,7 @@ import org.spongepowered.configurate.objectmapping.ConfigSerializable;
import org.spongepowered.configurate.objectmapping.meta.Setting;
@ConfigSerializable
public class SQLCredentials {
public final class SQLCredentials {
@Setting private @NonNull String username = "username";
@Setting private @NonNull String password = "password";
@@ -12,7 +12,7 @@ import java.util.List;
import java.util.Map;
@ConfigSerializable
public class SharedChannelOptions {
public final class SharedChannelOptions {
@Setting private String color = "#FFFFFF";
@Setting private Map<String, Context> contexts = new HashMap<>(); // TODO: set defaults
@@ -7,7 +7,7 @@ import org.spongepowered.configurate.objectmapping.meta.Comment;
import org.spongepowered.configurate.objectmapping.meta.Setting;
@ConfigSerializable
public class WhisperOptions {
public final class WhisperOptions {
@Setting
@Comment("Plays a sound when receiving private messages with /whisper /msg")