Skip to content

Commit

Permalink
fix &color tag bork
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jul 2, 2020
1 parent b12fc36 commit fcb45da
Showing 1 changed file with 2 additions and 3 deletions.
Expand Up @@ -625,16 +625,15 @@ public void run(ReplaceableTagEvent event) {
}
}
else if (colorName.length() == 7 && colorName.startsWith("#")) {
event.setReplacedObject(new ElementTag(ChatColor.COLOR_CHAR + "[color=" + colorName + "]").getObjectAttribute(attribute.fulfill(1)));
return;
colorOut = ChatColor.COLOR_CHAR + "[color=" + colorName + "]";
}
else if (colorName.startsWith("co@")) {
ColorTag color = ColorTag.valueOf(colorName, attribute.context);
String hex = Integer.toHexString(color.getColor().asRGB());
while (hex.length() < 6) {
hex = "0" + hex;
}
event.setReplacedObject(new ElementTag(ChatColor.COLOR_CHAR + "[color=#" + hex + "]").getObjectAttribute(attribute.fulfill(1)));
colorOut = ChatColor.COLOR_CHAR + "[color=#" + hex + "]";
}
if (colorOut == null) {
try {
Expand Down

0 comments on commit fcb45da

Please sign in to comment.