mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-27 20:58:40 +01:00
Add essentials RGB hex parsing
This commit is contained in:
parent
feb29208a6
commit
507dfcefc5
@ -225,6 +225,26 @@ public class Client {
|
|||||||
spancnt++;
|
spancnt++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
else if (c == 'x') { // Essentials nickname hexcode format
|
||||||
|
if (i + 12 <= cnt){ // Check if string is at least long enough to be valid hexcode
|
||||||
|
if (s.charAt(i+1) == s.charAt(i+3) &&
|
||||||
|
s.charAt(i+1) == s.charAt(i+5) &&
|
||||||
|
s.charAt(i+1) == s.charAt(i+7) &&
|
||||||
|
s.charAt(i+1) == s.charAt(i+9) &&
|
||||||
|
s.charAt(i+1) == s.charAt(i+11) && // Check if there are enough \u00A7 in a row
|
||||||
|
s.charAt(i+1) == '\u00A7'){
|
||||||
|
StringBuilder hex = new StringBuilder().append(s.charAt(i+2))
|
||||||
|
.append(s.charAt(i+4))
|
||||||
|
.append(s.charAt(i+6))
|
||||||
|
.append(s.charAt(i+8))
|
||||||
|
.append(s.charAt(i+10))
|
||||||
|
.append(s.charAt(i+12)); // Build hexcode string
|
||||||
|
sb.append("<span style=\'color:#" + hex + "\'>"); // Substitute with hexcode
|
||||||
|
i = i + 12; //move past hex codes
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (c == '&') { // Essentials color code?
|
else if (c == '&') { // Essentials color code?
|
||||||
|
Loading…
Reference in New Issue
Block a user