Change text color string to an unprintable character
Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com> Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
c113817b16
commit
8690a10474
@ -40,7 +40,7 @@ public class DrawLoop {
|
|||||||
int xOffset=0;
|
int xOffset=0;
|
||||||
PaletteColor currentCol = PaletteColor.NORMAL;
|
PaletteColor currentCol = PaletteColor.NORMAL;
|
||||||
for (int i=0;i<finalS.length();i++) {
|
for (int i=0;i<finalS.length();i++) {
|
||||||
if (finalS.charAt(i)=='%'&&i<finalS.length()-1) {
|
if (finalS.charAt(i)=='\u001a'&&i<finalS.length()-1) {
|
||||||
byte nextCol=Byte.parseByte(finalS.substring(i+1, finalS.indexOf(' ',i+1)));
|
byte nextCol=Byte.parseByte(finalS.substring(i+1, finalS.indexOf(' ',i+1)));
|
||||||
if (nextCol>=PaletteColor.values().length||nextCol<0) {
|
if (nextCol>=PaletteColor.values().length||nextCol<0) {
|
||||||
throw new ArrayIndexOutOfBoundsException("Chosen color %"+nextCol+" is not in range (Min:0, Max: "+(PaletteColor.values().length-1)+")");
|
throw new ArrayIndexOutOfBoundsException("Chosen color %"+nextCol+" is not in range (Min:0, Max: "+(PaletteColor.values().length-1)+")");
|
||||||
|
@ -37,7 +37,7 @@ public enum PaletteColor {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "%"+ordinal()+" ";
|
return "\u001a"+ordinal()+" ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user