Skip to content
Permalink
Browse files

Future Java versions may not support _ as identifier.

  • Loading branch information...
FearFree authored and chrisgward committed Mar 20, 2014
1 parent 7266908 commit 51bd0d88f393dbd675d2227e84d24fe9d6313712
Showing with 1,032 additions and 1,028 deletions.
  1. +3 −3 Essentials/src/com/earth2me/essentials/Backup.java
  2. +22 −24 Essentials/src/com/earth2me/essentials/Essentials.java
  3. +10 −10 Essentials/src/com/earth2me/essentials/EssentialsConf.java
  4. +2 −2 Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java
  5. +11 −11 Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
  6. +12 −12 Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java
  7. +1 −1 Essentials/src/com/earth2me/essentials/I18n.java
  8. +5 −5 Essentials/src/com/earth2me/essentials/ItemDb.java
  9. +11 −11 Essentials/src/com/earth2me/essentials/Jails.java
  10. +11 −11 Essentials/src/com/earth2me/essentials/Kit.java
  11. +2 −2 Essentials/src/com/earth2me/essentials/ManagedFile.java
  12. +20 −20 Essentials/src/com/earth2me/essentials/MetaItemStack.java
  13. +2 −2 Essentials/src/com/earth2me/essentials/Mob.java
  14. +4 −4 Essentials/src/com/earth2me/essentials/MobData.java
  15. +93 −74 Essentials/src/com/earth2me/essentials/OfflinePlayer.java
  16. +7 −7 Essentials/src/com/earth2me/essentials/PlayerList.java
  17. +4 −4 Essentials/src/com/earth2me/essentials/Settings.java
  18. +12 −12 Essentials/src/com/earth2me/essentials/SpawnMob.java
  19. +10 −10 Essentials/src/com/earth2me/essentials/Teleport.java
  20. +6 −8 Essentials/src/com/earth2me/essentials/TimedTeleport.java
  21. +9 −9 Essentials/src/com/earth2me/essentials/Trade.java
  22. +15 −16 Essentials/src/com/earth2me/essentials/User.java
  23. +2 −2 Essentials/src/com/earth2me/essentials/UserData.java
  24. +6 −6 Essentials/src/com/earth2me/essentials/Warps.java
  25. +6 −6 Essentials/src/com/earth2me/essentials/Worth.java
  26. +2 −2 Essentials/src/com/earth2me/essentials/api/Economy.java
  27. +2 −2 Essentials/src/com/earth2me/essentials/api/InvalidWorldException.java
  28. +2 −2 Essentials/src/com/earth2me/essentials/api/UserDoesNotExistException.java
  29. +3 −3 Essentials/src/com/earth2me/essentials/commands/Commandafk.java
  30. +3 −3 Essentials/src/com/earth2me/essentials/commands/Commandback.java
  31. +4 −4 Essentials/src/com/earth2me/essentials/commands/Commandbackup.java
  32. +4 −4 Essentials/src/com/earth2me/essentials/commands/Commandbalance.java
  33. +5 −6 Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java
  34. +9 −9 Essentials/src/com/earth2me/essentials/commands/Commandban.java
  35. +3 −3 Essentials/src/com/earth2me/essentials/commands/Commandbanip.java
  36. +3 −3 Essentials/src/com/earth2me/essentials/commands/Commandbigtree.java
  37. +9 −9 Essentials/src/com/earth2me/essentials/commands/Commandbook.java
  38. +2 −2 Essentials/src/com/earth2me/essentials/commands/Commandbreak.java
  39. +2 −2 Essentials/src/com/earth2me/essentials/commands/Commandbroadcast.java
  40. +2 −2 Essentials/src/com/earth2me/essentials/commands/Commandburn.java
  41. +8 −8 Essentials/src/com/earth2me/essentials/commands/Commandclearinventory.java
  42. +2 −2 Essentials/src/com/earth2me/essentials/commands/Commandcompass.java
  43. +3 −3 Essentials/src/com/earth2me/essentials/commands/Commanddelhome.java
  44. +2 −2 Essentials/src/com/earth2me/essentials/commands/Commanddeljail.java
  45. +2 −2 Essentials/src/com/earth2me/essentials/commands/Commanddelwarp.java
  46. +4 −4 Essentials/src/com/earth2me/essentials/commands/Commanddepth.java
  47. +7 −9 Essentials/src/com/earth2me/essentials/commands/Commandeco.java
  48. +5 −5 Essentials/src/com/earth2me/essentials/commands/Commandenchant.java
  49. +5 −5 Essentials/src/com/earth2me/essentials/commands/Commandessentials.java
  50. +3 −3 Essentials/src/com/earth2me/essentials/commands/Commandexp.java
  51. +3 −3 Essentials/src/com/earth2me/essentials/commands/Commandext.java
  52. +3 −3 Essentials/src/com/earth2me/essentials/commands/Commandfeed.java
  53. +9 −9 Essentials/src/com/earth2me/essentials/commands/Commandfirework.java
  54. +3 −3 Essentials/src/com/earth2me/essentials/commands/Commandfly.java
  55. +4 −4 Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java
  56. +7 −7 Essentials/src/com/earth2me/essentials/commands/Commandgc.java
  57. +8 −8 Essentials/src/com/earth2me/essentials/commands/Commandgetpos.java
  58. +5 −5 Essentials/src/com/earth2me/essentials/commands/Commandgive.java
  59. +3 −3 Essentials/src/com/earth2me/essentials/commands/Commandgod.java
  60. +6 −6 Essentials/src/com/earth2me/essentials/commands/Commandhat.java
  61. +4 −4 Essentials/src/com/earth2me/essentials/commands/Commandheal.java
  62. +2 −2 Essentials/src/com/earth2me/essentials/commands/Commandhelp.java
  63. +2 −2 Essentials/src/com/earth2me/essentials/commands/Commandhelpop.java
  64. +7 −7 Essentials/src/com/earth2me/essentials/commands/Commandhome.java
  65. +5 −5 Essentials/src/com/earth2me/essentials/commands/Commandignore.java
  66. +4 −4 Essentials/src/com/earth2me/essentials/commands/Commanditem.java
  67. +4 −4 Essentials/src/com/earth2me/essentials/commands/Commanditemdb.java
  68. +2 −2 Essentials/src/com/earth2me/essentials/commands/Commandjump.java
  69. +5 −5 Essentials/src/com/earth2me/essentials/commands/Commandkick.java
  70. +3 −3 Essentials/src/com/earth2me/essentials/commands/Commandkickall.java
  71. +3 −3 Essentials/src/com/earth2me/essentials/commands/Commandkill.java
  72. +9 −9 Essentials/src/com/earth2me/essentials/commands/Commandkit.java
  73. +3 −3 Essentials/src/com/earth2me/essentials/commands/Commandlightning.java
  74. +3 −3 Essentials/src/com/earth2me/essentials/commands/Commandlist.java
  75. +19 −19 Essentials/src/com/earth2me/essentials/commands/Commandmail.java
  76. +4 −4 Essentials/src/com/earth2me/essentials/commands/Commandme.java
  77. +4 −4 Essentials/src/com/earth2me/essentials/commands/Commandmore.java
  78. +8 −8 Essentials/src/com/earth2me/essentials/commands/Commandmsg.java
  79. +11 −11 Essentials/src/com/earth2me/essentials/commands/Commandmute.java
  80. +5 −5 Essentials/src/com/earth2me/essentials/commands/Commandnear.java
  81. +12 −12 Essentials/src/com/earth2me/essentials/commands/Commandnick.java
  82. +2 −2 Essentials/src/com/earth2me/essentials/commands/Commandnuke.java
  83. +2 −2 Essentials/src/com/earth2me/essentials/commands/Commandpay.java
  84. +2 −2 Essentials/src/com/earth2me/essentials/commands/Commandping.java
  85. +4 −4 Essentials/src/com/earth2me/essentials/commands/Commandpotion.java
  86. +12 −12 Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java
  87. +4 −4 Essentials/src/com/earth2me/essentials/commands/Commandpowertooltoggle.java
  88. +9 −9 Essentials/src/com/earth2me/essentials/commands/Commandptime.java
  89. +8 −8 Essentials/src/com/earth2me/essentials/commands/Commandpweather.java
  90. +4 −4 Essentials/src/com/earth2me/essentials/commands/Commandr.java
  91. +2 −2 Essentials/src/com/earth2me/essentials/commands/Commandrealname.java
  92. +15 −15 Essentials/src/com/earth2me/essentials/commands/Commandrecipe.java
  93. +4 −4 Essentials/src/com/earth2me/essentials/commands/Commandremove.java
  94. +8 −8 Essentials/src/com/earth2me/essentials/commands/Commandrepair.java
  95. +20 −20 Essentials/src/com/earth2me/essentials/commands/Commandseen.java
  96. +7 −7 Essentials/src/com/earth2me/essentials/commands/Commandsell.java
  97. +4 −4 Essentials/src/com/earth2me/essentials/commands/Commandsethome.java
  98. +2 −2 Essentials/src/com/earth2me/essentials/commands/Commandsetjail.java
  99. +4 −4 Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java
  100. +3 −3 Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java
  101. +6 −11 Essentials/src/com/earth2me/essentials/commands/Commandskull.java
  102. +3 −3 Essentials/src/com/earth2me/essentials/commands/Commandsocialspy.java
  103. +8 −8 Essentials/src/com/earth2me/essentials/commands/Commandspawner.java
  104. +4 −4 Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java
  105. +5 −5 Essentials/src/com/earth2me/essentials/commands/Commandspeed.java
  106. +5 −5 Essentials/src/com/earth2me/essentials/commands/Commandsudo.java
  107. +3 −3 Essentials/src/com/earth2me/essentials/commands/Commandsuicide.java
  108. +6 −6 Essentials/src/com/earth2me/essentials/commands/Commandtempban.java
  109. +3 −3 Essentials/src/com/earth2me/essentials/commands/Commandthunder.java
  110. +5 −5 Essentials/src/com/earth2me/essentials/commands/Commandtime.java
  111. +10 −10 Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java
  112. +2 −2 Essentials/src/com/earth2me/essentials/commands/Commandtop.java
  113. +17 −17 Essentials/src/com/earth2me/essentials/commands/Commandtp.java
  114. +8 −8 Essentials/src/com/earth2me/essentials/commands/Commandtpa.java
  115. +5 −5 Essentials/src/com/earth2me/essentials/commands/Commandtpaall.java
  116. +11 −11 Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java
  117. +8 −8 Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java
  118. +2 −2 Essentials/src/com/earth2me/essentials/commands/Commandtpall.java
  119. +4 −4 Essentials/src/com/earth2me/essentials/commands/Commandtpdeny.java
  120. +3 −3 Essentials/src/com/earth2me/essentials/commands/Commandtphere.java
  121. +5 −5 Essentials/src/com/earth2me/essentials/commands/Commandtpo.java
  122. +2 −2 Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java
  123. +6 −6 Essentials/src/com/earth2me/essentials/commands/Commandtppos.java
  124. +3 −3 Essentials/src/com/earth2me/essentials/commands/Commandtptoggle.java
  125. +3 −3 Essentials/src/com/earth2me/essentials/commands/Commandtree.java
  126. +4 −4 Essentials/src/com/earth2me/essentials/commands/Commandunban.java
  127. +3 −3 Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java
  128. +6 −6 Essentials/src/com/earth2me/essentials/commands/Commandunlimited.java
  129. +4 −4 Essentials/src/com/earth2me/essentials/commands/Commandvanish.java
  130. +7 −7 Essentials/src/com/earth2me/essentials/commands/Commandwarp.java
  131. +10 −10 Essentials/src/com/earth2me/essentials/commands/Commandweather.java
  132. +21 −21 Essentials/src/com/earth2me/essentials/commands/Commandwhois.java
  133. +5 −5 Essentials/src/com/earth2me/essentials/commands/Commandworld.java
  134. +6 −6 Essentials/src/com/earth2me/essentials/commands/Commandworth.java
  135. +2 −2 Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java
  136. +2 −2 Essentials/src/com/earth2me/essentials/commands/PlayerNotFoundException.java
  137. +2 −2 Essentials/src/com/earth2me/essentials/commands/WarpNotFoundException.java
  138. +8 −9 Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java
  139. +2 −2 Essentials/src/com/earth2me/essentials/signs/SignBalance.java
  140. +9 −9 Essentials/src/com/earth2me/essentials/signs/SignEnchant.java
  141. +2 −3 Essentials/src/com/earth2me/essentials/signs/SignFree.java
  142. +4 −4 Essentials/src/com/earth2me/essentials/signs/SignGameMode.java
  143. +3 −3 Essentials/src/com/earth2me/essentials/signs/SignHeal.java
  144. +3 −3 Essentials/src/com/earth2me/essentials/signs/SignKit.java
  145. +3 −3 Essentials/src/com/earth2me/essentials/signs/SignMail.java
  146. +5 −5 Essentials/src/com/earth2me/essentials/signs/SignProtection.java
  147. +2 −2 Essentials/src/com/earth2me/essentials/signs/SignRepair.java
  148. +3 −3 Essentials/src/com/earth2me/essentials/signs/SignTime.java
  149. +14 −14 Essentials/src/com/earth2me/essentials/signs/SignTrade.java
  150. +2 −2 Essentials/src/com/earth2me/essentials/signs/SignWarp.java
  151. +3 −3 Essentials/src/com/earth2me/essentials/signs/SignWeather.java
  152. +2 −2 Essentials/src/com/earth2me/essentials/textreader/BookPager.java
  153. +10 −10 Essentials/src/com/earth2me/essentials/textreader/HelpInput.java
  154. +2 −2 Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java
  155. +7 −7 Essentials/src/com/earth2me/essentials/textreader/TextPager.java
  156. +4 −4 Essentials/src/com/earth2me/essentials/utils/DateUtil.java
  157. +2 −2 Essentials/src/com/earth2me/essentials/utils/DescParseTickFormat.java
  158. +3 −3 Essentials/src/com/earth2me/essentials/utils/LocationUtil.java
  159. +2 −2 Essentials/src/com/earth2me/essentials/utils/NumberUtil.java
  160. +2 −2 Essentials/src/net/ess3/api/InvalidWorldException.java
  161. +2 −2 Essentials/src/net/ess3/api/MaxMoneyException.java
  162. +2 −2 Essentials/src/net/ess3/api/NoLoanPermittedException.java
  163. +2 −2 Essentials/src/net/ess3/api/UserDoesNotExistException.java
  164. +2 −2 Essentials/src/net/ess3/api/events/LocalChatSpyEvent.java
  165. +15 −15 EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java
  166. +3 −3 EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsConnect.java
  167. +2 −2 EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java
  168. +6 −6 EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerNormal.java
  169. +2 −2 EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIP.java
  170. +8 −8 EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java
  171. +2 −2 EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java
  172. +2 −2 EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandsetspawn.java
  173. +4 −4 EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java
  174. +2 −2 EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawn.java
  175. +2 −2 EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java
  176. +2 −2 EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java
