invalid symbols?

This commit is contained in:
boy0001 2014-11-09 09:34:46 +11:00
parent 77ee6d2b81
commit 7e208afbe2
4 changed files with 4 additions and 13 deletions

View File

@ -38,7 +38,7 @@ public class Flag {
* @throws IllegalArgumentException if you provide inadequate inputs
*/
public Flag(final AbstractFlag key, final String value) {
final char[] allowedCharacters = new char[]{'[', ']', '(', ')', ',', '_', '-', '.', ',', '?', '!', '&', '<EFBFBD>'};
final char[] allowedCharacters = new char[]{'[', ']', '(', ')', ',', '_', '-', '.', ',', '?', '!', '&', ':', '};
String tempValue = value;
for (final char c : allowedCharacters) {
tempValue = tempValue.replace(c, 'c');

View File

@ -179,16 +179,7 @@ public class WorldGenerator extends PlotGenerator {
super(world);
if (this.plotworld == null) {
this.plotworld = new DefaultPlotWorld(world);
if (!PlotMain.config.contains("worlds." + world)) {
PlotMain.config = YamlConfiguration.loadConfiguration(PlotMain.configFile);
PlotMain.config.createSection("worlds." + world);
}
final ConfigurationSection section = PlotMain.config.getConfigurationSection("worlds." + world);
this.plotworld.saveConfiguration(section);
this.plotworld.loadDefaultConfiguration(section);
this.plotworld.loadConfiguration(section);
PlotMain.sendConsoleSenderMessage("&cFailed to load the plotworld settings from the configuration. Attempting to reload it");
this.plotworld = (DefaultPlotWorld) PlotMain.getWorldSettings(world);
}
this.plotsize = this.plotworld.PLOT_WIDTH;

View File

@ -21,7 +21,7 @@ public class TranslationObject {
creationDescription = "";
}
for (char c : key.toCharArray()) {
if (!Character.isDigit(c) && !Character.isAlphabetic(c) && c != '_' && c != '&' && c != '§' && c != ':') {
if (!Character.isDigit(c) && !Character.isAlphabetic(c) && c != '_' && c != '&' && c != '§' && c != ':') {
throw new RuntimeException(
String.format("Translation: '%s' is invalid (Character: '%s') - Only alphanumeric + (\\, _, &, §, :) charcters are allowed",
key, c + ""

View File

@ -23,7 +23,7 @@ public class BukkitTranslation {
public static String convert(TranslationAsset asset) {
// In some cases newline can screw stuff up, so I added a new character thing
// &- = new line
return asset.getTranslated().replace("&-", "\n").replace('&', '§');
return asset.getTranslated().replace("&-", "\n").replace('&', '§');
}
/**