Allow special color code to be false

This commit is contained in:
Felix Cravic 2020-07-03 20:28:07 +02:00
parent 2b021e26c1
commit 5460d8e6c4

View File

@ -251,29 +251,19 @@ public class ColoredText {
object.addProperty("color", color);
}
if (specialComponentContainer.bold) {
object.addProperty("bold", "true");
}
if (specialComponentContainer.italic) {
object.addProperty("italic", "true");
}
if (specialComponentContainer.underlined) {
object.addProperty("underlined", "true");
}
if (specialComponentContainer.strikethrough) {
object.addProperty("strikethrough", "true");
}
if (specialComponentContainer.obfuscated) {
object.addProperty("obfuscated", "true");
}
object.addProperty("bold", getBoolean(specialComponentContainer.bold));
object.addProperty("italic", getBoolean(specialComponentContainer.italic));
object.addProperty("underlined", getBoolean(specialComponentContainer.underlined));
object.addProperty("strikethrough", getBoolean(specialComponentContainer.strikethrough));
object.addProperty("obfuscated", getBoolean(specialComponentContainer.obfuscated));
return object;
}
private String getBoolean(boolean value) {
return value ? "true" : "false";
}
private enum MessageType {
RAW, KEYBIND, TRANSLATABLE
}