@@ -1,6 +1,6 @@
package com.earth2me.essentials;

import static com.earth2me.essentials.I18n._;
import static com.earth2me.essentials.I18n.tl;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
@@ -86,7 +86,7 @@ public void run()
active = false;
return;
}
LOGGER.log(Level.INFO, _("backupStarted"));
LOGGER.log(Level.INFO, tl("backupStarted"));
final CommandSender cs = server.getConsoleSender();
server.dispatchCommand(cs, "save-all");
server.dispatchCommand(cs, "save-off");
@@ -157,7 +157,7 @@ public void run()
stopTask();
}
active = false;
LOGGER.log(Level.INFO, _("backupFinished"));
LOGGER.log(Level.INFO, tl("backupFinished"));
}
});
}
@@ -17,7 +17,7 @@
*/
package com.earth2me.essentials;

import static com.earth2me.essentials.I18n._;
import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.commands.EssentialsCommand;
import com.earth2me.essentials.commands.IEssentialsCommand;
import com.earth2me.essentials.commands.NoChargeException;
@@ -58,9 +58,7 @@
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.PluginCommand;
import org.bukkit.command.SimpleCommandMap;
import org.bukkit.command.TabCompleter;
import org.bukkit.command.defaults.VanillaCommand;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
@@ -100,7 +98,7 @@
private transient I18n i18n;
private transient Metrics metrics;
private transient EssentialsTimer timer;
private transient List<String> vanishedPlayers = new ArrayList<String>();
private final transient List<String> vanishedPlayers = new ArrayList<String>();

