Skip to content

Commit 965e31c

Browse files
committed
Properly handle colors on old versions
1 parent 440c1f0 commit 965e31c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/main/java/me/rayzr522/jsonmessage/JSONMessage.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,9 @@ public void actionbar(Player... players) {
211211
public JSONMessage color(ChatColor color) {
212212
if (!color.isColor())
213213
throw new IllegalArgumentException(color.name() + " is not a color.");
214-
return color(color.name().toLowerCase(), ChatColor.WHITE);
214+
215+
last().setColor(color);
216+
return this;
215217
}
216218

217219
/**
@@ -1014,6 +1016,15 @@ public ChatColor getColor() {
10141016
@Deprecated
10151017
public void setColor(ChatColor color) {
10161018
setColor(color == null ? null : color.name().toLowerCase());
1019+
setLegacyColor(color);
1020+
}
1021+
1022+
/**
1023+
* @param color The legacy ChatColor to set
1024+
* @deprecated Use {@link #setColor(String)} instead
1025+
*/
1026+
@Deprecated
1027+
public void setLegacyColor(ChatColor color) {
10171028
legacyColor = color;
10181029
}
10191030

0 commit comments

Comments
 (0)