mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-21 22:06:22 +02:00
fix some encoding issues for §
Don't attempt to close on null objects
This commit is contained in:
@@ -180,7 +180,7 @@ public class SpawnsHolder extends AsyncStorageObjectHolder<Spawns> implements IE
|
|||||||
acquireReadLock();
|
acquireReadLock();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return getData().getNewPlayerAnnouncement().replace('&', '<EFBFBD>').replace("<EFBFBD><EFBFBD>", "&").replace("{PLAYER}", user.getDisplayName()).replace("{DISPLAYNAME}", user.getDisplayName()).replace("{GROUP}", ess.getRanks().getMainGroup(user)).replace("{USERNAME}", user.getName()).replace("{ADDRESS}", user.getAddress().toString());
|
return getData().getNewPlayerAnnouncement().replace('&', '§').replace("§§", "&").replace("{PLAYER}", user.getDisplayName()).replace("{DISPLAYNAME}", user.getDisplayName()).replace("{GROUP}", ess.getRanks().getMainGroup(user)).replace("{USERNAME}", user.getName()).replace("{ADDRESS}", user.getAddress().toString());
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
@@ -85,9 +85,9 @@ public class TextInput implements IText
|
|||||||
if (line.length() > 0 && line.charAt(0) == '#')
|
if (line.length() > 0 && line.charAt(0) == '#')
|
||||||
{
|
{
|
||||||
bookmarks.put(line.substring(1).toLowerCase(Locale.ENGLISH).replaceAll("&[0-9a-fk]", ""), lineNumber);
|
bookmarks.put(line.substring(1).toLowerCase(Locale.ENGLISH).replaceAll("&[0-9a-fk]", ""), lineNumber);
|
||||||
chapters.add(line.substring(1).replace('&', '<EFBFBD>').replace("<EFBFBD>", "&"));
|
chapters.add(line.substring(1).replace('&', '§').replace("§", "&"));
|
||||||
}
|
}
|
||||||
lines.add(line.replace('&', '<EFBFBD>').replace("<EFBFBD>", "&"));
|
lines.add(line.replace('&', '§').replace("§", "&"));
|
||||||
lineNumber++;
|
lineNumber++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -119,7 +119,9 @@ public class TextInput implements IText
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if(output != null)
|
||||||
output.close();
|
output.close();
|
||||||
|
if(input != null)
|
||||||
input.close();
|
input.close();
|
||||||
}
|
}
|
||||||
throw new FileNotFoundException("File " + filename + ".txt does not exist. Creating one for you.");
|
throw new FileNotFoundException("File " + filename + ".txt does not exist. Creating one for you.");
|
||||||
|
Reference in New Issue
Block a user