public Essentials()
{
@@ -131,7 +129,7 @@ public void setupForTesting(final Server server) throws IOException, InvalidDesc
}
i18n = new I18n(this);
i18n.onEnable();
LOGGER.log(Level.INFO, _("usingTempFolderForTesting"));
LOGGER.log(Level.INFO, tl("usingTempFolderForTesting"));
LOGGER.log(Level.INFO, dataFolder.toString());
this.initialize(null, server, new PluginDescriptionFile(new FileReader(new File("src" + File.separator + "plugin.yml"))), dataFolder, null, null);
settings = new Settings(this);
@@ -159,7 +157,7 @@ public void onEnable()
&& !plugin.getDescription().getVersion().equals(this.getDescription().getVersion())
&& !plugin.getDescription().getName().equals("EssentialsAntiCheat"))
{
LOGGER.log(Level.WARNING, _("versionMismatch", plugin.getDescription().getName()));
LOGGER.log(Level.WARNING, tl("versionMismatch", plugin.getDescription().getName()));
}
}
final Matcher versionMatch = Pattern.compile("git-Bukkit-(?:(?:[0-9]+)\\.)+[0-9]+-R[\\.0-9]+-(?:[0-9]+-g[0-9a-f]+-)?b([0-9]+)jnks.*").matcher(getServer().getVersion());
@@ -175,7 +173,7 @@ public void onEnable()
}
else
{
LOGGER.log(Level.INFO, _("bukkitFormatChanged"));
LOGGER.log(Level.INFO, tl("bukkitFormatChanged"));
LOGGER.log(Level.INFO, getServer().getVersion());
LOGGER.log(Level.INFO, getServer().getBukkitVersion());
}
@@ -211,11 +209,11 @@ public void onEnable()
{
if (pm.getPlugin("EssentialsUpdate") != null)
{
LOGGER.log(Level.SEVERE, _("essentialsHelp2"));
LOGGER.log(Level.SEVERE, tl("essentialsHelp2"));
}
else
{
LOGGER.log(Level.SEVERE, _("essentialsHelp1"));
LOGGER.log(Level.SEVERE, tl("essentialsHelp1"));
}
handleCrash(exception);
return;
@@ -244,7 +242,7 @@ else if (metricsStarter.getStart() != null && metricsStarter.getStart() == false
final String timeroutput = execTimer.end();
if (getSettings().isDebug())
{
LOGGER.log(Level.INFO, "Essentials load " + timeroutput);
LOGGER.log(Level.INFO, "Essentials load {0}", timeroutput);
}
}
catch (NumberFormatException ex)
@@ -312,7 +310,7 @@ public void onDisable()
if (user.isVanished())
{
user.setVanished(false);
user.sendMessage(_("unvanishedReload"));
user.sendMessage(tl("unvanishedReload"));
}
}
cleanupOpenInventories();
@@ -441,7 +439,7 @@ else if (user == null)
final List<String> mail = user.getMails();
if (mail != null && !mail.isEmpty())
{
user.sendMessage(_("youHaveNewMail", mail.size()));
user.sendMessage(tl("youHaveNewMail", mail.size()));
}
}

