mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
Merge pull request #180 from romanalexander/master
Use unicode escapes instead of UTF8 file encoding.
This commit is contained in:
commit
f83003e080
@ -873,7 +873,7 @@ public class MainUtil {
|
|||||||
final char[] b = message.toCharArray();
|
final char[] b = message.toCharArray();
|
||||||
for (int i = 0; i < (b.length - 1); i++) {
|
for (int i = 0; i < (b.length - 1); i++) {
|
||||||
if ((b[i] == alt) && ("0123456789AaBbCcDdEeFfKkLlMmNnOoRr".indexOf(b[(i + 1)]) > -1)) {
|
if ((b[i] == alt) && ("0123456789AaBbCcDdEeFfKkLlMmNnOoRr".indexOf(b[(i + 1)]) > -1)) {
|
||||||
b[i] = '§';
|
b[i] = '\u00A7';
|
||||||
b[(i + 1)] = Character.toLowerCase(b[(i + 1)]);
|
b[(i + 1)] = Character.toLowerCase(b[(i + 1)]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -907,8 +907,8 @@ public class MainUtil {
|
|||||||
int lineColorChars = 0;
|
int lineColorChars = 0;
|
||||||
for (int i = 0; i < rawChars.length; i++) {
|
for (int i = 0; i < rawChars.length; i++) {
|
||||||
final char c = rawChars[i];
|
final char c = rawChars[i];
|
||||||
if (c == '§') {
|
if (c == '\u00A7') {
|
||||||
word.append('§' + (rawChars[(i + 1)]));
|
word.append('\u00A7' + (rawChars[(i + 1)]));
|
||||||
lineColorChars += 2;
|
lineColorChars += 2;
|
||||||
i++;
|
i++;
|
||||||
} else if ((c == ' ') || (c == '\n')) {
|
} else if ((c == ' ') || (c == '\n')) {
|
||||||
@ -945,16 +945,16 @@ public class MainUtil {
|
|||||||
if (line.length() > 0) {
|
if (line.length() > 0) {
|
||||||
lines.add(line.toString());
|
lines.add(line.toString());
|
||||||
}
|
}
|
||||||
if ((lines.get(0).length() == 0) || (lines.get(0).charAt(0) != '§')) {
|
if ((lines.get(0).length() == 0) || (lines.get(0).charAt(0) != '\u00A7')) {
|
||||||
lines.set(0, "§f" + lines.get(0));
|
lines.set(0, "\u00A7f" + lines.get(0));
|
||||||
}
|
}
|
||||||
for (int i = 1; i < lines.size(); i++) {
|
for (int i = 1; i < lines.size(); i++) {
|
||||||
final String pLine = lines.get(i - 1);
|
final String pLine = lines.get(i - 1);
|
||||||
final String subLine = lines.get(i);
|
final String subLine = lines.get(i);
|
||||||
|
|
||||||
final char color = pLine.charAt(pLine.lastIndexOf('§') + 1);
|
final char color = pLine.charAt(pLine.lastIndexOf('\u00A7') + 1);
|
||||||
if ((subLine.length() == 0) || (subLine.charAt(0) != '§')) {
|
if ((subLine.length() == 0) || (subLine.charAt(0) != '\u00A7')) {
|
||||||
lines.set(i, '§' + (color) + subLine);
|
lines.set(i, '\u00A7' + (color) + subLine);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return lines.toArray(new String[lines.size()]);
|
return lines.toArray(new String[lines.size()]);
|
||||||
|
Loading…
Reference in New Issue
Block a user