Add support for non default colors to the text rendering for the book.

This commit is contained in:
alexbegt committed 2021-04-07 18:54:49 -04:00
1 parent 484acd8d25
commit add938780f
2 files changed
+6 -2

No files matched your search

@@ -11,6 +11,8 @@ public class TextData {
public String text;
public String color = "black";
public int rgbColor = 0;
public boolean useOldColor = true;
public boolean bold = false;
public boolean italic = false;
public boolean underlined = false;
@@ -73,7 +73,9 @@ public class TextDataRenderer {
String modifiers = "";
modifiers += TextFormatting.getValueByName(item.color);
if(item.useOldColor) {
modifiers += TextFormatting.getValueByName(item.color);
}
if (item.bold) {
modifiers += TextFormatting.BOLD;
@@ -107,7 +109,7 @@ public class TextDataRenderer {
}
String s = split[i];
drawScaledString(matrixStack, fr, modifiers + s, atX, atY, 0, item.dropshadow, item.scale);
drawScaledString(matrixStack, fr, modifiers + s, atX, atY, item.rgbColor, item.dropshadow, item.scale);
if (i < split.length - 1) {
atY += fr.FONT_HEIGHT;