@@ -467,28 +465,28 @@ else if (user == null)
}
catch (Exception ex)
{
sender.sendMessage(_("commandNotLoaded", commandLabel));
LOGGER.log(Level.SEVERE, _("commandNotLoaded", commandLabel), ex);
sender.sendMessage(tl("commandNotLoaded", commandLabel));
LOGGER.log(Level.SEVERE, tl("commandNotLoaded", commandLabel), ex);
return true;
}

// Check authorization
if (user != null && !user.isAuthorized(cmd, permissionPrefix))
{
LOGGER.log(Level.INFO, _("deniedAccessCommand", user.getName()));
user.sendMessage(_("noAccessCommand"));
LOGGER.log(Level.INFO, tl("deniedAccessCommand", user.getName()));
user.sendMessage(tl("noAccessCommand"));
return true;
}

if (user != null && user.isJailed() && !user.isAuthorized(cmd, "essentials.jail.allow."))
{
if (user.getJailTimeout() > 0)
{
user.sendMessage(_("playerJailedFor", user.getName(), DateUtil.formatDateDiff(user.getJailTimeout())));
user.sendMessage(tl("playerJailedFor", user.getName(), DateUtil.formatDateDiff(user.getJailTimeout())));
}
else
{
user.sendMessage(_("jailMessage"));
user.sendMessage(tl("jailMessage"));
}
return true;
}
@@ -532,7 +530,7 @@ else if (user == null)
}
catch (Throwable ex)
{
LOGGER.log(Level.SEVERE, _("commandFailed", commandLabel), ex);
LOGGER.log(Level.SEVERE, tl("commandFailed", commandLabel), ex);
return true;
}
}
@@ -560,18 +558,18 @@ public void cleanupOpenInventories()
@Override
public void showError(final CommandSource sender, final Throwable exception, final String commandLabel)
{
sender.sendMessage(_("errorWithMessage", exception.getMessage()));
sender.sendMessage(tl("errorWithMessage", exception.getMessage()));
if (getSettings().isDebug())
{
LOGGER.log(Level.WARNING, _("errorCallingCommand", commandLabel), exception);
LOGGER.log(Level.WARNING, tl("errorCallingCommand", commandLabel), exception);
}
}

