mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-02 06:28:54 +00:00
Fix format getting and message parsing
This commit is contained in:
1 parent
901e243d1e
commit
c79c1bcbee
2 files changed
+16
-3
No files matched your search
@@ -81,10 +81,23 @@ public class ChannelOptions {
|
||||
return this.contexts;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String format(final String key) {
|
||||
if (this.formats == null) {
|
||||
return this.defaultOptions().formats().get(key);
|
||||
}
|
||||
|
||||
final String format = this.formats.get(key);
|
||||
|
||||
if (format != null) {
|
||||
return format;
|
||||
}
|
||||
|
||||
return this.defaultOptions().formats().get(key);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Map<String, String> formats() {
|
||||
// TODO: properly implement default format inheritence
|
||||
// TODO: perhaps add an option to make it so overriding any format overrides all?
|
||||
if (this.formats == null) {
|
||||
return this.defaultOptions().formats();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user