mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-11 17:15:07 +02:00
Moving all default messages back to the code, where they should be
Also tweaking I18n class and YamlStorageWriter a bit
This commit is contained in:
@@ -47,7 +47,7 @@ public class EssentialsConf extends YamlConfiguration
|
||||
{
|
||||
if (!configFile.getParentFile().mkdirs())
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, _("failedToCreateConfig", configFile.toString()));
|
||||
LOGGER.log(Level.SEVERE, _("Failed to create config {0}", configFile.toString()));
|
||||
}
|
||||
}
|
||||
// This will delete files where the first character is 0. In most cases they are broken.
|
||||
@@ -90,22 +90,22 @@ public class EssentialsConf extends YamlConfiguration
|
||||
{
|
||||
if (templateName != null)
|
||||
{
|
||||
LOGGER.log(Level.INFO, _("creatingConfigFromTemplate", configFile.toString()));
|
||||
LOGGER.log(Level.INFO, _("Creating config from template: {0}", configFile.toString()));
|
||||
createFromTemplate();
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
LOGGER.log(Level.INFO, _("creatingEmptyConfig", configFile.toString()));
|
||||
LOGGER.log(Level.INFO, _("Creating empty config: {0}", configFile.toString()));
|
||||
if (!configFile.createNewFile())
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, _("failedToCreateConfig", configFile.toString()));
|
||||
LOGGER.log(Level.SEVERE, _("Failed to create config {0}", configFile.toString()));
|
||||
}
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, _("failedToCreateConfig", configFile.toString()), ex);
|
||||
LOGGER.log(Level.SEVERE, _("Failed to create config {0}", configFile.toString()), ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -175,7 +175,7 @@ public class EssentialsConf extends YamlConfiguration
|
||||
istr = resourceClass.getResourceAsStream(templateName);
|
||||
if (istr == null)
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, _("couldNotFindTemplate", templateName));
|
||||
LOGGER.log(Level.SEVERE, _("Could not find template {0}", templateName));
|
||||
return;
|
||||
}
|
||||
ostr = new FileOutputStream(configFile);
|
||||
@@ -190,7 +190,7 @@ public class EssentialsConf extends YamlConfiguration
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, _("failedToWriteConfig", configFile.toString()), ex);
|
||||
LOGGER.log(Level.SEVERE, _("Failed to write config {0}", configFile.toString()), ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -214,7 +214,7 @@ public class EssentialsConf extends YamlConfiguration
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, _("failedToCloseConfig", configFile.toString()), ex);
|
||||
LOGGER.log(Level.SEVERE, _("Failed to close config {0}", configFile.toString()), ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -174,4 +174,4 @@ public interface ISettings
|
||||
public int getMailsPerMinute();
|
||||
|
||||
public void setEssentialsChatActive(boolean b);
|
||||
}
|
||||
}
|
||||
|
@@ -446,7 +446,7 @@ public final class Settings implements ISettings
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.log(Level.SEVERE, _("unknownItemInList", itemName, "item-spawn-blacklist"));
|
||||
logger.log(Level.SEVERE, _("Unknown item {0} in {1} list.", itemName, "item-spawn-blacklist"));
|
||||
}
|
||||
}
|
||||
return epItemSpwn;
|
||||
@@ -483,7 +483,7 @@ public final class Settings implements ISettings
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.log(Level.SEVERE, _("unknownItemInList", signName, "enabledSigns"));
|
||||
logger.log(Level.SEVERE, _("Unknown item {0} in {1} list.", signName, "enabledSigns"));
|
||||
continue;
|
||||
}
|
||||
signsEnabled = true;
|
||||
@@ -579,7 +579,7 @@ public final class Settings implements ISettings
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.log(Level.SEVERE, _("unknownItemInList", itemName, configName));
|
||||
logger.log(Level.SEVERE, _("Unknown item {0} in {1} list.", itemName, configName));
|
||||
}
|
||||
}
|
||||
return list;
|
||||
@@ -950,4 +950,4 @@ public final class Settings implements ISettings
|
||||
{
|
||||
return mailsPerMinute;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -794,4 +794,4 @@ public class UserData
|
||||
{
|
||||
config.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -108,4 +108,4 @@ public class Util
|
||||
}
|
||||
return input.substring(pos, pos + 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user