public static void wrongVersion()
{
LOGGER.log(Level.SEVERE, " * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! *");
LOGGER.log(Level.SEVERE, _("notRecommendedBukkit"));
LOGGER.log(Level.SEVERE, _("requiredBukkit", Integer.toString(BUKKIT_VERSION)));
LOGGER.log(Level.SEVERE, tl("notRecommendedBukkit"));
LOGGER.log(Level.SEVERE, tl("requiredBukkit", Integer.toString(BUKKIT_VERSION)));
LOGGER.log(Level.SEVERE, " * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! *");
}

@@ -672,7 +670,7 @@ public User getUser(final Player base)
{
if (getSettings().isDebug())
{
LOGGER.log(Level.INFO, "Constructing new userfile from base player " + base.getName());
LOGGER.log(Level.INFO, "Constructing new userfile from base player {0}", base.getName());
}
user = new User(base, this);
}
@@ -1,6 +1,6 @@
package com.earth2me.essentials;

import static com.earth2me.essentials.I18n._;
import static com.earth2me.essentials.I18n.tl;
import com.google.common.io.Files;
import java.io.*;
import java.math.BigDecimal;
@@ -50,14 +50,14 @@ public synchronized void load()
{
if (pendingDiskWrites.get() != 0)
{
LOGGER.log(Level.INFO, "File " + configFile + " not read, because it's not yet written to disk.");
LOGGER.log(Level.INFO, "File {0} not read, because it''s not yet written to disk.", configFile);
return;
}
if (!configFile.getParentFile().exists())
{
if (!configFile.getParentFile().mkdirs())
{
LOGGER.log(Level.SEVERE, _("failedToCreateConfig", configFile.toString()));
LOGGER.log(Level.SEVERE, tl("failedToCreateConfig", configFile.toString()));
}
}
// This will delete files where the first character is 0. In most cases they are broken.
@@ -100,7 +100,7 @@ public synchronized void load()
{
if (templateName != null)
{
LOGGER.log(Level.INFO, _("creatingConfigFromTemplate", configFile.toString()));
LOGGER.log(Level.INFO, tl("creatingConfigFromTemplate", configFile.toString()));
createFromTemplate();
}
else
@@ -189,7 +189,7 @@ private void createFromTemplate()
istr = resourceClass.getResourceAsStream(templateName);
if (istr == null)
{
LOGGER.log(Level.SEVERE, _("couldNotFindTemplate", templateName));
LOGGER.log(Level.SEVERE, tl("couldNotFindTemplate", templateName));
return;
}
ostr = new FileOutputStream(configFile);
@@ -204,7 +204,7 @@ private void createFromTemplate()
}
catch (IOException ex)
{
LOGGER.log(Level.SEVERE, _("failedToWriteConfig", configFile.toString()), ex);
LOGGER.log(Level.SEVERE, tl("failedToWriteConfig", configFile.toString()), ex);
}
finally
{
@@ -228,7 +228,7 @@ private void createFromTemplate()
}
catch (IOException ex)
{
LOGGER.log(Level.SEVERE, _("failedToCloseConfig", configFile.toString()), ex);
LOGGER.log(Level.SEVERE, tl("failedToCloseConfig", configFile.toString()), ex);
}
}
}
@@ -352,16 +352,16 @@ public void run()
{
try
{
LOGGER.log(Level.INFO, _("creatingEmptyConfig", configFile.toString()));
LOGGER.log(Level.INFO, tl("creatingEmptyConfig", configFile.toString()));
if (!configFile.createNewFile())
{
LOGGER.log(Level.SEVERE, _("failedToCreateConfig", configFile.toString()));
LOGGER.log(Level.SEVERE, tl("failedToCreateConfig", configFile.toString()));
return;
}
}
catch (IOException ex)
{
LOGGER.log(Level.SEVERE, _("failedToCreateConfig", configFile.toString()), ex);
LOGGER.log(Level.SEVERE, tl("failedToCreateConfig", configFile.toString()), ex);
return;
}
}
@@ -1,6 +1,6 @@
package com.earth2me.essentials;

import static com.earth2me.essentials.I18n._;
import static com.earth2me.essentials.I18n.tl;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -151,7 +151,7 @@ public void onPlayerDeathEvent(final PlayerDeathEvent event)
if (user.isAuthorized("essentials.back.ondeath") && !ess.getSettings().isCommandDisabled("back"))
{
user.setLastLocation();
user.sendMessage(_("backAfterDeath"));
user.sendMessage(tl("backAfterDeath"));
}
if (!ess.getSettings().areDeathMessagesEnabled())
{
@@ -1,6 +1,6 @@
package com.earth2me.essentials;

import static com.earth2me.essentials.I18n._;
import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.textreader.IText;
import com.earth2me.essentials.textreader.KeywordReplacer;
import com.earth2me.essentials.textreader.TextInput;
@@ -63,8 +63,8 @@ public void onPlayerChat(final AsyncPlayerChatEvent event)
if (user.isMuted())
{
event.setCancelled(true);
user.sendMessage(_("voiceSilenced"));
LOGGER.info(_("mutedUserSpeaks", user.getName()));
user.sendMessage(tl("voiceSilenced"));
LOGGER.info(tl("mutedUserSpeaks", user.getName()));
}
try
{
@@ -295,11 +295,11 @@ else if (ess.getSettings().allowSilentJoinQuit())
final List<String> mail = user.getMails();
if (mail.isEmpty())
{
user.sendMessage(_("noNewMail"));
user.sendMessage(tl("noNewMail"));
}
else
{
user.sendMessage(_("youHaveNewMail", mail.size()));
user.sendMessage(tl("youHaveNewMail", mail.size()));
}
}

@@ -310,7 +310,7 @@ else if (ess.getSettings().allowSilentJoinQuit())
{
user.setAllowFlight(true);
user.setFlying(true);
user.sendMessage(_("flyMode", _("enabled"), user.getDisplayName()));
user.sendMessage(tl("flyMode", tl("enabled"), user.getDisplayName()));
}
}
user.setFlySpeed(0.1f);
@@ -346,7 +346,7 @@ public void onPlayerLogin2(final PlayerLoginEvent event)
return;
}

final String banReason = _("banFormat", _("defaultBanReason"), "Console");
final String banReason = tl("banFormat", tl("defaultBanReason"), "Console");
event.disallow(Result.KICK_BANNED, banReason);
}

@@ -386,7 +386,7 @@ public void onPlayerLogin(final PlayerLoginEvent event)

if (event.getResult() == Result.KICK_FULL && !user.isAuthorized("essentials.joinfullserver"))
{
event.disallow(Result.KICK_FULL, _("serverFull"));
event.disallow(Result.KICK_FULL, tl("serverFull"));
return;
}
event.allow();
@@ -510,12 +510,12 @@ public void onPlayerChangedWorld(final PlayerChangedWorldEvent event)
updateCompass(user);
if (ess.getSettings().getNoGodWorlds().contains(newWorld) && user.isGodModeEnabledRaw())
{
user.sendMessage(_("noGodWorldWarning"));
user.sendMessage(tl("noGodWorldWarning"));
}

if (!user.getWorld().getName().equals(newWorld))
{
user.sendMessage(_("currentWorld", newWorld));
user.sendMessage(tl("currentWorld", newWorld));
}
if (user.isVanished())
{
@@ -535,7 +535,7 @@ public void onPlayerInteract(final PlayerInteractEvent event)
if (player.isAuthorized("essentials.sethome.bed"))
{
player.setBedSpawnLocation(event.getClickedBlock().getLocation());
player.sendMessage(_("bedSet", player.getLocation().getWorld().getName(), player.getLocation().getBlockX(), player.getLocation().getBlockY(), player.getLocation().getBlockZ()));
player.sendMessage(tl("bedSet", player.getLocation().getWorld().getName(), player.getLocation().getBlockX(), player.getLocation().getBlockY(), player.getLocation().getBlockZ()));
}
}
break;

0 comments on commit 51bd0d8

Please sign in to comment.
You can’t perform that action at this time.