diff --git a/Essentials/src/com/earth2me/essentials/Backup.java b/Essentials/src/com/earth2me/essentials/Backup.java index 3c66218648..aa83343100 100644 --- a/Essentials/src/com/earth2me/essentials/Backup.java +++ b/Essentials/src/com/earth2me/essentials/Backup.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")); } }); } diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 36c36c6020..f942b29983 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -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 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials private transient I18n i18n; private transient Metrics metrics; private transient EssentialsTimer timer; - private transient List vanishedPlayers = new ArrayList(); + private final transient List vanishedPlayers = new ArrayList(); 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 mail = user.getMails(); if (mail != null && !mail.isEmpty()) { - user.sendMessage(_("youHaveNewMail", mail.size())); + user.sendMessage(tl("youHaveNewMail", mail.size())); } } @@ -467,16 +465,16 @@ 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; } @@ -484,11 +482,11 @@ else if (user == null) { 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); } diff --git a/Essentials/src/com/earth2me/essentials/EssentialsConf.java b/Essentials/src/com/earth2me/essentials/EssentialsConf.java index 4faecf4a5a..7fdf3baf4f 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsConf.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsConf.java @@ -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; } } diff --git a/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java b/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java index db6efb62d3..649dca27cd 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java @@ -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()) { diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index b6743a59f8..e82ef0cf07 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -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 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; diff --git a/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java b/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java index 68cb4ec480..fe3f5129d1 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java @@ -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.craftbukkit.FakeWorld; import com.earth2me.essentials.settings.Spawns; import com.earth2me.essentials.storage.YamlStorageWriter; @@ -73,7 +73,7 @@ private void moveWorthValuesToWorthYml() } catch (Exception e) { - LOGGER.log(Level.SEVERE, _("upgradingFilesError"), e); + LOGGER.log(Level.SEVERE, tl("upgradingFilesError"), e); } } @@ -117,7 +117,7 @@ private void moveMotdRulesToFile(String name) } catch (IOException e) { - LOGGER.log(Level.SEVERE, _("upgradingFilesError"), e); + LOGGER.log(Level.SEVERE, tl("upgradingFilesError"), e); } } @@ -167,11 +167,11 @@ else if (line.endsWith("\r") || line.endsWith("\n")) { if (!file.renameTo(new File(file.getParentFile(), file.getName().concat("." + System.currentTimeMillis() + ".upgradebackup")))) { - throw new Exception(_("configFileMoveError")); + throw new Exception(tl("configFileMoveError")); } if (!tempFile.renameTo(file)) { - throw new Exception(_("configFileRenameError")); + throw new Exception(tl("configFileRenameError")); } } else @@ -499,7 +499,7 @@ private void convertWarps() ess.getWarps().setWarp(filename.substring(0, filename.length() - 4), loc); if (!listOfFiles[i].renameTo(new File(warpsFolder, filename + ".old"))) { - throw new Exception(_("fileRenameError", filename)); + throw new Exception(tl("fileRenameError", filename)); } } catch (Exception ex) @@ -547,7 +547,7 @@ private void convertWarps() ess.getWarps().setWarp(name, loc); if (!warpFile.renameTo(new File(ess.getDataFolder(), "warps.txt.old"))) { - throw new Exception(_("fileRenameError", "warps.txt")); + throw new Exception(tl("fileRenameError", "warps.txt")); } } } @@ -591,17 +591,17 @@ private void sanitizeAllUserFilenames() final File newFile = new File(listOfFile.getParentFile(), sanitizedFilename); if (!listOfFile.renameTo(tmpFile)) { - LOGGER.log(Level.WARNING, _("userdataMoveError", filename, sanitizedFilename)); + LOGGER.log(Level.WARNING, tl("userdataMoveError", filename, sanitizedFilename)); continue; } if (newFile.exists()) { - LOGGER.log(Level.WARNING, _("duplicatedUserdata", filename, sanitizedFilename)); + LOGGER.log(Level.WARNING, tl("duplicatedUserdata", filename, sanitizedFilename)); continue; } if (!tmpFile.renameTo(newFile)) { - LOGGER.log(Level.WARNING, _("userdataMoveBackError", sanitizedFilename, sanitizedFilename)); + LOGGER.log(Level.WARNING, tl("userdataMoveBackError", sanitizedFilename, sanitizedFilename)); } } doneFile.setProperty("sanitizeAllUserFilenames", true); @@ -711,7 +711,7 @@ private void updateSpawnsToNewSpawnsConfig() } if (!configFile.renameTo(new File(ess.getDataFolder(), "spawn.yml.old"))) { - throw new Exception(_("fileRenameError", "spawn.yml")); + throw new Exception(tl("fileRenameError", "spawn.yml")); } PrintWriter writer = new PrintWriter(configFile); try @@ -758,7 +758,7 @@ private void updateJailsToNewJailsConfig() } if (!configFile.renameTo(new File(ess.getDataFolder(), "jail.yml.old"))) { - throw new Exception(_("fileRenameError", "jail.yml")); + throw new Exception(tl("fileRenameError", "jail.yml")); } PrintWriter writer = new PrintWriter(configFile); try diff --git a/Essentials/src/com/earth2me/essentials/I18n.java b/Essentials/src/com/earth2me/essentials/I18n.java index f4f03a7953..3857c541bb 100644 --- a/Essentials/src/com/earth2me/essentials/I18n.java +++ b/Essentials/src/com/earth2me/essentials/I18n.java @@ -71,7 +71,7 @@ private String translate(final String string) } } - public static String _(final String string, final Object... objects) + public static String tl(final String string, final Object... objects) { if (instance == null) { diff --git a/Essentials/src/com/earth2me/essentials/ItemDb.java b/Essentials/src/com/earth2me/essentials/ItemDb.java index 8ab7d86160..508ba903ab 100644 --- a/Essentials/src/com/earth2me/essentials/ItemDb.java +++ b/Essentials/src/com/earth2me/essentials/ItemDb.java @@ -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.utils.NumberUtil; import com.earth2me.essentials.utils.StringUtil; import java.util.*; @@ -143,20 +143,20 @@ else if (Material.getMaterial(itemname.toUpperCase(Locale.ENGLISH)) != null) } catch (Throwable throwable) { - throw new Exception(_("unknownItemName", itemname), throwable); + throw new Exception(tl("unknownItemName", itemname), throwable); } } } if (itemid < 1) { - throw new Exception(_("unknownItemName", itemname)); + throw new Exception(tl("unknownItemName", itemname)); } final Material mat = Material.getMaterial(itemid); if (mat == null) { - throw new Exception(_("unknownItemId", itemid)); + throw new Exception(tl("unknownItemId", itemid)); } final ItemStack retval = new ItemStack(mat); retval.setAmount(mat.getMaxStackSize()); @@ -206,7 +206,7 @@ else if (args[0].equalsIgnoreCase("blocks")) if (is.isEmpty() || is.get(0).getType() == Material.AIR) { - throw new Exception(_("itemSellAir")); + throw new Exception(tl("itemSellAir")); } return is; diff --git a/Essentials/src/com/earth2me/essentials/Jails.java b/Essentials/src/com/earth2me/essentials/Jails.java index 303de169cc..0555f442b7 100644 --- a/Essentials/src/com/earth2me/essentials/Jails.java +++ b/Essentials/src/com/earth2me/essentials/Jails.java @@ -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.storage.AsyncStorageObjectHolder; import java.io.File; import java.util.*; @@ -93,12 +93,12 @@ public Location getJail(final String jailName) throws Exception if (getData().getJails() == null || jailName == null || !getData().getJails().containsKey(jailName.toLowerCase(Locale.ENGLISH))) { - throw new Exception(_("jailNotExist")); + throw new Exception(tl("jailNotExist")); } Location loc = getData().getJails().get(jailName.toLowerCase(Locale.ENGLISH)); if (loc == null || loc.getWorld() == null) { - throw new Exception(_("jailNotExist")); + throw new Exception(tl("jailNotExist")); } return loc; } @@ -272,11 +272,11 @@ public void onPlayerRespawn(final PlayerRespawnEvent event) { if (ess.getSettings().isDebug()) { - LOGGER.log(Level.INFO, _("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage()), ex); + LOGGER.log(Level.INFO, tl("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage()), ex); } else { - LOGGER.log(Level.INFO, _("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage())); + LOGGER.log(Level.INFO, tl("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage())); } } } @@ -298,14 +298,14 @@ public void onPlayerTeleport(final PlayerTeleportEvent event) { if (ess.getSettings().isDebug()) { - LOGGER.log(Level.INFO, _("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage()), ex); + LOGGER.log(Level.INFO, tl("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage()), ex); } else { - LOGGER.log(Level.INFO, _("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage())); + LOGGER.log(Level.INFO, tl("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage())); } } - user.sendMessage(_("jailMessage")); + user.sendMessage(tl("jailMessage")); } @EventHandler(priority = EventPriority.HIGHEST) @@ -327,14 +327,14 @@ public void onPlayerJoin(final PlayerJoinEvent event) { if (ess.getSettings().isDebug()) { - LOGGER.log(Level.INFO, _("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage()), ex); + LOGGER.log(Level.INFO, tl("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage()), ex); } else { - LOGGER.log(Level.INFO, _("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage())); + LOGGER.log(Level.INFO, tl("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage())); } } - user.sendMessage(_("jailMessage")); + user.sendMessage(tl("jailMessage")); } } } diff --git a/Essentials/src/com/earth2me/essentials/Kit.java b/Essentials/src/com/earth2me/essentials/Kit.java index 21a9487846..994a2d5942 100644 --- a/Essentials/src/com/earth2me/essentials/Kit.java +++ b/Essentials/src/com/earth2me/essentials/Kit.java @@ -1,6 +1,6 @@ package com.earth2me.essentials; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import static com.earth2me.essentials.I18n.capitalCase; import com.earth2me.essentials.Trade.OverflowType; import com.earth2me.essentials.commands.NoChargeException; @@ -41,13 +41,13 @@ else if (user.isAuthorized("essentials.kits." + kitItem.toLowerCase(Locale.ENGLI BigDecimal costPrice = new Trade("kit-" + kitItem.toLowerCase(Locale.ENGLISH), ess).getCommandCost(user); if (costPrice.signum() > 0) { - cost = _("kitCost", NumberUtil.displayCurrency(costPrice, ess)); + cost = tl("kitCost", NumberUtil.displayCurrency(costPrice, ess)); } final Map kit = ess.getSettings().getKit(kitItem); if (Kit.getNextUse(user, kitItem, kit) != 0) { - name = _("kitDelay", name); + name = tl("kitDelay", name); } list.append(" ").append(name).append(cost); @@ -57,7 +57,7 @@ else if (user.isAuthorized("essentials.kits." + kitItem.toLowerCase(Locale.ENGLI } catch (Exception ex) { - throw new Exception(_("kitError"), ex); + throw new Exception(tl("kitError"), ex); } } @@ -73,12 +73,12 @@ public static void checkTime(final User user, final String kitName, final Map getItems(final IEssentials ess, final User user, fina { if (kit == null) { - throw new Exception(_("kitNotFound")); + throw new Exception(tl("kitNotFound")); } try { @@ -162,7 +162,7 @@ public static List getItems(final IEssentials ess, final User user, fina catch (Exception e) { ess.getLogger().log(Level.WARNING, "Error parsing kit " + kitName + ": " + e.getMessage()); - throw new Exception(_("kitError2"), e); + throw new Exception(tl("kitError2"), e); } } @@ -226,14 +226,14 @@ public static void expandItems(final IEssentials ess, final User user, final Lis user.updateInventory(); if (spew) { - user.sendMessage(_("kitInvFull")); + user.sendMessage(tl("kitInvFull")); } } catch (Exception e) { user.updateInventory(); ess.getLogger().log(Level.WARNING, e.getMessage()); - throw new Exception(_("kitError2"), e); + throw new Exception(tl("kitError2"), e); } } } diff --git a/Essentials/src/com/earth2me/essentials/ManagedFile.java b/Essentials/src/com/earth2me/essentials/ManagedFile.java index 84daefdef0..3fa46d5c32 100644 --- a/Essentials/src/com/earth2me/essentials/ManagedFile.java +++ b/Essentials/src/com/earth2me/essentials/ManagedFile.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.*; import java.math.BigInteger; import java.security.DigestInputStream; @@ -47,7 +47,7 @@ public ManagedFile(final String filename, final IEssentials ess) } catch (IOException ex) { - Bukkit.getLogger().log(Level.SEVERE, _("itemsCsvNotLoaded"), ex); + Bukkit.getLogger().log(Level.SEVERE, tl("itemsCsvNotLoaded"), ex); } } } diff --git a/Essentials/src/com/earth2me/essentials/MetaItemStack.java b/Essentials/src/com/earth2me/essentials/MetaItemStack.java index 7c6634115c..164624319f 100644 --- a/Essentials/src/com/earth2me/essentials/MetaItemStack.java +++ b/Essentials/src/com/earth2me/essentials/MetaItemStack.java @@ -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.BookInput; import com.earth2me.essentials.textreader.BookPager; import com.earth2me.essentials.textreader.IText; @@ -105,7 +105,7 @@ public void parseStringMeta(final CommandSource sender, final boolean allowUnsaf } catch (NoSuchMethodError nsme) { - throw new Exception(_("noMetaJson"), nsme); + throw new Exception(tl("noMetaJson"), nsme); } catch (Throwable throwable) { @@ -122,14 +122,14 @@ public void parseStringMeta(final CommandSource sender, final boolean allowUnsaf { if (!hasMetaPermission(sender, "firework", true, true, ess)) { - throw new Exception(_("noMetaFirework")); + throw new Exception(tl("noMetaFirework")); } FireworkEffect effect = builder.build(); FireworkMeta fmeta = (FireworkMeta)stack.getItemMeta(); fmeta.addEffect(effect); if (fmeta.getEffects().size() > 1 && !hasMetaPermission(sender, "firework-multiple", true, true, ess)) { - throw new Exception(_("multipleCharges")); + throw new Exception(tl("multipleCharges")); } stack.setItemMeta(fmeta); } @@ -173,7 +173,7 @@ else if (split.length > 1 && (split[0].equalsIgnoreCase("player") || split[0].eq } else { - throw new Exception(_("onlyPlayerSkulls")); + throw new Exception(tl("onlyPlayerSkulls")); } } else if (split.length > 1 && split[0].equalsIgnoreCase("book") && stack.getType() == Material.WRITTEN_BOOK @@ -234,7 +234,7 @@ else if (split.length > 1 && (split[0].equalsIgnoreCase("color") || split[0].equ } else { - throw new Exception(_("leatherSyntax")); + throw new Exception(tl("leatherSyntax")); } } else @@ -260,14 +260,14 @@ public void addFireworkMeta(final CommandSource sender, final boolean allowShort { if (!hasMetaPermission(sender, "firework", true, true, ess)) { - throw new Exception(_("noMetaFirework")); + throw new Exception(tl("noMetaFirework")); } FireworkEffect effect = builder.build(); FireworkMeta fmeta = (FireworkMeta)stack.getItemMeta(); fmeta.addEffect(effect); if (fmeta.getEffects().size() > 1 && !hasMetaPermission(sender, "firework-multiple", true, true, ess)) { - throw new Exception(_("multipleCharges")); + throw new Exception(tl("multipleCharges")); } stack.setItemMeta(fmeta); builder = FireworkEffect.builder(); @@ -284,7 +284,7 @@ public void addFireworkMeta(final CommandSource sender, final boolean allowShort } else { - throw new Exception(_("invalidFireworkFormat", split[1], split[0])); + throw new Exception(tl("invalidFireworkFormat", split[1], split[0])); } } builder.withColor(primaryColors); @@ -299,7 +299,7 @@ else if (split[0].equalsIgnoreCase("shape") || split[0].equalsIgnoreCase("type") } else { - throw new Exception(_("invalidFireworkFormat", split[1], split[0])); + throw new Exception(tl("invalidFireworkFormat", split[1], split[0])); } if (finalEffect != null) { @@ -318,7 +318,7 @@ else if (split[0].equalsIgnoreCase("fade") || (allowShortName && split[0].equals } else { - throw new Exception(_("invalidFireworkFormat", split[1], split[0])); + throw new Exception(tl("invalidFireworkFormat", split[1], split[0])); } } if (!fadeColors.isEmpty()) @@ -341,7 +341,7 @@ else if (effect.equalsIgnoreCase("trail")) } else { - throw new Exception(_("invalidFireworkFormat", split[1], split[0])); + throw new Exception(tl("invalidFireworkFormat", split[1], split[0])); } } } @@ -370,12 +370,12 @@ public void addPotionMeta(final CommandSource sender, final boolean allowShortNa } else { - throw new Exception(_("noPotionEffectPerm", pEffectType.getName().toLowerCase(Locale.ENGLISH))); + throw new Exception(tl("noPotionEffectPerm", pEffectType.getName().toLowerCase(Locale.ENGLISH))); } } else { - throw new Exception(_("invalidPotionMeta", split[1])); + throw new Exception(tl("invalidPotionMeta", split[1])); } } else if (split[0].equalsIgnoreCase("power") || (allowShortName && split[0].equalsIgnoreCase("p"))) @@ -391,7 +391,7 @@ else if (split[0].equalsIgnoreCase("power") || (allowShortName && split[0].equal } else { - throw new Exception(_("invalidPotionMeta", split[1])); + throw new Exception(tl("invalidPotionMeta", split[1])); } } else if (split[0].equalsIgnoreCase("duration") || (allowShortName && split[0].equalsIgnoreCase("d"))) @@ -403,7 +403,7 @@ else if (split[0].equalsIgnoreCase("duration") || (allowShortName && split[0].eq } else { - throw new Exception(_("invalidPotionMeta", split[1])); + throw new Exception(tl("invalidPotionMeta", split[1])); } } @@ -413,7 +413,7 @@ else if (split[0].equalsIgnoreCase("duration") || (allowShortName && split[0].eq pEffect = pEffectType.createEffect(duration, power); if (pmeta.getCustomEffects().size() > 1 && !hasMetaPermission(sender, "potions.multiple", true, false, ess)) { - throw new Exception(_("multiplePotionEffects")); + throw new Exception(tl("multiplePotionEffects")); } pmeta.addCustomEffect(pEffect, true); stack.setItemMeta(pmeta); @@ -454,7 +454,7 @@ public void addEnchantment(final CommandSource sender, final boolean allowUnsafe { if (enchantment == null) { - throw new Exception(_("enchantmentNotFound")); + throw new Exception(tl("enchantmentNotFound")); } try { @@ -508,7 +508,7 @@ public Enchantment getEnchantment(final User user, final String name) throws Exc if (!hasMetaPermission(user, "enchantments." + enchantmentName, true, false)) { - throw new Exception(_("enchantmentPerm", enchantmentName)); + throw new Exception(tl("enchantmentPerm", enchantmentName)); } return enchantment; } @@ -533,7 +533,7 @@ private boolean hasMetaPermission(final User user, final String metaPerm, final } else { - throw new Exception(_("noMetaPerm", metaPerm)); + throw new Exception(tl("noMetaPerm", metaPerm)); } } } diff --git a/Essentials/src/com/earth2me/essentials/Mob.java b/Essentials/src/com/earth2me/essentials/Mob.java index 2c3201aad3..712f5cc0fd 100644 --- a/Essentials/src/com/earth2me/essentials/Mob.java +++ b/Essentials/src/com/earth2me/essentials/Mob.java @@ -1,6 +1,6 @@ package com.earth2me.essentials; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import java.util.*; import java.util.logging.Level; import java.util.logging.Logger; @@ -95,7 +95,7 @@ public Entity spawn(final World world, final Server server, final Location loc) final Entity entity = world.spawn(loc, (Class)this.bukkitType.getEntityClass()); if (entity == null) { - logger.log(Level.WARNING, _("unableToSpawnMob")); + logger.log(Level.WARNING, tl("unableToSpawnMob")); throw new MobException(); } return entity; diff --git a/Essentials/src/com/earth2me/essentials/MobData.java b/Essentials/src/com/earth2me/essentials/MobData.java index 1e28778804..40e23f5797 100644 --- a/Essentials/src/com/earth2me/essentials/MobData.java +++ b/Essentials/src/com/earth2me/essentials/MobData.java @@ -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.utils.StringUtil; import java.util.*; import java.util.logging.Logger; @@ -274,7 +274,7 @@ else if (!color.isEmpty()) } catch (Exception e) { - throw new Exception(_("sheepMalformedColor"), e); + throw new Exception(tl("sheepMalformedColor"), e); } } else if (this.value.equals(Data.EXP)) @@ -286,7 +286,7 @@ else if (this.value.equals(Data.EXP)) } catch (NumberFormatException e) { - throw new Exception(_("invalidNumber"), e); + throw new Exception(tl("invalidNumber"), e); } } else if (this.value.equals(Data.SIZE)) @@ -298,7 +298,7 @@ else if (this.value.equals(Data.SIZE)) } catch (NumberFormatException e) { - throw new Exception(_("slimeMalformedSize"), e); + throw new Exception(tl("slimeMalformedSize"), e); } } else if (this.value instanceof Horse.Color) diff --git a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java index 788437c288..de183e5f0b 100644 --- a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java +++ b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java @@ -1,6 +1,6 @@ package com.earth2me.essentials; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import java.net.InetSocketAddress; import java.util.*; import lombok.Delegate; @@ -180,25 +180,25 @@ public boolean performCommand(String string) @Override public int getRemainingAir() { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public void setRemainingAir(int i) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public int getMaximumAir() { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public void setMaximumAir(int i) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override @@ -210,73 +210,73 @@ public boolean isSneaking() @Override public void setSneaking(boolean bln) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public void updateInventory() { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public void chat(String string) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public double getEyeHeight() { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public double getEyeHeight(boolean bln) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public List getLineOfSight(HashSet hs, int i) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public Block getTargetBlock(HashSet hs, int i) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public List getLastTwoTargetBlocks(HashSet hs, int i) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public int getFireTicks() { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public int getMaxFireTicks() { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public void setFireTicks(int i) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public void remove() { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override @@ -287,168 +287,168 @@ public Server getServer() public Vector getMomentum() { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } public void setMomentum(Vector vector) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public void setVelocity(Vector vector) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public Vector getVelocity() { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public void damage(double d) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public void damage(double d, Entity entity) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public Location getEyeLocation() { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public void sendRawMessage(String string) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public Location getCompassTarget() { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public int getMaximumNoDamageTicks() { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public void setMaximumNoDamageTicks(int i) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public double getLastDamage() { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public void setLastDamage(double d) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public int getNoDamageTicks() { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public void setNoDamageTicks(int i) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public boolean teleport(Location lctn) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public boolean teleport(Entity entity) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public Entity getPassenger() { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public boolean setPassenger(Entity entity) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public boolean isEmpty() { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public boolean eject() { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public void saveData() { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public void loadData() { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public boolean isSleeping() { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public int getSleepTicks() { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public List getNearbyEntities(double d, double d1, double d2) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public boolean isDead() { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public float getFallDistance() { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override @@ -459,156 +459,175 @@ public void setFallDistance(float f) @Override public void setSleepingIgnored(boolean bln) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public boolean isSleepingIgnored() { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public void awardAchievement(Achievement a) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } + @Override public void removeAchievement(Achievement achievement) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } + @Override public boolean hasAchievement(Achievement achievement) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } + @Override public void incrementStatistic(Statistic ststc) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } + @Override public void decrementStatistic(Statistic statistic) throws IllegalArgumentException { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } + @Override public void incrementStatistic(Statistic ststc, int i) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } + @Override public void decrementStatistic(Statistic statistic, int i) throws IllegalArgumentException { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } + @Override public void setStatistic(Statistic statistic, int i) throws IllegalArgumentException { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } + @Override public int getStatistic(Statistic statistic) throws IllegalArgumentException { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public void incrementStatistic(Statistic ststc, Material mtrl) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } + @Override public void decrementStatistic(Statistic statistic, Material material) throws IllegalArgumentException { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } + @Override public int getStatistic(Statistic statistic, Material material) throws IllegalArgumentException { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } + @Override public void incrementStatistic(Statistic ststc, Material mtrl, int i) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } + @Override public void decrementStatistic(Statistic statistic, Material material, int i) throws IllegalArgumentException { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } + @Override public void setStatistic(Statistic statistic, Material material, int i) throws IllegalArgumentException { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } + @Override public void incrementStatistic(Statistic statistic, EntityType entityType) throws IllegalArgumentException { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } + @Override public void decrementStatistic(Statistic statistic, EntityType entityType) throws IllegalArgumentException { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } + @Override public int getStatistic(Statistic statistic, EntityType entityType) throws IllegalArgumentException { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } + @Override public void incrementStatistic(Statistic statistic, EntityType entityType, int i) throws IllegalArgumentException { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } + @Override public void decrementStatistic(Statistic statistic, EntityType entityType, int i) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } + @Override public void setStatistic(Statistic statistic, EntityType entityType, int i) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public void playNote(Location lctn, byte b, byte b1) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public void sendBlockChange(Location lctn, Material mtrl, byte b) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public void sendBlockChange(Location lctn, int i, byte b) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public void setLastDamageCause(EntityDamageEvent ede) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public EntityDamageEvent getLastDamageCause() { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public void playEffect(Location lctn, Effect effect, int i) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override diff --git a/Essentials/src/com/earth2me/essentials/PlayerList.java b/Essentials/src/com/earth2me/essentials/PlayerList.java index ef986a68ab..2ea820adf3 100644 --- a/Essentials/src/com/earth2me/essentials/PlayerList.java +++ b/Essentials/src/com/earth2me/essentials/PlayerList.java @@ -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.utils.FormatUtil; import java.util.ArrayList; import java.util.Collections; @@ -30,11 +30,11 @@ public static String listUsers(final IEssentials ess, final List users, fi needComma = true; if (user.isAfk()) { - groupString.append(_("listAfkTag")); + groupString.append(tl("listAfkTag")); } if (user.isHidden()) { - groupString.append(_("listHiddenTag")); + groupString.append(tl("listHiddenTag")); } user.setDisplayNick(); groupString.append(user.getDisplayName()); @@ -58,11 +58,11 @@ public static String listSummary(final IEssentials ess, final boolean showHidden String online; if (showHidden && playerHidden > 0) { - online = _("listAmountHidden", server.getOnlinePlayers().length - playerHidden, playerHidden, server.getMaxPlayers()); + online = tl("listAmountHidden", server.getOnlinePlayers().length - playerHidden, playerHidden, server.getMaxPlayers()); } else { - online = _("listAmount", server.getOnlinePlayers().length - playerHidden, server.getMaxPlayers()); + online = tl("listAmount", server.getOnlinePlayers().length - playerHidden, server.getMaxPlayers()); } return online; } @@ -132,7 +132,7 @@ public static String listGroupUsers(final IEssentials ess, final Map _getItemSpawnBlacklist() } catch (Exception ex) { - logger.log(Level.SEVERE, _("unknownItemInList", itemName, "item-spawn-blacklist")); + logger.log(Level.SEVERE, tl("unknownItemInList", itemName, "item-spawn-blacklist")); } } return epItemSpwn; @@ -606,7 +606,7 @@ private List _getEnabledSigns() } catch (Exception ex) { - logger.log(Level.SEVERE, _("unknownItemInList", signName, "enabledSigns")); + logger.log(Level.SEVERE, tl("unknownItemInList", signName, "enabledSigns")); continue; } signsEnabled = true; @@ -710,7 +710,7 @@ public List getProtectList(final String configName) } catch (Exception ex) { - logger.log(Level.SEVERE, _("unknownItemInList", itemName, configName)); + logger.log(Level.SEVERE, tl("unknownItemInList", itemName, configName)); } } return list; diff --git a/Essentials/src/com/earth2me/essentials/SpawnMob.java b/Essentials/src/com/earth2me/essentials/SpawnMob.java index cfd0c5cec5..edf9b4fc54 100644 --- a/Essentials/src/com/earth2me/essentials/SpawnMob.java +++ b/Essentials/src/com/earth2me/essentials/SpawnMob.java @@ -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.Mob.MobException; import com.earth2me.essentials.utils.LocationUtil; import com.earth2me.essentials.utils.StringUtil; @@ -34,7 +34,7 @@ public static String mobList(final User user) } if (availableList.isEmpty()) { - availableList.add(_("none")); + availableList.add(tl("none")); } return StringUtil.joinList(availableList); } @@ -88,7 +88,7 @@ public static void spawnmob(final IEssentials ess, final Server server, final Us final Block block = LocationUtil.getTarget(user.getBase()).getBlock(); if (block == null) { - throw new Exception(_("unableToSpawnMob")); + throw new Exception(tl("unableToSpawnMob")); } spawnmob(ess, server, user.getSource(), user, block.getLocation(), parts, data, mobCount); } @@ -125,7 +125,7 @@ public static void spawnmob(final IEssentials ess, final Server server, final Co if (mobCount > effectiveLimit) { mobCount = effectiveLimit; - sender.sendMessage(_("mobSpawnLimit")); + sender.sendMessage(tl("mobSpawnLimit")); } Mob mob = Mob.fromName(parts.get(0)); // Get the first mob @@ -135,19 +135,19 @@ public static void spawnmob(final IEssentials ess, final Server server, final Co { spawnMob(ess, server, sender, target, sloc, parts, data); } - sender.sendMessage(mobCount * parts.size() + " " + mob.name.toLowerCase(Locale.ENGLISH) + mob.suffix + " " + _("spawned")); + sender.sendMessage(mobCount * parts.size() + " " + mob.name.toLowerCase(Locale.ENGLISH) + mob.suffix + " " + tl("spawned")); } catch (MobException e1) { - throw new Exception(_("unableToSpawnMob"), e1); + throw new Exception(tl("unableToSpawnMob"), e1); } catch (NumberFormatException e2) { - throw new Exception(_("numberRequired"), e2); + throw new Exception(tl("numberRequired"), e2); } catch (NullPointerException np) { - throw new Exception(_("soloMob"), np); + throw new Exception(tl("soloMob"), np); } } @@ -194,17 +194,17 @@ private static void checkSpawnable(IEssentials ess, CommandSource sender, Mob mo { if (mob == null) { - throw new Exception(_("invalidMob")); + throw new Exception(tl("invalidMob")); } if (ess.getSettings().getProtectPreventSpawn(mob.getType().toString().toLowerCase(Locale.ENGLISH))) { - throw new Exception(_("disabledToSpawnMob")); + throw new Exception(tl("disabledToSpawnMob")); } if (sender.isPlayer() && !ess.getUser(sender.getPlayer()).isAuthorized("essentials.spawnmob." + mob.name.toLowerCase(Locale.ENGLISH))) { - throw new Exception(_("noPermToSpawnMob")); + throw new Exception(tl("noPermToSpawnMob")); } } @@ -214,7 +214,7 @@ private static void changeMobData(final CommandSource sender, final EntityType t if (data.isEmpty()) { - sender.sendMessage(_("mobDataList", StringUtil.joinList(MobData.getValidHelp(spawned)))); + sender.sendMessage(tl("mobDataList", StringUtil.joinList(MobData.getValidHelp(spawned)))); } if (spawned instanceof Zombie || type == EntityType.SKELETON) diff --git a/Essentials/src/com/earth2me/essentials/Teleport.java b/Essentials/src/com/earth2me/essentials/Teleport.java index 4812296bd9..c17181dd88 100644 --- a/Essentials/src/com/earth2me/essentials/Teleport.java +++ b/Essentials/src/com/earth2me/essentials/Teleport.java @@ -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.utils.DateUtil; import com.earth2me.essentials.utils.LocationUtil; import java.math.BigDecimal; @@ -54,7 +54,7 @@ else if (lastTime > earliestLong && !teleportOwner.isAuthorized("essentials.tele time.setTimeInMillis(lastTime); time.add(Calendar.SECOND, (int)cooldown); time.add(Calendar.MILLISECOND, (int)((cooldown * 1000.0) % 1000.0)); - throw new Exception(_("timeBeforeTeleport", DateUtil.formatDateDiff(time.getTimeInMillis()))); + throw new Exception(tl("timeBeforeTeleport", DateUtil.formatDateDiff(time.getTimeInMillis()))); } } // if justCheck is set, don't update lastTeleport; we're just checking @@ -69,7 +69,7 @@ private void warnUser(final IUser user, final double delay) Calendar c = new GregorianCalendar(); c.add(Calendar.SECOND, (int)delay); c.add(Calendar.MILLISECOND, (int)((delay * 1000.0) % 1000.0)); - user.sendMessage(_("dontMoveMessage", DateUtil.formatDateDiff(c.getTimeInMillis()))); + user.sendMessage(tl("dontMoveMessage", DateUtil.formatDateDiff(c.getTimeInMillis()))); } //The now function is used when you want to skip tp delay when teleporting someone to a location or player. @@ -93,7 +93,7 @@ public void now(Player entity, boolean cooldown, TeleportCause cause) throws Exc } final ITarget target = new PlayerTarget(entity); now(teleportOwner, target, cause); - teleportOwner.sendMessage(_("teleporting", target.getLocation().getWorld().getName(), target.getLocation().getBlockX(), target.getLocation().getBlockY(), target.getLocation().getBlockZ())); + teleportOwner.sendMessage(tl("teleporting", target.getLocation().getWorld().getName(), target.getLocation().getBlockX(), target.getLocation().getBlockY(), target.getLocation().getBlockZ())); } protected void now(IUser teleportee, ITarget target, TeleportCause cause) throws Exception @@ -114,7 +114,7 @@ protected void now(IUser teleportee, ITarget target, TeleportCause cause) throws } else { - throw new Exception(_("unsafeTeleportDestination", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); + throw new Exception(tl("unsafeTeleportDestination", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); } } else @@ -148,7 +148,7 @@ public void teleport(Player entity, Trade chargeFor, TeleportCause cause) throws { ITarget target = new PlayerTarget(entity); teleport(teleportOwner, target, chargeFor, cause); - teleportOwner.sendMessage(_("teleporting", target.getLocation().getWorld().getName(), target.getLocation().getBlockX(), target.getLocation().getBlockY(), target.getLocation().getBlockZ())); + teleportOwner.sendMessage(tl("teleporting", target.getLocation().getWorld().getName(), target.getLocation().getBlockX(), target.getLocation().getBlockY(), target.getLocation().getBlockZ())); } //This is used when teleporting to stored location @@ -164,8 +164,8 @@ public void teleportPlayer(IUser teleportee, Player entity, Trade chargeFor, Tel { ITarget target = new PlayerTarget(entity); teleport(teleportee, target, chargeFor, cause); - teleportee.sendMessage(_("teleporting", target.getLocation().getWorld().getName(), target.getLocation().getBlockX(), target.getLocation().getBlockY(), target.getLocation().getBlockZ())); - teleportOwner.sendMessage(_("teleporting", target.getLocation().getWorld().getName(), target.getLocation().getBlockX(), target.getLocation().getBlockY(), target.getLocation().getBlockZ())); + teleportee.sendMessage(tl("teleporting", target.getLocation().getWorld().getName(), target.getLocation().getBlockX(), target.getLocation().getBlockY(), target.getLocation().getBlockZ())); + teleportOwner.sendMessage(tl("teleporting", target.getLocation().getWorld().getName(), target.getLocation().getBlockX(), target.getLocation().getBlockY(), target.getLocation().getBlockZ())); } private void teleport(IUser teleportee, ITarget target, Trade chargeFor, TeleportCause cause) throws Exception @@ -255,7 +255,7 @@ protected void respawnNow(IUser teleportee, TeleportCause cause) throws Exceptio public void warp(IUser teleportee, String warp, Trade chargeFor, TeleportCause cause) throws Exception { Location loc = ess.getWarps().getWarp(warp); - teleportee.sendMessage(_("warpingTo", warp, loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); + teleportee.sendMessage(tl("warpingTo", warp, loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); teleport(teleportee, new LocationTarget(loc), chargeFor, cause); } @@ -264,7 +264,7 @@ public void warp(IUser teleportee, String warp, Trade chargeFor, TeleportCause c public void back(Trade chargeFor) throws Exception { final Location loc = teleportOwner.getLastLocation(); - teleportOwner.sendMessage(_("backUsageMsg", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); + teleportOwner.sendMessage(tl("backUsageMsg", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); teleport(teleportOwner, new LocationTarget(loc), chargeFor, TeleportCause.COMMAND); } diff --git a/Essentials/src/com/earth2me/essentials/TimedTeleport.java b/Essentials/src/com/earth2me/essentials/TimedTeleport.java index e30eff9669..2bd67cbfba 100644 --- a/Essentials/src/com/earth2me/essentials/TimedTeleport.java +++ b/Essentials/src/com/earth2me/essentials/TimedTeleport.java @@ -1,8 +1,6 @@ package com.earth2me.essentials; -import static com.earth2me.essentials.I18n._; -import java.util.logging.Level; -import java.util.logging.Logger; +import static com.earth2me.essentials.I18n.tl; import net.ess3.api.IEssentials; import net.ess3.api.IUser; import org.bukkit.Location; @@ -100,16 +98,16 @@ public void run() } catch (Exception ex) { - teleportOwner.sendMessage(_("cooldownWithMessage", ex.getMessage())); + teleportOwner.sendMessage(tl("cooldownWithMessage", ex.getMessage())); if (teleportOwner != teleportUser) { - teleportUser.sendMessage(_("cooldownWithMessage", ex.getMessage())); + teleportUser.sendMessage(tl("cooldownWithMessage", ex.getMessage())); } } try { cancelTimer(false); - teleportUser.sendMessage(_("teleportationCommencing")); + teleportUser.sendMessage(tl("teleportationCommencing")); if (timer_chargeFor != null) { timer_chargeFor.isAffordableFor(teleportOwner); @@ -147,10 +145,10 @@ public void cancelTimer(boolean notifyUser) ess.getServer().getScheduler().cancelTask(timer_task); if (notifyUser) { - teleportOwner.sendMessage(_("pendingTeleportCancelled")); + teleportOwner.sendMessage(tl("pendingTeleportCancelled")); if (timer_teleportee != null && !timer_teleportee.equals(teleportOwner.getName())) { - ess.getUser(timer_teleportee).sendMessage(_("pendingTeleportCancelled")); + ess.getUser(timer_teleportee).sendMessage(tl("pendingTeleportCancelled")); } } } diff --git a/Essentials/src/com/earth2me/essentials/Trade.java b/Essentials/src/com/earth2me/essentials/Trade.java index dbdc430e42..e7426b4c48 100644 --- a/Essentials/src/com/earth2me/essentials/Trade.java +++ b/Essentials/src/com/earth2me/essentials/Trade.java @@ -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.craftbukkit.InventoryWorkaround; import com.earth2me.essentials.craftbukkit.SetExpFix; import java.io.File; @@ -99,13 +99,13 @@ public void isAffordableFor(final IUser user) throws ChargeException && getMoney().signum() > 0 && !user.canAfford(getMoney())) { - throw new ChargeException(_("notEnoughMoney")); + throw new ChargeException(tl("notEnoughMoney")); } if (getItemStack() != null && !user.getBase().getInventory().containsAtLeast(itemStack, itemStack.getAmount())) { - throw new ChargeException(_("missingItems", getItemStack().getAmount(), ess.getItemDb().name(getItemStack()))); + throw new ChargeException(tl("missingItems", getItemStack().getAmount(), ess.getItemDb().name(getItemStack()))); } BigDecimal money; @@ -113,13 +113,13 @@ && getMoney().signum() > 0 && (money = getCommandCost(user)).signum() > 0 && !user.canAfford(money)) { - throw new ChargeException(_("notEnoughMoney")); + throw new ChargeException(tl("notEnoughMoney")); } if (exp != null && exp > 0 && SetExpFix.getTotalExperience(user.getBase()) < exp) { - throw new ChargeException(_("notEnoughExperience")); + throw new ChargeException(tl("notEnoughExperience")); } } @@ -223,7 +223,7 @@ public void charge(final IUser user) throws ChargeException } if (!user.canAfford(getMoney()) && getMoney().signum() > 0) { - throw new ChargeException(_("notEnoughMoney")); + throw new ChargeException(tl("notEnoughMoney")); } user.takeMoney(getMoney()); } @@ -235,7 +235,7 @@ public void charge(final IUser user) throws ChargeException } if (!user.getBase().getInventory().containsAtLeast(getItemStack(), getItemStack().getAmount())) { - throw new ChargeException(_("missingItems", getItemStack().getAmount(), getItemStack().getType().toString().toLowerCase(Locale.ENGLISH).replace("_", " "))); + throw new ChargeException(tl("missingItems", getItemStack().getAmount(), getItemStack().getType().toString().toLowerCase(Locale.ENGLISH).replace("_", " "))); } user.getBase().getInventory().removeItem(getItemStack()); user.getBase().updateInventory(); @@ -245,7 +245,7 @@ public void charge(final IUser user) throws ChargeException final BigDecimal cost = getCommandCost(user); if (!user.canAfford(cost) && cost.signum() > 0) { - throw new ChargeException(_("notEnoughMoney")); + throw new ChargeException(tl("notEnoughMoney")); } user.takeMoney(cost); } @@ -258,7 +258,7 @@ public void charge(final IUser user) throws ChargeException final int experience = SetExpFix.getTotalExperience(user.getBase()); if (experience < getExperience() && getExperience() > 0) { - throw new ChargeException(_("notEnoughExperience")); + throw new ChargeException(tl("notEnoughExperience")); } SetExpFix.setTotalExperience(user.getBase(), experience - getExperience()); } diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index f1a564d1a2..1b2a8fc6ab 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -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.commands.IEssentialsCommand; import com.earth2me.essentials.register.payment.Method; import com.earth2me.essentials.register.payment.Methods; @@ -18,7 +18,6 @@ import net.ess3.api.events.UserBalanceUpdateEvent; import org.bukkit.ChatColor; import org.bukkit.Location; -import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; import org.bukkit.potion.PotionEffect; @@ -129,7 +128,7 @@ public void healCooldown() throws Exception cooldownTime.add(Calendar.MILLISECOND, (int)((cooldown * 1000.0) % 1000.0)); if (cooldownTime.after(now) && !isAuthorized("essentials.heal.cooldown.bypass")) { - throw new Exception(_("timeBeforeHeal", DateUtil.formatDateDiff(cooldownTime.getTimeInMillis()))); + throw new Exception(tl("timeBeforeHeal", DateUtil.formatDateDiff(cooldownTime.getTimeInMillis()))); } } setLastHealTimestamp(now.getTimeInMillis()); @@ -149,10 +148,10 @@ public void giveMoney(final BigDecimal value, final CommandSource initiator) thr return; } setMoney(getMoney().add(value)); - sendMessage(_("addedToAccount", NumberUtil.displayCurrency(value, ess))); + sendMessage(tl("addedToAccount", NumberUtil.displayCurrency(value, ess))); if (initiator != null) { - initiator.sendMessage(_("addedToOthersAccount", NumberUtil.displayCurrency(value, ess), this.getDisplayName(), NumberUtil.displayCurrency(getMoney(), ess))); + initiator.sendMessage(tl("addedToOthersAccount", NumberUtil.displayCurrency(value, ess), this.getDisplayName(), NumberUtil.displayCurrency(getMoney(), ess))); } } @@ -167,12 +166,12 @@ public void payUser(final User reciever, final BigDecimal value) throws ChargeEx { setMoney(getMoney().subtract(value)); reciever.setMoney(reciever.getMoney().add(value)); - sendMessage(_("moneySentTo", NumberUtil.displayCurrency(value, ess), reciever.getDisplayName())); - reciever.sendMessage(_("moneyRecievedFrom", NumberUtil.displayCurrency(value, ess), getDisplayName())); + sendMessage(tl("moneySentTo", NumberUtil.displayCurrency(value, ess), reciever.getDisplayName())); + reciever.sendMessage(tl("moneyRecievedFrom", NumberUtil.displayCurrency(value, ess), getDisplayName())); } else { - throw new ChargeException(_("notEnoughMoney")); + throw new ChargeException(tl("notEnoughMoney")); } } @@ -197,10 +196,10 @@ public void takeMoney(final BigDecimal value, final CommandSource initiator) { //We shouldn't be able to throw an exception on subtract money } - sendMessage(_("takenFromAccount", NumberUtil.displayCurrency(value, ess))); + sendMessage(tl("takenFromAccount", NumberUtil.displayCurrency(value, ess))); if (initiator != null) { - initiator.sendMessage(_("takenFromOthersAccount", NumberUtil.displayCurrency(value, ess), this.getDisplayName(), NumberUtil.displayCurrency(getMoney(), ess))); + initiator.sendMessage(tl("takenFromOthersAccount", NumberUtil.displayCurrency(value, ess), this.getDisplayName(), NumberUtil.displayCurrency(getMoney(), ess))); } } @@ -536,7 +535,7 @@ public boolean checkJailTimeout(final long currentTime) { setJailTimeout(0); setJailed(false); - sendMessage(_("haveBeenReleased")); + sendMessage(tl("haveBeenReleased")); setJail(null); try { @@ -563,7 +562,7 @@ public boolean checkMuteTimeout(final long currentTime) if (getMuteTimeout() > 0 && getMuteTimeout() < currentTime && isMuted()) { setMuteTimeout(0); - sendMessage(_("canTalkAgain")); + sendMessage(tl("canTalkAgain")); setMuted(false); return true; } @@ -590,7 +589,7 @@ public void updateActivity(final boolean broadcast) if (broadcast && !isHidden()) { setDisplayNick(); - final String msg = _("userIsNotAway", getDisplayName()); + final String msg = tl("userIsNotAway", getDisplayName()); if (!msg.isEmpty()) { ess.broadcastMessage(this, msg); @@ -606,7 +605,7 @@ public void checkActivity() if (autoafkkick > 0 && lastActivity > 0 && (lastActivity + (autoafkkick * 1000)) < System.currentTimeMillis() && !isHidden() && !isAuthorized("essentials.kick.exempt") && !isAuthorized("essentials.afk.kickexempt")) { - final String kickReason = _("autoAfkKickReason", autoafkkick / 60.0); + final String kickReason = tl("autoAfkKickReason", autoafkkick / 60.0); lastActivity = 0; this.getBase().kickPlayer(kickReason); @@ -616,7 +615,7 @@ public void checkActivity() final User user = ess.getUser(player); if (user.isAuthorized("essentials.kick.notify")) { - user.sendMessage(_("playerKicked", Console.NAME, getName(), kickReason)); + user.sendMessage(tl("playerKicked", Console.NAME, getName(), kickReason)); } } } @@ -627,7 +626,7 @@ public void checkActivity() if (!isHidden()) { setDisplayNick(); - final String msg = _("userIsAway", getDisplayName()); + final String msg = tl("userIsAway", getDisplayName()); if (!msg.isEmpty()) { ess.broadcastMessage(this, msg); diff --git a/Essentials/src/com/earth2me/essentials/UserData.java b/Essentials/src/com/earth2me/essentials/UserData.java index 73f2771ebc..20734b4612 100644 --- a/Essentials/src/com/earth2me/essentials/UserData.java +++ b/Essentials/src/com/earth2me/essentials/UserData.java @@ -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.utils.NumberUtil; import com.earth2me.essentials.utils.StringUtil; import java.io.File; @@ -211,7 +211,7 @@ public void delHome(String name) throws Exception } else { - throw new Exception(_("invalidHome", search)); + throw new Exception(tl("invalidHome", search)); } } diff --git a/Essentials/src/com/earth2me/essentials/Warps.java b/Essentials/src/com/earth2me/essentials/Warps.java index b993311c2f..3e0f93a55a 100644 --- a/Essentials/src/com/earth2me/essentials/Warps.java +++ b/Essentials/src/com/earth2me/essentials/Warps.java @@ -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.commands.WarpNotFoundException; import com.earth2me.essentials.utils.StringUtil; import java.io.File; @@ -71,7 +71,7 @@ public void setWarp(String name, Location loc) throws Exception File confFile = new File(warpsFolder, filename + ".yml"); if (confFile.exists()) { - throw new Exception(_("similarWarpExist")); + throw new Exception(tl("similarWarpExist")); } conf = new EssentialsConf(confFile); warpPoints.put(new StringIgnoreCase(name), conf); @@ -84,7 +84,7 @@ public void setWarp(String name, Location loc) throws Exception } catch (IOException ex) { - throw new IOException(_("invalidWarpName")); + throw new IOException(tl("invalidWarpName")); } } @@ -94,11 +94,11 @@ public void removeWarp(String name) throws Exception EssentialsConf conf = warpPoints.get(new StringIgnoreCase(name)); if (conf == null) { - throw new Exception(_("warpNotExist")); + throw new Exception(tl("warpNotExist")); } if (!conf.getFile().delete()) { - throw new Exception(_("warpDeleteError")); + throw new Exception(tl("warpDeleteError")); } warpPoints.remove(new StringIgnoreCase(name)); } @@ -127,7 +127,7 @@ public final void reloadConfig() } catch (Exception ex) { - logger.log(Level.WARNING, _("loadWarpError", filename), ex); + logger.log(Level.WARNING, tl("loadWarpError", filename), ex); } } } diff --git a/Essentials/src/com/earth2me/essentials/Worth.java b/Essentials/src/com/earth2me/essentials/Worth.java index 9c50e2ae4d..fff2c992cb 100644 --- a/Essentials/src/com/earth2me/essentials/Worth.java +++ b/Essentials/src/com/earth2me/essentials/Worth.java @@ -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.commands.NotEnoughArgumentsException; import java.io.File; import java.math.BigDecimal; @@ -85,7 +85,7 @@ public int getAmount(IEssentials ess, User user, ItemStack is, String[] args, bo { if (is == null || is.getType() == Material.AIR) { - throw new Exception(_("itemSellAir")); + throw new Exception(tl("itemSellAir")); } int id = is.getTypeId(); int amount = 0; @@ -111,7 +111,7 @@ public int getAmount(IEssentials ess, User user, ItemStack is, String[] args, bo if (requireStack && !stack) { - throw new Exception(_("itemMustBeStacked")); + throw new Exception(tl("itemMustBeStacked")); } int max = 0; @@ -141,9 +141,9 @@ public int getAmount(IEssentials ess, User user, ItemStack is, String[] args, bo { if (!isBulkSell) { - user.sendMessage(_("itemNotEnough2")); - user.sendMessage(_("itemNotEnough3")); - throw new Exception(_("itemNotEnough1")); + user.sendMessage(tl("itemNotEnough2")); + user.sendMessage(tl("itemNotEnough3")); + throw new Exception(tl("itemNotEnough1")); } else { diff --git a/Essentials/src/com/earth2me/essentials/api/Economy.java b/Essentials/src/com/earth2me/essentials/api/Economy.java index 1ae89e868a..13f8e3559e 100644 --- a/Essentials/src/com/earth2me/essentials/api/Economy.java +++ b/Essentials/src/com/earth2me/essentials/api/Economy.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.api; import com.earth2me.essentials.EssentialsConf; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import static com.earth2me.essentials.api.Economy.add; import static com.earth2me.essentials.api.Economy.divide; @@ -73,7 +73,7 @@ private static void deleteNPC(String name) { if (!config.delete()) { - logger.log(Level.WARNING, _("deleteFileError", config)); + logger.log(Level.WARNING, tl("deleteFileError", config)); } ess.getUserMap().removeUser(name); } diff --git a/Essentials/src/com/earth2me/essentials/api/InvalidWorldException.java b/Essentials/src/com/earth2me/essentials/api/InvalidWorldException.java index 03fe986d4c..e5b87464ce 100644 --- a/Essentials/src/com/earth2me/essentials/api/InvalidWorldException.java +++ b/Essentials/src/com/earth2me/essentials/api/InvalidWorldException.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.api; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; public class InvalidWorldException extends Exception @@ -9,7 +9,7 @@ public class InvalidWorldException extends Exception public InvalidWorldException(final String world) { - super(_("invalidWorld")); + super(tl("invalidWorld")); this.world = world; } diff --git a/Essentials/src/com/earth2me/essentials/api/UserDoesNotExistException.java b/Essentials/src/com/earth2me/essentials/api/UserDoesNotExistException.java index 531d9ead63..fd51c04e88 100644 --- a/Essentials/src/com/earth2me/essentials/api/UserDoesNotExistException.java +++ b/Essentials/src/com/earth2me/essentials/api/UserDoesNotExistException.java @@ -1,12 +1,12 @@ package com.earth2me.essentials.api; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; public class UserDoesNotExistException extends Exception { public UserDoesNotExistException(String name) { - super(_("userDoesNotExist", name)); + super(tl("userDoesNotExist", name)); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandafk.java b/Essentials/src/com/earth2me/essentials/commands/Commandafk.java index e14b02a805..0052677b50 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandafk.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandafk.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import org.bukkit.Server; @@ -50,7 +50,7 @@ private void toggleAfk(User user) //user.sendMessage(_("markedAsNotAway")); if (!user.isHidden()) { - msg = _("userIsNotAway", user.getDisplayName()); + msg = tl("userIsNotAway", user.getDisplayName()); } user.updateActivity(false); } @@ -59,7 +59,7 @@ private void toggleAfk(User user) //user.sendMessage(_("markedAsAway")); if (!user.isHidden()) { - msg = _("userIsAway", user.getDisplayName()); + msg = tl("userIsAway", user.getDisplayName()); } } if (!msg.isEmpty()) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandback.java b/Essentials/src/com/earth2me/essentials/commands/Commandback.java index ebe305f93d..5db82d0484 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandback.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandback.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; import org.bukkit.Server; @@ -18,12 +18,12 @@ protected void run(final Server server, final User user, final String commandLab { if (user.getLastLocation() == null) { - throw new Exception(_("noLocationFound")); + throw new Exception(tl("noLocationFound")); } if (user.getWorld() != user.getLastLocation().getWorld() && ess.getSettings().isWorldTeleportPermissions() && !user.isAuthorized("essentials.worlds." + user.getLastLocation().getWorld().getName())) { - throw new Exception(_("noPerm", "essentials.worlds." + user.getLastLocation().getWorld().getName())); + throw new Exception(tl("noPerm", "essentials.worlds." + user.getLastLocation().getWorld().getName())); } final Trade charge = new Trade(this.getName(), ess); charge.isAffordableFor(user); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbackup.java b/Essentials/src/com/earth2me/essentials/commands/Commandbackup.java index 4da00e26e6..a384cb6bd7 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbackup.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbackup.java @@ -2,7 +2,7 @@ import com.earth2me.essentials.Backup; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import org.bukkit.Server; @@ -19,14 +19,14 @@ protected void run(final Server server, final CommandSource sender, final String final Backup backup = ess.getBackup(); if (backup == null) { - throw new Exception(_("backupDisabled")); + throw new Exception(tl("backupDisabled")); } final String command = ess.getSettings().getBackupCommand(); if (command == null || "".equals(command) || "save-all".equalsIgnoreCase(command)) { - throw new Exception(_("backupDisabled")); + throw new Exception(tl("backupDisabled")); } backup.run(); - sender.sendMessage(_("backupStarted")); + sender.sendMessage(tl("backupStarted")); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java b/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java index 8db3d68161..5015c3574d 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.NumberUtil; import java.math.BigDecimal; @@ -24,7 +24,7 @@ protected void run(final Server server, final CommandSource sender, final String } User target = getPlayer(server, args, 0, true, true); - sender.sendMessage(_("balanceOther", target.isHidden() ? target.getName() : target.getDisplayName(), NumberUtil.displayCurrency(target.getMoney(), ess))); + sender.sendMessage(tl("balanceOther", target.isHidden() ? target.getName() : target.getDisplayName(), NumberUtil.displayCurrency(target.getMoney(), ess))); } @Override @@ -34,12 +34,12 @@ public void run(final Server server, final User user, final String commandLabel, { final User target = getPlayer(server, args, 0, true, true); final BigDecimal bal = target.getMoney(); - user.sendMessage(_("balanceOther", target.isHidden() ? target.getName() : target.getDisplayName(), NumberUtil.displayCurrency(bal, ess))); + user.sendMessage(tl("balanceOther", target.isHidden() ? target.getName() : target.getDisplayName(), NumberUtil.displayCurrency(bal, ess))); } else if (args.length < 2) { final BigDecimal bal = user.getMoney(); - user.sendMessage(_("balance", NumberUtil.displayCurrency(bal, ess))); + user.sendMessage(tl("balance", NumberUtil.displayCurrency(bal, ess))); } else { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java b/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java index 18371df62a..29f32f8e87 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import com.earth2me.essentials.textreader.SimpleTextInput; import com.earth2me.essentials.textreader.TextPager; @@ -12,7 +12,6 @@ import java.util.Map.Entry; import java.util.concurrent.locks.ReentrantReadWriteLock; import org.bukkit.Server; -import org.bukkit.entity.Player; public class Commandbalancetop extends EssentialsCommand @@ -59,7 +58,7 @@ protected void run(final Server server, final CommandSource sender, final String } if (ess.getUserMap().getUniqueUsers() > MINUSERS) { - sender.sendMessage(_("orderBalances", ess.getUserMap().getUniqueUsers())); + sender.sendMessage(tl("orderBalances", ess.getUserMap().getUniqueUsers())); } } finally @@ -72,7 +71,7 @@ protected void run(final Server server, final CommandSource sender, final String { if (ess.getUserMap().getUniqueUsers() > MINUSERS) { - sender.sendMessage(_("orderBalances", ess.getUserMap().getUniqueUsers())); + sender.sendMessage(tl("orderBalances", ess.getUserMap().getUniqueUsers())); } ess.runTaskAsynchronously(new Viewer(sender, page, force)); } @@ -84,7 +83,7 @@ private static void outputCache(final CommandSource sender, int page) final Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(cacheage); final DateFormat format = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT); - sender.sendMessage(_("balanceTop", format.format(cal.getTime()))); + sender.sendMessage(tl("balanceTop", format.format(cal.getTime()))); new TextPager(cache).showPage(Integer.toString(page), null, "balancetop", sender); } @@ -144,7 +143,7 @@ public int compare(final Entry entry1, final Entry entry : sortedEntries) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandban.java b/Essentials/src/com/earth2me/essentials/commands/Commandban.java index 4286ae19f8..3a2b0267c1 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandban.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandban.java @@ -2,7 +2,7 @@ import com.earth2me.essentials.CommandSource; import com.earth2me.essentials.Console; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.OfflinePlayer; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.FormatUtil; @@ -39,14 +39,14 @@ public void run(final Server server, final CommandSource sender, final String co { if (sender.isPlayer() && !ess.getUser(sender.getPlayer()).isAuthorized("essentials.ban.offline")) { - throw new Exception(_("banExemptOffline")); + throw new Exception(tl("banExemptOffline")); } } else { if (user.isAuthorized("essentials.ban.exempt") && sender.isPlayer()) { - throw new Exception(_("banExempt")); + throw new Exception(tl("banExempt")); } } @@ -58,21 +58,21 @@ public void run(final Server server, final CommandSource sender, final String co } else { - banReason = _("defaultBanReason"); + banReason = tl("defaultBanReason"); } - user.setBanReason(_("banFormat", banReason, senderName)); + user.setBanReason(tl("banFormat", banReason, senderName)); user.setBanned(true); user.setBanTimeout(0); - user.kickPlayer(_("banFormat", banReason, senderName)); + user.kickPlayer(tl("banFormat", banReason, senderName)); - server.getLogger().log(Level.INFO, _("playerBanned", senderName, user.getName(), banReason)); + server.getLogger().log(Level.INFO, tl("playerBanned", senderName, user.getName(), banReason)); if (nomatch) { - sender.sendMessage(_("userUnknown", user.getName())); + sender.sendMessage(tl("userUnknown", user.getName())); } - ess.broadcastMessage("essentials.ban.notify", _("playerBanned", senderName, user.getName(), banReason)); + ess.broadcastMessage("essentials.ban.notify", tl("playerBanned", senderName, user.getName(), banReason)); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java b/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java index 9246f89ad5..3dea97cebd 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java @@ -2,7 +2,7 @@ import com.earth2me.essentials.CommandSource; import com.earth2me.essentials.Console; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.FormatUtil; import java.util.logging.Level; @@ -50,8 +50,8 @@ public void run(final Server server, final CommandSource sender, final String co } ess.getServer().banIP(ipAddress); - server.getLogger().log(Level.INFO, _("playerBanIpAddress", senderName, ipAddress)); + server.getLogger().log(Level.INFO, tl("playerBanIpAddress", senderName, ipAddress)); - ess.broadcastMessage("essentials.ban.notify", _("playerBanIpAddress", senderName, ipAddress)); + ess.broadcastMessage("essentials.ban.notify", tl("playerBanIpAddress", senderName, ipAddress)); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbigtree.java b/Essentials/src/com/earth2me/essentials/commands/Commandbigtree.java index 3d46eeaef9..ed5b7957e1 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbigtree.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbigtree.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.LocationUtil; import org.bukkit.Location; @@ -41,11 +41,11 @@ else if (args.length > 0 && args[0].equalsIgnoreCase("jungle")) final boolean success = user.getWorld().generateTree(safeLocation, tree); if (success) { - user.sendMessage(_("bigTreeSuccess")); + user.sendMessage(tl("bigTreeSuccess")); } else { - throw new Exception(_("bigTreeFailure")); + throw new Exception(tl("bigTreeFailure")); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbook.java b/Essentials/src/com/earth2me/essentials/commands/Commandbook.java index afa57d1864..f2cb79bd2c 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbook.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbook.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import org.bukkit.Material; import org.bukkit.Server; @@ -31,11 +31,11 @@ public void run(final Server server, final User user, final String commandLabel, { bmeta.setAuthor(args[1]); item.setItemMeta(bmeta); - user.sendMessage(_("bookAuthorSet", getFinalArg(args, 1))); + user.sendMessage(tl("bookAuthorSet", getFinalArg(args, 1))); } else { - throw new Exception(_("denyChangeAuthor")); + throw new Exception(tl("denyChangeAuthor")); } } else if (args.length > 1 && args[0].equalsIgnoreCase("title")) @@ -44,11 +44,11 @@ else if (args.length > 1 && args[0].equalsIgnoreCase("title")) { bmeta.setTitle(args[1]); item.setItemMeta(bmeta); - user.sendMessage(_("bookTitleSet", getFinalArg(args, 1))); + user.sendMessage(tl("bookTitleSet", getFinalArg(args, 1))); } else { - throw new Exception(_("denyChangeTitle")); + throw new Exception(tl("denyChangeTitle")); } } else @@ -58,11 +58,11 @@ else if (args.length > 1 && args[0].equalsIgnoreCase("title")) ItemStack newItem = new ItemStack(Material.BOOK_AND_QUILL, item.getAmount()); newItem.setItemMeta(bmeta); user.setItemInHand(newItem); - user.sendMessage(_("editBookContents")); + user.sendMessage(tl("editBookContents")); } else { - throw new Exception(_("denyBookEdit")); + throw new Exception(tl("denyBookEdit")); } } } @@ -76,11 +76,11 @@ else if (item.getType() == Material.BOOK_AND_QUILL) ItemStack newItem = new ItemStack(Material.WRITTEN_BOOK, item.getAmount()); newItem.setItemMeta(bmeta); user.setItemInHand(newItem); - user.sendMessage(_("bookLocked")); + user.sendMessage(tl("bookLocked")); } else { - throw new Exception(_("holdBook")); + throw new Exception(tl("holdBook")); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbreak.java b/Essentials/src/com/earth2me/essentials/commands/Commandbreak.java index af11f597d7..92ccd9dc42 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbreak.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbreak.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import org.bukkit.Material; import org.bukkit.Server; @@ -30,7 +30,7 @@ public void run(final Server server, final User user, final String commandLabel, } if (block.getType() == Material.BEDROCK && !user.isAuthorized("essentials.break.bedrock")) { - throw new Exception(_("noBreakBedrock")); + throw new Exception(tl("noBreakBedrock")); } //final List list = (List)block.getDrops(); //final BlockBreakEvent event = new BlockBreakEvent(block, user.getBase(), list); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbroadcast.java b/Essentials/src/com/earth2me/essentials/commands/Commandbroadcast.java index a97ed54c92..2b692b78bb 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbroadcast.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbroadcast.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.FormatUtil; import org.bukkit.Server; @@ -33,6 +33,6 @@ private void sendBroadcast(final String name, final String[] args) throws NotEno throw new NotEnoughArgumentsException(); } - ess.broadcastMessage(_("broadcast", FormatUtil.replaceFormat(getFinalArg(args, 0)).replace("\\n", "\n"), name)); + ess.broadcastMessage(tl("broadcast", FormatUtil.replaceFormat(getFinalArg(args, 0)).replace("\\n", "\n"), name)); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandburn.java b/Essentials/src/com/earth2me/essentials/commands/Commandburn.java index 0197687505..b0ae498de4 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandburn.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandburn.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import org.bukkit.Server; @@ -28,6 +28,6 @@ protected void run(final Server server, final CommandSource sender, final String User user = getPlayer(server, sender, args, 0); user.setFireTicks(Integer.parseInt(args[1]) * 20); - sender.sendMessage(_("burnMsg", user.getDisplayName(), Integer.parseInt(args[1]))); + sender.sendMessage(tl("burnMsg", user.getDisplayName(), Integer.parseInt(args[1]))); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandclearinventory.java b/Essentials/src/com/earth2me/essentials/commands/Commandclearinventory.java index d48f60543d..d403b0e0dd 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandclearinventory.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandclearinventory.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.NumberUtil; import java.util.ArrayList; @@ -46,7 +46,7 @@ private void parseCommand(Server server, CommandSource sender, String[] args, bo if (allowAll && args.length > 0 && args[0].contentEquals("*")) { - sender.sendMessage(_("inventoryClearingFromAll")); + sender.sendMessage(tl("inventoryClearingFromAll")); offset = 1; players = Arrays.asList(server.getOnlinePlayers()); } @@ -103,7 +103,7 @@ else if (!args[offset].equalsIgnoreCase("*")) { if (showExtended) { - sender.sendMessage(_("inventoryClearingAllItems", player.getDisplayName())); + sender.sendMessage(tl("inventoryClearingAllItems", player.getDisplayName())); } player.getInventory().clear(); } @@ -111,7 +111,7 @@ else if (type == -2) // type -2 represents double wildcard or all items and armo { if (showExtended) { - sender.sendMessage(_("inventoryClearingAllArmor", player.getDisplayName())); + sender.sendMessage(tl("inventoryClearingAllArmor", player.getDisplayName())); } player.getInventory().clear(); player.getInventory().setArmorContents(null); @@ -123,7 +123,7 @@ else if (type == -2) // type -2 represents double wildcard or all items and armo ItemStack stack = new ItemStack(type); if (showExtended) { - sender.sendMessage(_("inventoryClearingAllStack", stack.getType().toString().toLowerCase(Locale.ENGLISH), player.getDisplayName())); + sender.sendMessage(tl("inventoryClearingAllStack", stack.getType().toString().toLowerCase(Locale.ENGLISH), player.getDisplayName())); } player.getInventory().clear(type, data); } @@ -134,7 +134,7 @@ else if (amount == -1) // amount -1 means all items will be cleared final int removedAmount = (BASE_AMOUNT - removedStack.getAmount()); if (removedAmount > 0 || showExtended) { - sender.sendMessage(_("inventoryClearingStack", removedAmount, stack.getType().toString().toLowerCase(Locale.ENGLISH), player.getDisplayName())); + sender.sendMessage(tl("inventoryClearingStack", removedAmount, stack.getType().toString().toLowerCase(Locale.ENGLISH), player.getDisplayName())); } } else @@ -146,14 +146,14 @@ else if (amount == -1) // amount -1 means all items will be cleared ItemStack stack = new ItemStack(type, amount, data); if (player.getInventory().containsAtLeast(stack, amount)) { - sender.sendMessage(_("inventoryClearingStack", amount, stack.getType().toString().toLowerCase(Locale.ENGLISH), player.getDisplayName())); + sender.sendMessage(tl("inventoryClearingStack", amount, stack.getType().toString().toLowerCase(Locale.ENGLISH), player.getDisplayName())); player.getInventory().removeItem(stack); } else { if (showExtended) { - sender.sendMessage(_("inventoryClearFail", player.getDisplayName(), amount, stack.getType().toString().toLowerCase(Locale.ENGLISH))); + sender.sendMessage(tl("inventoryClearFail", player.getDisplayName(), amount, stack.getType().toString().toLowerCase(Locale.ENGLISH))); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandcompass.java b/Essentials/src/com/earth2me/essentials/commands/Commandcompass.java index 25f8c34f68..53dce03d19 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandcompass.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandcompass.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import org.bukkit.Server; @@ -53,6 +53,6 @@ else if (bearing < 338) { dir = "N"; } - user.sendMessage(_("compassBearing", dir, bearing)); + user.sendMessage(tl("compassBearing", dir, bearing)); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commanddelhome.java b/Essentials/src/com/earth2me/essentials/commands/Commanddelhome.java index 555bcd4a2a..8459700a51 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commanddelhome.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commanddelhome.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import java.util.Locale; import org.bukkit.Server; @@ -53,10 +53,10 @@ else if (user == null) if (name.equalsIgnoreCase("bed")) { - throw new Exception(_("invalidHomeName")); + throw new Exception(tl("invalidHomeName")); } user.delHome(name.toLowerCase(Locale.ENGLISH)); - sender.sendMessage(_("deleteHome", name)); + sender.sendMessage(tl("deleteHome", name)); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commanddeljail.java b/Essentials/src/com/earth2me/essentials/commands/Commanddeljail.java index 17e0411ad7..7b5937a09e 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commanddeljail.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commanddeljail.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import org.bukkit.Server; @@ -21,6 +21,6 @@ protected void run(final Server server, final CommandSource sender, final String } ess.getJails().removeJail(args[0]); - sender.sendMessage(_("deleteJail", args[0])); + sender.sendMessage(tl("deleteJail", args[0])); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commanddelwarp.java b/Essentials/src/com/earth2me/essentials/commands/Commanddelwarp.java index 754f621188..4fbf5f91c4 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commanddelwarp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commanddelwarp.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import org.bukkit.Server; @@ -21,6 +21,6 @@ public void run(final Server server, final CommandSource sender, final String co } ess.getWarps().removeWarp(args[0]); - sender.sendMessage(_("deleteWarp", args[0])); + sender.sendMessage(tl("deleteWarp", args[0])); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commanddepth.java b/Essentials/src/com/earth2me/essentials/commands/Commanddepth.java index 6c4fa26474..b7d56b6a1c 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commanddepth.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commanddepth.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import org.bukkit.Server; @@ -18,15 +18,15 @@ public void run(final Server server, final User user, final String commandLabel, final int depth = user.getLocation().getBlockY() - 63; if (depth > 0) { - user.sendMessage(_("depthAboveSea", depth)); + user.sendMessage(tl("depthAboveSea", depth)); } else if (depth < 0) { - user.sendMessage(_("depthBelowSea", (-depth))); + user.sendMessage(tl("depthBelowSea", (-depth))); } else { - user.sendMessage(_("depth")); + user.sendMessage(tl("depth")); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandeco.java b/Essentials/src/com/earth2me/essentials/commands/Commandeco.java index dac835655c..5efe54818a 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandeco.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandeco.java @@ -2,13 +2,11 @@ import com.earth2me.essentials.ChargeException; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.NumberUtil; import java.math.BigDecimal; import java.util.Locale; -import java.util.logging.Level; -import java.util.logging.Logger; import net.ess3.api.MaxMoneyException; import org.bukkit.Server; @@ -49,11 +47,11 @@ public void run(final Server server, final CommandSource sender, final String co { if (args[1].contentEquals("**")) { - server.broadcastMessage(_("resetBalAll", NumberUtil.displayCurrency(amount, ess))); + server.broadcastMessage(tl("resetBalAll", NumberUtil.displayCurrency(amount, ess))); } else if (args[1].contentEquals("*")) { - server.broadcastMessage(_("resetBal", NumberUtil.displayCurrency(amount, ess))); + server.broadcastMessage(tl("resetBal", NumberUtil.displayCurrency(amount, ess))); } } } @@ -96,11 +94,11 @@ else if (sender == null) { // Take shouldn't be able to throw a max money exception } - player.sendMessage(_("takenFromAccount", NumberUtil.displayCurrency(player.getMoney(), ess))); + player.sendMessage(tl("takenFromAccount", NumberUtil.displayCurrency(player.getMoney(), ess))); } else { - throw new ChargeException(_("insufficientFunds")); + throw new ChargeException(tl("insufficientFunds")); } } @@ -109,10 +107,10 @@ private void set(BigDecimal amount, final User player, final CommandSource sende BigDecimal minBalance = ess.getSettings().getMinMoney(); boolean underMinimum = (amount.compareTo(minBalance) < 0); player.setMoney(underMinimum ? minBalance : amount); - player.sendMessage(_("setBal", NumberUtil.displayCurrency(player.getMoney(), ess))); + player.sendMessage(tl("setBal", NumberUtil.displayCurrency(player.getMoney(), ess))); if (sender != null) { - sender.sendMessage(_("setBalOthers", player.getDisplayName(), NumberUtil.displayCurrency(player.getMoney(), ess))); + sender.sendMessage(tl("setBalOthers", player.getDisplayName(), NumberUtil.displayCurrency(player.getMoney(), ess))); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandenchant.java b/Essentials/src/com/earth2me/essentials/commands/Commandenchant.java index d268330418..1a41147b7e 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandenchant.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandenchant.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.Enchantments; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.MetaItemStack; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.StringUtil; @@ -29,7 +29,7 @@ protected void run(final Server server, final User user, final String commandLab final ItemStack stack = user.getItemInHand(); if (stack == null || stack.getType() == Material.AIR) { - throw new Exception(_("nothingInHand")); + throw new Exception(tl("nothingInHand")); } if (args.length == 0) { @@ -43,7 +43,7 @@ protected void run(final Server server, final User user, final String commandLab //enchantmentslist.add(enchantmentName); } } - throw new NotEnoughArgumentsException(_("enchantments", StringUtil.joinList(enchantmentslist.toArray()))); + throw new NotEnoughArgumentsException(tl("enchantments", StringUtil.joinList(enchantmentslist.toArray()))); } int level = -1; @@ -70,11 +70,11 @@ protected void run(final Server server, final User user, final String commandLab final String enchantmentName = enchantment.getName().toLowerCase(Locale.ENGLISH); if (level == 0) { - user.sendMessage(_("enchantmentRemoved", enchantmentName.replace('_', ' '))); + user.sendMessage(tl("enchantmentRemoved", enchantmentName.replace('_', ' '))); } else { - user.sendMessage(_("enchantmentApplied", enchantmentName.replace('_', ' '))); + user.sendMessage(tl("enchantmentApplied", enchantmentName.replace('_', ' '))); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java index 96bd4b094d..9b6242fab2 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import com.earth2me.essentials.UserMap; import com.earth2me.essentials.metrics.Metrics; @@ -79,7 +79,7 @@ private void run_disabled(final Server server, final CommandSource sender, final } if (disabledCommands.length() > 0) { - sender.sendMessage(_("blockList")); + sender.sendMessage(tl("blockList")); sender.sendMessage(disabledCommands.toString()); } } @@ -104,7 +104,7 @@ private void run_debug(final Server server, final CommandSource sender, final St private void run_reload(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception { ess.reload(); - sender.sendMessage(_("essentialsReload", ess.getDescription().getVersion())); + sender.sendMessage(tl("essentialsReload", ess.getDescription().getVersion())); } private void run_nya(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception @@ -255,7 +255,7 @@ private void run_cleanup(final Server server, final CommandSource sender, final sender.sendMessage("Unless you define larger default values, this command wil ignore people who have more than 0 money/homes/bans."); throw new Exception("/ cleanup [money] [homes] [ban count]"); } - sender.sendMessage(_("cleaning")); + sender.sendMessage(tl("cleaning")); final long daysArg = Long.parseLong(args[1]); final double moneyArg = args.length >= 3 ? Double.parseDouble(args[2].replaceAll("[^0-9\\.]", "")) : 0; @@ -307,7 +307,7 @@ public void run() user.reset(); } - sender.sendMessage(_("cleaned")); + sender.sendMessage(tl("cleaned")); } }); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandexp.java b/Essentials/src/com/earth2me/essentials/commands/Commandexp.java index 2f301fb347..86a11f7d44 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandexp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandexp.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import com.earth2me.essentials.craftbukkit.SetExpFix; import com.earth2me.essentials.utils.NumberUtil; @@ -159,7 +159,7 @@ private void expMatch(final Server server, final CommandSource sender, final Str private void showExp(final CommandSource sender, final User target) { - sender.sendMessage(_("exp", target.getDisplayName(), SetExpFix.getTotalExperience(target.getBase()), target.getLevel(), SetExpFix.getExpUntilNextLevel(target.getBase()))); + sender.sendMessage(tl("exp", target.getDisplayName(), SetExpFix.getTotalExperience(target.getBase()), target.getLevel(), SetExpFix.getExpUntilNextLevel(target.getBase()))); } //TODO: Limit who can give negative exp? @@ -200,6 +200,6 @@ private void setExp(final CommandSource sender, final User target, String strAmo amount = 0l; } SetExpFix.setTotalExperience(target.getBase(), (int)amount); - sender.sendMessage(_("expSet", target.getDisplayName(), amount)); + sender.sendMessage(tl("expSet", target.getDisplayName(), amount)); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandext.java b/Essentials/src/com/earth2me/essentials/commands/Commandext.java index 06e09aba73..8cba548ad4 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandext.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandext.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import org.bukkit.Server; import org.bukkit.entity.Player; @@ -31,7 +31,7 @@ public void run(final Server server, final User user, final String commandLabel, if (args.length < 1) { extPlayer(user.getBase()); - user.sendMessage(_("extinguish")); + user.sendMessage(tl("extinguish")); return; } @@ -42,7 +42,7 @@ public void run(final Server server, final User user, final String commandLabel, protected void updatePlayer(final Server server, final CommandSource sender, final User player, final String[] args) { extPlayer(player.getBase()); - sender.sendMessage(_("extinguishOthers", player.getDisplayName())); + sender.sendMessage(tl("extinguishOthers", player.getDisplayName())); } private void extPlayer(final Player player) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandfeed.java b/Essentials/src/com/earth2me/essentials/commands/Commandfeed.java index 85c414b625..545475ed38 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandfeed.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandfeed.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import org.bukkit.Server; import org.bukkit.entity.Player; @@ -30,7 +30,7 @@ protected void run(final Server server, final User user, final String commandLab } feedPlayer(user.getBase()); - user.sendMessage(_("feed")); + user.sendMessage(tl("feed")); } @Override @@ -50,7 +50,7 @@ protected void updatePlayer(final Server server, final CommandSource sender, fin try { feedPlayer(player.getBase()); - sender.sendMessage(_("feedOther", player.getDisplayName())); + sender.sendMessage(tl("feedOther", player.getDisplayName())); } catch (QuietAbortException e) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandfirework.java b/Essentials/src/com/earth2me/essentials/commands/Commandfirework.java index ecf0561e15..3206d931c3 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandfirework.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandfirework.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.MetaItemStack; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.NumberUtil; @@ -52,7 +52,7 @@ protected void run(final Server server, final User user, final String commandLab FireworkMeta fmeta = (FireworkMeta)stack.getItemMeta(); fmeta.clearEffects(); stack.setItemMeta(fmeta); - user.sendMessage(_("fireworkEffectsCleared")); + user.sendMessage(tl("fireworkEffectsCleared")); } else if (args.length > 1 && (args[0].equalsIgnoreCase("power") || (args[0].equalsIgnoreCase("p")))) { @@ -64,7 +64,7 @@ else if (args.length > 1 && (args[0].equalsIgnoreCase("power") || (args[0].equal } catch (NumberFormatException e) { - throw new Exception(_("invalidFireworkFormat", args[1], args[0])); + throw new Exception(tl("invalidFireworkFormat", args[1], args[0])); } stack.setItemMeta(fmeta); } @@ -82,7 +82,7 @@ else if ((args[0].equalsIgnoreCase("fire") || (args[0].equalsIgnoreCase("f"))) if (amount > serverLimit) { amount = serverLimit; - user.sendMessage(_("mobSpawnLimit")); + user.sendMessage(tl("mobSpawnLimit")); } } else @@ -117,7 +117,7 @@ else if ((args[0].equalsIgnoreCase("fire") || (args[0].equalsIgnoreCase("f"))) } catch (Exception e) { - user.sendMessage(_("fireworkSyntax")); + user.sendMessage(tl("fireworkSyntax")); throw e; } } @@ -128,15 +128,15 @@ else if ((args[0].equalsIgnoreCase("fire") || (args[0].equalsIgnoreCase("f"))) FireworkEffect effect = mStack.getFireworkBuilder().build(); if (fmeta.getEffects().size() > 0 && !user.isAuthorized("essentials.firework.multiple")) { - throw new Exception(_("multipleCharges")); + throw new Exception(tl("multipleCharges")); } fmeta.addEffect(effect); stack.setItemMeta(fmeta); } else { - user.sendMessage(_("fireworkSyntax")); - throw new Exception(_("fireworkColor")); + user.sendMessage(tl("fireworkSyntax")); + throw new Exception(tl("fireworkColor")); } } } @@ -147,7 +147,7 @@ else if ((args[0].equalsIgnoreCase("fire") || (args[0].equalsIgnoreCase("f"))) } else { - throw new Exception(_("holdFirework")); + throw new Exception(tl("holdFirework")); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandfly.java b/Essentials/src/com/earth2me/essentials/commands/Commandfly.java index dcd1d51870..3628884b19 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandfly.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandfly.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import org.bukkit.Server; @@ -60,10 +60,10 @@ void togglePlayer(CommandSource sender, User user, Boolean enabled) user.setFlying(false); } - user.sendMessage(_("flyMode", _(enabled ? "enabled" : "disabled"), user.getDisplayName())); + user.sendMessage(tl("flyMode", tl(enabled ? "enabled" : "disabled"), user.getDisplayName())); if (!sender.isPlayer() || !sender.getPlayer().equals(user.getBase())) { - sender.sendMessage(_("flyMode", _(enabled ? "enabled" : "disabled"), user.getDisplayName())); + sender.sendMessage(tl("flyMode", tl(enabled ? "enabled" : "disabled"), user.getDisplayName())); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java b/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java index 8c5c36aac5..f5ce82b951 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import java.util.List; import java.util.Locale; @@ -74,14 +74,14 @@ else if (args.length > 1 && args[1].trim().length() > 2 && user.isAuthorized("es gameMode = user.getGameMode() == GameMode.SURVIVAL ? GameMode.CREATIVE : user.getGameMode() == GameMode.CREATIVE ? GameMode.ADVENTURE : GameMode.SURVIVAL; } user.setGameMode(gameMode); - user.sendMessage(_("gameMode", _(user.getGameMode().toString().toLowerCase(Locale.ENGLISH)), user.getDisplayName())); + user.sendMessage(tl("gameMode", tl(user.getGameMode().toString().toLowerCase(Locale.ENGLISH)), user.getDisplayName())); } private void gamemodeOtherPlayers(final Server server, final CommandSource sender, final GameMode gameMode, final String name) throws NotEnoughArgumentsException, PlayerNotFoundException { if (name.trim().length() < 2 || gameMode == null) { - throw new NotEnoughArgumentsException(_("gameModeInvalid")); + throw new NotEnoughArgumentsException(tl("gameModeInvalid")); } boolean skipHidden = sender.isPlayer() && !ess.getUser(sender.getPlayer()).isAuthorized("essentials.vanish.interact"); @@ -96,7 +96,7 @@ private void gamemodeOtherPlayers(final Server server, final CommandSource sende } foundUser = true; player.setGameMode(gameMode); - sender.sendMessage(_("gameMode", _(player.getGameMode().toString().toLowerCase(Locale.ENGLISH)), player.getDisplayName())); + sender.sendMessage(tl("gameMode", tl(player.getGameMode().toString().toLowerCase(Locale.ENGLISH)), player.getDisplayName())); } if (!foundUser) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgc.java b/Essentials/src/com/earth2me/essentials/commands/Commandgc.java index 0faf037e50..42931feffb 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandgc.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandgc.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.utils.DateUtil; import com.earth2me.essentials.utils.NumberUtil; import java.lang.management.ManagementFactory; @@ -37,11 +37,11 @@ else if (tps >= 15.0) color = ChatColor.RED; } - sender.sendMessage(_("uptime", DateUtil.formatDateDiff(ManagementFactory.getRuntimeMXBean().getStartTime()))); - sender.sendMessage(_("tps", "" + color + NumberUtil.formatDouble(tps))); - sender.sendMessage(_("gcmax", (Runtime.getRuntime().maxMemory() / 1024 / 1024))); - sender.sendMessage(_("gctotal", (Runtime.getRuntime().totalMemory() / 1024 / 1024))); - sender.sendMessage(_("gcfree", (Runtime.getRuntime().freeMemory() / 1024 / 1024))); + sender.sendMessage(tl("uptime", DateUtil.formatDateDiff(ManagementFactory.getRuntimeMXBean().getStartTime()))); + sender.sendMessage(tl("tps", "" + color + NumberUtil.formatDouble(tps))); + sender.sendMessage(tl("gcmax", (Runtime.getRuntime().maxMemory() / 1024 / 1024))); + sender.sendMessage(tl("gctotal", (Runtime.getRuntime().totalMemory() / 1024 / 1024))); + sender.sendMessage(tl("gcfree", (Runtime.getRuntime().freeMemory() / 1024 / 1024))); List worlds = server.getWorlds(); for (World w : worlds) @@ -63,7 +63,7 @@ else if (tps >= 15.0) tileEntities += chunk.getTileEntities().length; } - sender.sendMessage(_("gcWorld", worldType, w.getName(), w.getLoadedChunks().length, w.getEntities().size(), tileEntities)); + sender.sendMessage(tl("gcWorld", worldType, w.getName(), w.getLoadedChunks().length, w.getEntities().size(), tileEntities)); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgetpos.java b/Essentials/src/com/earth2me/essentials/commands/Commandgetpos.java index 0a99594619..f76d28e03c 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandgetpos.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandgetpos.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import org.bukkit.Location; import org.bukkit.Server; @@ -39,15 +39,15 @@ protected void run(final Server server, final CommandSource sender, final String private void outputPosition(final CommandSource sender, final Location coords, final Location distance) { - sender.sendMessage(_("currentWorld", coords.getWorld().getName())); - sender.sendMessage(_("posX", coords.getBlockX())); - sender.sendMessage(_("posY", coords.getBlockY())); - sender.sendMessage(_("posZ", coords.getBlockZ())); - sender.sendMessage(_("posYaw", (coords.getYaw() + 180 + 360) % 360)); - sender.sendMessage(_("posPitch", coords.getPitch())); + sender.sendMessage(tl("currentWorld", coords.getWorld().getName())); + sender.sendMessage(tl("posX", coords.getBlockX())); + sender.sendMessage(tl("posY", coords.getBlockY())); + sender.sendMessage(tl("posZ", coords.getBlockZ())); + sender.sendMessage(tl("posYaw", (coords.getYaw() + 180 + 360) % 360)); + sender.sendMessage(tl("posPitch", coords.getPitch())); if (distance != null && coords.getWorld().equals(distance.getWorld())) { - sender.sendMessage(_("distance", coords.distance(distance))); + sender.sendMessage(tl("distance", coords.distance(distance))); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgive.java b/Essentials/src/com/earth2me/essentials/commands/Commandgive.java index 8c1d57a48f..1f4f66b720 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandgive.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandgive.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.MetaItemStack; import com.earth2me.essentials.User; import com.earth2me.essentials.craftbukkit.InventoryWorkaround; @@ -39,7 +39,7 @@ public void run(final Server server, final CommandSource sender, final String co : (!ess.getUser(sender.getPlayer()).isAuthorized("essentials.itemspawn.exempt") && !ess.getUser(sender.getPlayer()).canSpawnItem(stack.getTypeId())))) { - throw new Exception(_("cantSpawnItem", itemname)); + throw new Exception(tl("cantSpawnItem", itemname)); } final User giveTo = getPlayer(server, sender, args, 0); @@ -90,11 +90,11 @@ else if (ess.getSettings().getOversizedStackSize() > 0 && giveTo.isAuthorized("e if (stack.getType() == Material.AIR) { - throw new Exception(_("cantSpawnItem", "Air")); + throw new Exception(tl("cantSpawnItem", "Air")); } final String itemName = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace('_', ' '); - sender.sendMessage(_("giveSpawn", stack.getAmount(), itemName, giveTo.getDisplayName())); + sender.sendMessage(tl("giveSpawn", stack.getAmount(), itemName, giveTo.getDisplayName())); Map leftovers; @@ -109,7 +109,7 @@ else if (ess.getSettings().getOversizedStackSize() > 0 && giveTo.isAuthorized("e for (ItemStack item : leftovers.values()) { - sender.sendMessage(_("giveSpawnFailure", item.getAmount(), itemName, giveTo.getDisplayName())); + sender.sendMessage(tl("giveSpawnFailure", item.getAmount(), itemName, giveTo.getDisplayName())); } giveTo.updateInventory(); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgod.java b/Essentials/src/com/earth2me/essentials/commands/Commandgod.java index 44d930cc79..2fb647cc2b 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandgod.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandgod.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import net.ess3.api.events.GodStatusChangeEvent; import org.bukkit.Server; @@ -66,10 +66,10 @@ void togglePlayer(CommandSource sender, User user, Boolean enabled) user.setFoodLevel(20); } - user.sendMessage(_("godMode", enabled ? _("enabled") : _("disabled"))); + user.sendMessage(tl("godMode", enabled ? tl("enabled") : tl("disabled"))); if (!sender.isPlayer() || !sender.getPlayer().equals(user.getBase())) { - sender.sendMessage(_("godMode", _(enabled ? "godEnabledFor" : "godDisabledFor", user.getDisplayName()))); + sender.sendMessage(tl("godMode", tl(enabled ? "godEnabledFor" : "godDisabledFor", user.getDisplayName()))); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhat.java b/Essentials/src/com/earth2me/essentials/commands/Commandhat.java index 0b28ef1e3f..9919ffbe74 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandhat.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandhat.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import com.earth2me.essentials.craftbukkit.InventoryWorkaround; import org.bukkit.Material; @@ -25,14 +25,14 @@ protected void run(final Server server, final User user, final String commandLab final ItemStack head = inv.getHelmet(); if (head == null || head.getType() == Material.AIR) { - user.sendMessage(_("hatEmpty")); + user.sendMessage(tl("hatEmpty")); } else { final ItemStack air = new ItemStack(Material.AIR); inv.setHelmet(air); InventoryWorkaround.addItems(user.getInventory(), head); - user.sendMessage(_("hatRemoved")); + user.sendMessage(tl("hatRemoved")); } } else @@ -46,16 +46,16 @@ protected void run(final Server server, final User user, final String commandLab final ItemStack head = inv.getHelmet(); inv.setHelmet(hand); inv.setItemInHand(head); - user.sendMessage(_("hatPlaced")); + user.sendMessage(tl("hatPlaced")); } else { - user.sendMessage(_("hatArmor")); + user.sendMessage(tl("hatArmor")); } } else { - user.sendMessage(_("hatFail")); + user.sendMessage(tl("hatFail")); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandheal.java b/Essentials/src/com/earth2me/essentials/commands/Commandheal.java index 58679604d2..6890af09f7 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandheal.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandheal.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import org.bukkit.Server; import org.bukkit.entity.Player; @@ -51,7 +51,7 @@ protected void updatePlayer(final Server server, final CommandSource sender, fin try { healPlayer(player); - sender.sendMessage(_("healOther", player.getDisplayName())); + sender.sendMessage(tl("healOther", player.getDisplayName())); } catch (QuietAbortException e) { @@ -65,7 +65,7 @@ private void healPlayer(final User user) throws PlayerExemptException, QuietAbor if (player.getHealth() == 0) { - throw new PlayerExemptException(_("healDead")); + throw new PlayerExemptException(tl("healDead")); } final double amount = player.getMaxHealth() - player.getHealth(); @@ -85,7 +85,7 @@ private void healPlayer(final User user) throws PlayerExemptException, QuietAbor player.setHealth(newAmount); player.setFoodLevel(20); player.setFireTicks(0); - user.sendMessage(_("heal")); + user.sendMessage(tl("heal")); for (PotionEffect effect : player.getActivePotionEffects()) { player.removePotionEffect(effect.getType()); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java b/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java index 03cd373749..87e2c5b150 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import com.earth2me.essentials.textreader.*; import com.earth2me.essentials.utils.NumberUtil; @@ -54,6 +54,6 @@ protected void run(final Server server, final User user, final String commandLab @Override protected void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception { - sender.sendMessage(_("helpConsole")); + sender.sendMessage(tl("helpConsole")); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhelpop.java b/Essentials/src/com/earth2me/essentials/commands/Commandhelpop.java index 7f4647de56..945f7c6881 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandhelpop.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandhelpop.java @@ -2,7 +2,7 @@ import com.earth2me.essentials.CommandSource; import com.earth2me.essentials.Console; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.FormatUtil; import org.bukkit.Server; @@ -36,7 +36,7 @@ private void sendMessage(final Server server, final CommandSource sender, final { throw new NotEnoughArgumentsException(); } - final String message = _("helpOp", from, FormatUtil.stripFormat(getFinalArg(args, 0))); + final String message = tl("helpOp", from, FormatUtil.stripFormat(getFinalArg(args, 0))); CommandSender cs = Console.getCommandSender(server); cs.sendMessage(message); for (Player onlinePlayer : server.getOnlinePlayers()) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java index a030cb4cf5..f06f22b95e 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.StringUtil; @@ -54,7 +54,7 @@ public void run(final Server server, final User user, final String commandLabel, } else { - throw new Exception(_("bedMissing")); + throw new Exception(tl("bedMissing")); } } goHome(user, player, homeName.toLowerCase(Locale.ENGLISH), charge); @@ -69,7 +69,7 @@ public void run(final Server server, final User user, final String commandLabel, } else if (homes.isEmpty()) { - throw new Exception(_("noHomeSetPlayer")); + throw new Exception(tl("noHomeSetPlayer")); } else if (homes.size() == 1 && player.equals(user)) { @@ -82,14 +82,14 @@ else if (homes.size() == 1 && player.equals(user)) { if (bed != null) { - homes.add(_("bed")); + homes.add(tl("bed")); } else { - homes.add(_("bedNull")); + homes.add(tl("bedNull")); } } - user.sendMessage(_("homes", StringUtil.joinList(homes), count, getHomeLimit(player))); + user.sendMessage(tl("homes", StringUtil.joinList(homes), count, getHomeLimit(player))); } } throw new NoChargeException(); @@ -122,7 +122,7 @@ private void goHome(final User user, final User player, final String home, final if (user.getWorld() != loc.getWorld() && ess.getSettings().isWorldHomePermissions() && !user.isAuthorized("essentials.worlds." + loc.getWorld().getName())) { - throw new Exception(_("noPerm", "essentials.worlds." + loc.getWorld().getName())); + throw new Exception(tl("noPerm", "essentials.worlds." + loc.getWorld().getName())); } user.getTeleport().teleport(loc, charge, TeleportCause.COMMAND); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandignore.java b/Essentials/src/com/earth2me/essentials/commands/Commandignore.java index 250ecf6b7e..c5bc21d466 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandignore.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandignore.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import org.bukkit.Server; @@ -23,7 +23,7 @@ protected void run(final Server server, final User user, final String commandLab sb.append(s).append(" "); } String ignoredList = sb.toString().trim(); - user.sendMessage(ignoredList.length() > 0 ? _("ignoredList", ignoredList) : _("noIgnored")); + user.sendMessage(ignoredList.length() > 0 ? tl("ignoredList", ignoredList) : tl("noIgnored")); } else { @@ -41,17 +41,17 @@ protected void run(final Server server, final User user, final String commandLab throw new PlayerNotFoundException(); } if (player.isIgnoreExempt()) { - user.sendMessage(_("ignoreExempt")); + user.sendMessage(tl("ignoreExempt")); } else if (user.isIgnoredPlayer(player)) { user.setIgnoredPlayer(player, false); - user.sendMessage(_("unignorePlayer", player.getName())); + user.sendMessage(tl("unignorePlayer", player.getName())); } else { user.setIgnoredPlayer(player, true); - user.sendMessage(_("ignorePlayer", player.getName())); + user.sendMessage(tl("ignorePlayer", player.getName())); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commanditem.java b/Essentials/src/com/earth2me/essentials/commands/Commanditem.java index 09715dff1d..ef5756ec48 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commanditem.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commanditem.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.MetaItemStack; import com.earth2me.essentials.User; import com.earth2me.essentials.craftbukkit.InventoryWorkaround; @@ -34,7 +34,7 @@ public void run(final Server server, final User user, final String commandLabel, : (!user.isAuthorized("essentials.itemspawn.exempt") && !user.canSpawnItem(stack.getTypeId()))) { - throw new Exception(_("cantSpawnItem", itemname)); + throw new Exception(tl("cantSpawnItem", itemname)); } try { @@ -68,11 +68,11 @@ else if (ess.getSettings().getOversizedStackSize() > 0 && user.isAuthorized("ess if (stack.getType() == Material.AIR) { - throw new Exception(_("cantSpawnItem", "Air")); + throw new Exception(tl("cantSpawnItem", "Air")); } final String displayName = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace('_', ' '); - user.sendMessage(_("itemSpawn", stack.getAmount(), displayName)); + user.sendMessage(tl("itemSpawn", stack.getAmount(), displayName)); if (user.isAuthorized("essentials.oversizedstacks")) { InventoryWorkaround.addOversizedItems(user.getInventory(), ess.getSettings().getOversizedStackSize(), stack); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commanditemdb.java b/Essentials/src/com/earth2me/essentials/commands/Commanditemdb.java index a07b10459f..02ea1c637c 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commanditemdb.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commanditemdb.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import org.bukkit.Material; import org.bukkit.Server; import org.bukkit.inventory.ItemStack; @@ -35,7 +35,7 @@ protected void run(Server server, CommandSource sender, String commandLabel, Str { itemStack = ess.getItemDb().get(args[0]); } - sender.sendMessage(_("itemType", itemStack.getType().toString(), itemStack.getTypeId() + ":" + Integer.toString(itemStack.getDurability()))); + sender.sendMessage(tl("itemType", itemStack.getType().toString(), itemStack.getTypeId() + ":" + Integer.toString(itemStack.getDurability()))); if (itemHeld && itemStack.getType() != Material.AIR) { @@ -43,13 +43,13 @@ protected void run(Server server, CommandSource sender, String commandLabel, Str int durability = ((maxuses + 1) - itemStack.getDurability()); if (maxuses != 0) { - sender.sendMessage(_("durability", Integer.toString(durability))); + sender.sendMessage(tl("durability", Integer.toString(durability))); } } final String itemNameList = ess.getItemDb().names(itemStack); if (itemNameList != null) { - sender.sendMessage(_("itemNames", ess.getItemDb().names(itemStack))); + sender.sendMessage(tl("itemNames", ess.getItemDb().names(itemStack))); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandjump.java b/Essentials/src/com/earth2me/essentials/commands/Commandjump.java index e9e60bdce1..228df82b03 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandjump.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandjump.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.LocationUtil; @@ -46,7 +46,7 @@ public void run(final Server server, final User user, final String commandLabel, } catch (NullPointerException ex) { - throw new Exception(_("jumpError"), ex); + throw new Exception(tl("jumpError"), ex); } final Trade charge = new Trade(this.getName(), ess); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkick.java b/Essentials/src/com/earth2me/essentials/commands/Commandkick.java index 316b503008..30d7d9d8d3 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkick.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkick.java @@ -2,7 +2,7 @@ import com.earth2me.essentials.CommandSource; import com.earth2me.essentials.Console; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.FormatUtil; import java.util.logging.Level; @@ -35,17 +35,17 @@ public void run(final Server server, final CommandSource sender, final String co if (target.isAuthorized("essentials.kick.exempt")) { - throw new Exception(_("kickExempt")); + throw new Exception(tl("kickExempt")); } } - String kickReason = args.length > 1 ? getFinalArg(args, 1) : _("kickDefault"); + String kickReason = args.length > 1 ? getFinalArg(args, 1) : tl("kickDefault"); kickReason = FormatUtil.replaceFormat(kickReason.replace("\\n", "\n").replace("|", "\n")); target.kickPlayer(kickReason); final String senderName = sender.isPlayer() ? sender.getPlayer().getDisplayName() : Console.NAME; - server.getLogger().log(Level.INFO, _("playerKicked", senderName, target.getName(), kickReason)); - ess.broadcastMessage("essentials.kick.notify", _("playerKicked", senderName, target.getName(), kickReason)); + server.getLogger().log(Level.INFO, tl("playerKicked", senderName, target.getName(), kickReason)); + ess.broadcastMessage("essentials.kick.notify", tl("playerKicked", senderName, target.getName(), kickReason)); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkickall.java b/Essentials/src/com/earth2me/essentials/commands/Commandkickall.java index 48833b1de3..ba885731af 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkickall.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkickall.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.utils.FormatUtil; import org.bukkit.Server; import org.bukkit.entity.Player; @@ -17,7 +17,7 @@ public Commandkickall() @Override public void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception { - String kickReason = args.length > 0 ? getFinalArg(args, 0) : _("kickDefault"); + String kickReason = args.length > 0 ? getFinalArg(args, 0) : tl("kickDefault"); kickReason = FormatUtil.replaceFormat(kickReason.replace("\\n", "\n").replace("|", "\n")); for (Player onlinePlayer : server.getOnlinePlayers()) @@ -27,6 +27,6 @@ public void run(final Server server, final CommandSource sender, final String co onlinePlayer.kickPlayer(kickReason); } } - sender.sendMessage(_("kickedAll")); + sender.sendMessage(tl("kickedAll")); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkill.java b/Essentials/src/com/earth2me/essentials/commands/Commandkill.java index 2de3d1750d..6c40623717 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkill.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkill.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import org.bukkit.Server; import org.bukkit.entity.Player; @@ -32,7 +32,7 @@ protected void updatePlayer(final Server server, final CommandSource sender, fin final Player matchPlayer = user.getBase(); if (sender.isPlayer() && user.isAuthorized("essentials.kill.exempt") && !ess.getUser(sender.getPlayer()).isAuthorized("essentials.kill.force")) { - throw new PlayerExemptException(_("killExempt", matchPlayer.getDisplayName())); + throw new PlayerExemptException(tl("killExempt", matchPlayer.getDisplayName())); } final EntityDamageEvent ede = new EntityDamageEvent(matchPlayer, sender.isPlayer() && sender.getPlayer().getName().equals(matchPlayer.getName()) ? EntityDamageEvent.DamageCause.SUICIDE : EntityDamageEvent.DamageCause.CUSTOM, Short.MAX_VALUE); server.getPluginManager().callEvent(ede); @@ -47,6 +47,6 @@ protected void updatePlayer(final Server server, final CommandSource sender, fin matchPlayer.setHealth(0); } - sender.sendMessage(_("kill", matchPlayer.getDisplayName())); + sender.sendMessage(tl("kill", matchPlayer.getDisplayName())); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java index d7f4c2a934..aeb9a713f7 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.Kit; import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; @@ -25,7 +25,7 @@ public void run(final Server server, final User user, final String commandLabel, if (args.length < 1) { final String kitList = Kit.listKits(ess, user); - user.sendMessage(kitList.length() > 0 ? _("kits", kitList) : _("noKits")); + user.sendMessage(kitList.length() > 0 ? tl("kits", kitList) : tl("noKits")); throw new NoChargeException(); } else if (args.length > 1 && user.isAuthorized("essentials.kit.others")) @@ -47,7 +47,7 @@ public void run(final Server server, final CommandSource sender, final String co if (args.length < 2) { final String kitList = Kit.listKits(ess, null); - sender.sendMessage(kitList.length() > 0 ? _("kits", kitList) : _("noKits")); + sender.sendMessage(kitList.length() > 0 ? tl("kits", kitList) : tl("noKits")); throw new NoChargeException(); } else @@ -59,8 +59,8 @@ public void run(final Server server, final CommandSource sender, final String co final List items = Kit.getItems(ess, userTo, kitName, kit); Kit.expandItems(ess, userTo, items); - sender.sendMessage(_("kitGiveTo", kitName, userTo.getDisplayName())); - userTo.sendMessage(_("kitReceive", kitName)); + sender.sendMessage(tl("kitGiveTo", kitName, userTo.getDisplayName())); + userTo.sendMessage(tl("kitReceive", kitName)); } } @@ -68,14 +68,14 @@ private void giveKit(User userTo, User userFrom, String kitName) throws Exceptio { if (kitName.isEmpty()) { - throw new Exception(_("kitError2")); + throw new Exception(tl("kitError2")); } final Map kit = ess.getSettings().getKit(kitName); if (!userFrom.isAuthorized("essentials.kits." + kitName)) { - throw new Exception(_("noKitPermission", "essentials.kits." + kitName)); + throw new Exception(tl("noKitPermission", "essentials.kits." + kitName)); } final List items = Kit.getItems(ess, userTo, kitName, kit); @@ -87,7 +87,7 @@ private void giveKit(User userTo, User userFrom, String kitName) throws Exceptio Kit.expandItems(ess, userTo, items); charge.charge(userFrom); - userFrom.sendMessage(_("kitGiveTo", kitName, userTo.getDisplayName())); - userTo.sendMessage(_("kitReceive", kitName)); + userFrom.sendMessage(tl("kitGiveTo", kitName, userTo.getDisplayName())); + userTo.sendMessage(tl("kitReceive", kitName)); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java b/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java index 12cff3f1ad..a3f7e10a4a 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import org.bukkit.Server; import org.bukkit.entity.LightningStrike; @@ -46,7 +46,7 @@ public void run(final Server server, final CommandSource sender, final String co @Override protected void updatePlayer(final Server server, final CommandSource sender, final User matchUser, final String[] args) { - sender.sendMessage(_("lightningUse", matchUser.getDisplayName())); + sender.sendMessage(tl("lightningUse", matchUser.getDisplayName())); final LightningStrike strike = matchUser.getBase().getWorld().strikeLightningEffect(matchUser.getBase().getLocation()); if (!matchUser.isGodModeEnabled()) @@ -55,7 +55,7 @@ protected void updatePlayer(final Server server, final CommandSource sender, fin } if (ess.getSettings().warnOnSmite()) { - matchUser.sendMessage(_("lightningSmited")); + matchUser.sendMessage(tl("lightningSmited")); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandlist.java b/Essentials/src/com/earth2me/essentials/commands/Commandlist.java index 0e3620a34d..46d8dd95aa 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandlist.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandlist.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.PlayerList; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.FormatUtil; @@ -77,7 +77,7 @@ private void sendGroupedList(CommandSource sender, String commandLabel, Map limit) { - sender.sendMessage(PlayerList.outputFormat(oConfigGroup, _("groupNumber", matchedList.size(), commandLabel, FormatUtil.stripFormat(configGroup)))); + sender.sendMessage(PlayerList.outputFormat(oConfigGroup, tl("groupNumber", matchedList.size(), commandLabel, FormatUtil.stripFormat(configGroup)))); } else { @@ -124,7 +124,7 @@ private void sendGroupedList(CommandSource sender, String commandLabel, Map mail = user.getMails(); if (mail.isEmpty()) { - user.sendMessage(_("noMail")); + user.sendMessage(tl("noMail")); throw new NoChargeException(); } for (String messages : mail) { user.sendMessage(messages); } - user.sendMessage(_("mailClear")); + user.sendMessage(tl("mailClear")); return; } if (args.length >= 3 && "send".equalsIgnoreCase(args[0])) { if (!user.isAuthorized("essentials.mail.send")) { - throw new Exception(_("noPerm", "essentials.mail.send")); + throw new Exception(tl("noPerm", "essentials.mail.send")); } if (user.isMuted()) { - throw new Exception(_("voiceSilenced")); + throw new Exception(tl("voiceSilenced")); } User u = ess.getUser(args[1]); if (u == null) { - throw new Exception(_("playerNeverOnServer", args[1])); + throw new Exception(tl("playerNeverOnServer", args[1])); } if (!u.isIgnoredPlayer(user)) { final String mail = user.getName() + ": " + StringUtil.sanitizeString(FormatUtil.stripFormat(getFinalArg(args, 2))); if (mail.length() > 1000) { - throw new Exception(_("mailTooLong")); + throw new Exception(tl("mailTooLong")); } if (Math.abs(System.currentTimeMillis() - timestamp) > 60000) { @@ -72,27 +72,27 @@ public void run(final Server server, final User user, final String commandLabel, mailsPerMinute++; if (mailsPerMinute > ess.getSettings().getMailsPerMinute()) { - throw new Exception(_("mailDelay", ess.getSettings().getMailsPerMinute())); + throw new Exception(tl("mailDelay", ess.getSettings().getMailsPerMinute())); } u.addMail(mail); } - user.sendMessage(_("mailSent")); + user.sendMessage(tl("mailSent")); return; } if (args.length > 1 && "sendall".equalsIgnoreCase(args[0])) { if (!user.isAuthorized("essentials.mail.sendall")) { - throw new Exception(_("noPerm", "essentials.mail.sendall")); + throw new Exception(tl("noPerm", "essentials.mail.sendall")); } ess.runTaskAsynchronously(new SendAll(user.getName() + ": " + FormatUtil.stripFormat(getFinalArg(args, 1)))); - user.sendMessage(_("mailSent")); + user.sendMessage(tl("mailSent")); return; } if (args.length >= 1 && "clear".equalsIgnoreCase(args[0])) { user.setMails(null); - user.sendMessage(_("mailCleared")); + user.sendMessage(tl("mailCleared")); return; } throw new NotEnoughArgumentsException(); @@ -103,27 +103,27 @@ protected void run(Server server, CommandSource sender, String commandLabel, Str { if (args.length >= 1 && "read".equalsIgnoreCase(args[0])) { - throw new Exception(_("onlyPlayers", commandLabel + " read")); + throw new Exception(tl("onlyPlayers", commandLabel + " read")); } else if (args.length >= 1 && "clear".equalsIgnoreCase(args[0])) { - throw new Exception(_("onlyPlayers", commandLabel + " clear")); + throw new Exception(tl("onlyPlayers", commandLabel + " clear")); } else if (args.length >= 3 && "send".equalsIgnoreCase(args[0])) { User u = ess.getUser(args[1]); if (u == null) { - throw new Exception(_("playerNeverOnServer", args[1])); + throw new Exception(tl("playerNeverOnServer", args[1])); } u.addMail("Server: " + getFinalArg(args, 2)); - sender.sendMessage(_("mailSent")); + sender.sendMessage(tl("mailSent")); return; } else if (args.length >= 2 && "sendall".equalsIgnoreCase(args[0])) { ess.runTaskAsynchronously(new SendAll("Server: " + getFinalArg(args, 1))); - sender.sendMessage(_("mailSent")); + sender.sendMessage(tl("mailSent")); return; } else if (args.length >= 2) @@ -132,10 +132,10 @@ else if (args.length >= 2) User u = ess.getUser(args[0]); if (u == null) { - throw new Exception(_("playerNeverOnServer", args[0])); + throw new Exception(tl("playerNeverOnServer", args[0])); } u.addMail("Server: " + getFinalArg(args, 1)); - sender.sendMessage(_("mailSent")); + sender.sendMessage(tl("mailSent")); return; } throw new NotEnoughArgumentsException(); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandme.java b/Essentials/src/com/earth2me/essentials/commands/Commandme.java index 382bbf06a3..6dadd0a9c4 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandme.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandme.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.FormatUtil; import org.bukkit.Server; @@ -19,7 +19,7 @@ public void run(Server server, User user, String commandLabel, String[] args) th { if (user.isMuted()) { - throw new Exception(_("voiceSilenced")); + throw new Exception(tl("voiceSilenced")); } if (args.length < 1) @@ -31,7 +31,7 @@ public void run(Server server, User user, String commandLabel, String[] args) th message = FormatUtil.formatMessage(user, "essentials.chat", message); user.setDisplayNick(); - ess.broadcastMessage(user, _("action", user.getDisplayName(), message)); + ess.broadcastMessage(user, tl("action", user.getDisplayName(), message)); } @Override @@ -45,6 +45,6 @@ public void run(Server server, CommandSource sender, String commandLabel, String String message = getFinalArg(args, 0); message = FormatUtil.replaceFormat(message); - ess.getServer().broadcastMessage(_("action", "@", message)); + ess.getServer().broadcastMessage(tl("action", "@", message)); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmore.java b/Essentials/src/com/earth2me/essentials/commands/Commandmore.java index e50e21e454..61e951e1ea 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandmore.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandmore.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import java.util.Locale; import org.bukkit.Server; @@ -20,12 +20,12 @@ public void run(final Server server, final User user, final String commandLabel, final ItemStack stack = user.getItemInHand(); if (stack == null) { - throw new Exception(_("cantSpawnItem", "Air")); + throw new Exception(tl("cantSpawnItem", "Air")); } if (stack.getAmount() >= ((user.isAuthorized("essentials.oversizedstacks")) ? ess.getSettings().getOversizedStackSize() : stack.getMaxStackSize())) { - throw new Exception(_("fullStack")); + throw new Exception(tl("fullStack")); } final String itemname = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", ""); if (ess.getSettings().permissionBasedItemSpawn() @@ -35,7 +35,7 @@ public void run(final Server server, final User user, final String commandLabel, : (!user.isAuthorized("essentials.itemspawn.exempt") && !user.canSpawnItem(stack.getTypeId()))) { - throw new Exception(_("cantSpawnItem", itemname)); + throw new Exception(tl("cantSpawnItem", itemname)); } if (user.isAuthorized("essentials.oversizedstacks")) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java b/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java index f6d6bf45f5..6427427305 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java @@ -2,7 +2,7 @@ import com.earth2me.essentials.CommandSource; import com.earth2me.essentials.Console; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.IReplyTo; import com.earth2me.essentials.User; import static com.earth2me.essentials.commands.EssentialsCommand.getFinalArg; @@ -13,7 +13,7 @@ public class Commandmsg extends EssentialsLoopCommand { - final String translatedMe = _("me"); + final String translatedMe = tl("me"); public Commandmsg() { @@ -35,7 +35,7 @@ public void run(Server server, CommandSource sender, String commandLabel, String User user = ess.getUser(sender.getPlayer()); if (user.isMuted()) { - throw new Exception(_("voiceSilenced")); + throw new Exception(tl("voiceSilenced")); } message = FormatUtil.formatMessage(user, "essentials.msg", message); canWildcard = user.isAuthorized("essentials.msg.multiple"); @@ -51,9 +51,9 @@ public void run(Server server, CommandSource sender, String commandLabel, String final IReplyTo replyTo = sender.isPlayer() ? ess.getUser(sender.getPlayer()) : Console.getConsoleReplyTo(); final String senderName = sender.isPlayer() ? sender.getPlayer().getDisplayName() : Console.NAME; - sender.sendMessage(_("msgFormat", translatedMe, Console.NAME, message)); + sender.sendMessage(tl("msgFormat", translatedMe, Console.NAME, message)); CommandSender cs = Console.getCommandSender(server); - cs.sendMessage(_("msgFormat", senderName, translatedMe, message)); + cs.sendMessage(tl("msgFormat", senderName, translatedMe, message)); replyTo.setReplyTo(new CommandSource(cs)); Console.getConsoleReplyTo().setReplyTo(sender); return; @@ -70,16 +70,16 @@ protected void updatePlayer(final Server server, final CommandSource sender, fin if (matchedUser.isAfk()) { - sender.sendMessage(_("userAFK", matchedUser.getDisplayName())); + sender.sendMessage(tl("userAFK", matchedUser.getDisplayName())); } - sender.sendMessage(_("msgFormat", translatedMe, matchedUser.getDisplayName(), args[0])); + sender.sendMessage(tl("msgFormat", translatedMe, matchedUser.getDisplayName(), args[0])); if (sender.isPlayer() && matchedUser.isIgnoredPlayer(ess.getUser(sender.getPlayer()))) { return; } - matchedUser.sendMessage(_("msgFormat", senderName, translatedMe, args[0])); + matchedUser.sendMessage(tl("msgFormat", senderName, translatedMe, args[0])); replyTo.setReplyTo(matchedUser.getSource()); matchedUser.setReplyTo(sender); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmute.java b/Essentials/src/com/earth2me/essentials/commands/Commandmute.java index 0da22d7e42..e27c97ead3 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandmute.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandmute.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.OfflinePlayer; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.DateUtil; @@ -37,14 +37,14 @@ public void run(final Server server, final CommandSource sender, final String co { if (sender.isPlayer() && !ess.getUser(sender.getPlayer()).isAuthorized("essentials.mute.offline")) { - throw new Exception(_("muteExemptOffline")); + throw new Exception(tl("muteExemptOffline")); } } else { if (user.isAuthorized("essentials.mute.exempt") && sender.isPlayer()) { - throw new Exception(_("muteExempt")); + throw new Exception(tl("muteExempt")); } } @@ -66,27 +66,27 @@ public void run(final Server server, final CommandSource sender, final String co if (nomatch) { - sender.sendMessage(_("userUnknown", user.getName())); + sender.sendMessage(tl("userUnknown", user.getName())); } if (muted) { if (muteTimestamp > 0) { - sender.sendMessage(_("mutedPlayerFor", user.getDisplayName(), muteTime)); - user.sendMessage(_("playerMutedFor", muteTime)); + sender.sendMessage(tl("mutedPlayerFor", user.getDisplayName(), muteTime)); + user.sendMessage(tl("playerMutedFor", muteTime)); } else { - sender.sendMessage(_("mutedPlayer", user.getDisplayName())); - user.sendMessage(_("playerMuted")); + sender.sendMessage(tl("mutedPlayer", user.getDisplayName())); + user.sendMessage(tl("playerMuted")); } - ess.broadcastMessage("essentials.mute.notify", _("muteNotify", sender.getSender().getName(), user.getName(), muteTime)); + ess.broadcastMessage("essentials.mute.notify", tl("muteNotify", sender.getSender().getName(), user.getName(), muteTime)); } else { - sender.sendMessage(_("unmutedPlayer", user.getDisplayName())); - user.sendMessage(_("playerUnmuted")); + sender.sendMessage(tl("unmutedPlayer", user.getDisplayName())); + user.sendMessage(tl("playerUnmuted")); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandnear.java b/Essentials/src/com/earth2me/essentials/commands/Commandnear.java index 8cec4dd661..846534baf9 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandnear.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandnear.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import org.bukkit.Location; import org.bukkit.Server; @@ -62,7 +62,7 @@ protected void run(final Server server, final User user, final String commandLab if (radius > maxRadius && !user.isAuthorized("essentials.near.maxexempt")) { - user.sendMessage(_("radiusTooBig", maxRadius)); + user.sendMessage(tl("radiusTooBig", maxRadius)); radius = maxRadius; } @@ -70,7 +70,7 @@ protected void run(final Server server, final User user, final String commandLab { otherUser = user; } - user.sendMessage(_("nearbyPlayers", getLocal(server, otherUser, radius))); + user.sendMessage(tl("nearbyPlayers", getLocal(server, otherUser, radius))); } @Override @@ -92,7 +92,7 @@ protected void run(final Server server, final CommandSource sender, final String { } } - sender.sendMessage(_("nearbyPlayers", getLocal(server, otherUser, radius))); + sender.sendMessage(tl("nearbyPlayers", getLocal(server, otherUser, radius))); } private String getLocal(final Server server, final User user, final long radius) @@ -125,6 +125,6 @@ private String getLocal(final Server server, final User user, final long radius) } } } - return output.length() > 1 ? output.toString() : _("none"); + return output.length() > 1 ? output.toString() : tl("none"); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandnick.java b/Essentials/src/com/earth2me/essentials/commands/Commandnick.java index dc27ca5579..45fe4ce7e9 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandnick.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandnick.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.FormatUtil; import java.util.Locale; @@ -26,14 +26,14 @@ public void run(final Server server, final User user, final String commandLabel, } if (!ess.getSettings().changeDisplayName()) { - throw new Exception(_("nickDisplayName")); + throw new Exception(tl("nickDisplayName")); } if (args.length > 1 && user.isAuthorized("essentials.nick.others")) { final String[] nickname = formatNickname(user, args[1]).split(" "); loopOfflinePlayers(server, user.getSource(), false, true, args[0], nickname); - user.sendMessage(_("nickChanged")); + user.sendMessage(tl("nickChanged")); } else { @@ -51,11 +51,11 @@ public void run(final Server server, final CommandSource sender, final String co } if (!ess.getSettings().changeDisplayName()) { - throw new Exception(_("nickDisplayName")); + throw new Exception(tl("nickDisplayName")); } final String[] nickname = formatNickname(null, args[1]).split(" "); loopOfflinePlayers(server, sender, false, true, args[0], nickname); - sender.sendMessage(_("nickChanged")); + sender.sendMessage(tl("nickChanged")); } @Override @@ -65,21 +65,21 @@ protected void updatePlayer(final Server server, final CommandSource sender, fin if (target.getName().equalsIgnoreCase(nick)) { setNickname(server, sender, target, nick); - target.sendMessage(_("nickNoMore")); + target.sendMessage(tl("nickNoMore")); } else if ("off".equalsIgnoreCase(nick)) { setNickname(server, sender, target, null); - target.sendMessage(_("nickNoMore")); + target.sendMessage(tl("nickNoMore")); } else if (nickInUse(server, target, nick)) { - throw new NotEnoughArgumentsException(_("nickInUse")); + throw new NotEnoughArgumentsException(tl("nickInUse")); } else { setNickname(server, sender, target, nick); - target.sendMessage(_("nickSet", target.getDisplayName())); + target.sendMessage(tl("nickSet", target.getDisplayName())); } } @@ -88,15 +88,15 @@ private String formatNickname(final User user, final String nick) throws Excepti String newNick = user == null ? FormatUtil.replaceFormat(nick) : FormatUtil.formatString(user, "essentials.nick", nick); if (!newNick.matches("^[a-zA-Z_0-9\u00a7]+$")) { - throw new Exception(_("nickNamesAlpha")); + throw new Exception(tl("nickNamesAlpha")); } else if (newNick.length() > ess.getSettings().getMaxNickLength()) { - throw new Exception(_("nickTooLong")); + throw new Exception(tl("nickTooLong")); } else if (FormatUtil.stripFormat(newNick).length() < 1) { - throw new Exception(_("nickNamesAlpha")); + throw new Exception(tl("nickNamesAlpha")); } return newNick; } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java b/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java index 173e28b5ca..7e6e347c39 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -44,7 +44,7 @@ protected void run(final Server server, final CommandSource sender, final String { continue; } - player.sendMessage(_("nuke")); + player.sendMessage(tl("nuke")); final Location loc = player.getLocation(); final World world = loc.getWorld(); for (int x = -10; x <= 10; x += 5) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandpay.java b/Essentials/src/com/earth2me/essentials/commands/Commandpay.java index 51c2d19830..01492faedb 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandpay.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandpay.java @@ -2,7 +2,7 @@ import com.earth2me.essentials.ChargeException; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; import java.math.BigDecimal; @@ -42,7 +42,7 @@ protected void updatePlayer(final Server server, final CommandSource sender, fin } catch (MaxMoneyException ex) { - sender.sendMessage(_("maxMoney")); + sender.sendMessage(tl("maxMoney")); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandping.java b/Essentials/src/com/earth2me/essentials/commands/Commandping.java index 0597ae6e5f..1535ad6a21 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandping.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandping.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.utils.FormatUtil; import org.bukkit.Server; @@ -19,7 +19,7 @@ public void run(final Server server, final CommandSource sender, final String co if (args.length < 1) { - sender.sendMessage(_("pong")); + sender.sendMessage(tl("pong")); } else { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandpotion.java b/Essentials/src/com/earth2me/essentials/commands/Commandpotion.java index 73a6157b9c..b7dbd4dfa3 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandpotion.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandpotion.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.MetaItemStack; import com.earth2me.essentials.Potions; import com.earth2me.essentials.User; @@ -40,7 +40,7 @@ protected void run(final Server server, final User user, final String commandLab potionslist.add(entry.getKey()); } } - throw new NotEnoughArgumentsException(_("potions", StringUtil.joinList(potionslist.toArray()))); + throw new NotEnoughArgumentsException(tl("potions", StringUtil.joinList(potionslist.toArray()))); } if (stack.getType() == Material.POTION) @@ -78,7 +78,7 @@ else if (args.length < 3) } else { - user.sendMessage(_("invalidPotion")); + user.sendMessage(tl("invalidPotion")); throw new NotEnoughArgumentsException(); } } @@ -87,7 +87,7 @@ else if (args.length < 3) } else { - throw new Exception(_("holdPotion")); + throw new Exception(tl("holdPotion")); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java b/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java index 582a8fe996..65bb733201 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandpowertool.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.StringUtil; import java.util.ArrayList; @@ -47,13 +47,13 @@ protected void powertool(final Server server, final CommandSource sender, final if (command != null && command.equalsIgnoreCase("d:")) { user.clearAllPowertools(); - sender.sendMessage(_("powerToolClearAll")); + sender.sendMessage(tl("powerToolClearAll")); return; } if (itemStack == null || itemStack.getType() == Material.AIR) { - throw new Exception(_("powerToolAir")); + throw new Exception(tl("powerToolAir")); } final String itemName = itemStack.getType().toString().toLowerCase(Locale.ENGLISH).replaceAll("_", " "); @@ -64,11 +64,11 @@ protected void powertool(final Server server, final CommandSource sender, final { if (powertools == null || powertools.isEmpty()) { - throw new Exception(_("powerToolListEmpty", itemName)); + throw new Exception(tl("powerToolListEmpty", itemName)); } else { - sender.sendMessage(_("powerToolList", StringUtil.joinList(powertools), itemName)); + sender.sendMessage(tl("powerToolList", StringUtil.joinList(powertools), itemName)); } throw new NoChargeException(); } @@ -77,11 +77,11 @@ protected void powertool(final Server server, final CommandSource sender, final command = command.substring(2); if (!powertools.contains(command)) { - throw new Exception(_("powerToolNoSuchCommandAssigned", command, itemName)); + throw new Exception(tl("powerToolNoSuchCommandAssigned", command, itemName)); } powertools.remove(command); - sender.sendMessage(_("powerToolRemove", command, itemName)); + sender.sendMessage(tl("powerToolRemove", command, itemName)); } else { @@ -89,12 +89,12 @@ protected void powertool(final Server server, final CommandSource sender, final { if (sender.isPlayer() && !ess.getUser(sender.getPlayer()).isAuthorized("essentials.powertool.append")) { - throw new Exception(_("noPerm", "essentials.powertool.append")); + throw new Exception(tl("noPerm", "essentials.powertool.append")); } command = command.substring(2); if (powertools.contains(command)) { - throw new Exception(_("powerToolAlreadySet", command, itemName)); + throw new Exception(tl("powerToolAlreadySet", command, itemName)); } } else if (powertools != null && !powertools.isEmpty()) @@ -108,7 +108,7 @@ else if (powertools != null && !powertools.isEmpty()) } powertools.add(command); - sender.sendMessage(_("powerToolAttach", StringUtil.joinList(powertools), itemName)); + sender.sendMessage(tl("powerToolAttach", StringUtil.joinList(powertools), itemName)); } } else @@ -117,13 +117,13 @@ else if (powertools != null && !powertools.isEmpty()) { powertools.clear(); } - sender.sendMessage(_("powerToolRemoveAll", itemName)); + sender.sendMessage(tl("powerToolRemoveAll", itemName)); } if (!user.arePowerToolsEnabled()) { user.setPowerToolsEnabled(true); - user.sendMessage(_("powerToolsEnabled")); + user.sendMessage(tl("powerToolsEnabled")); } user.setPowertool(itemStack, powertools); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandpowertooltoggle.java b/Essentials/src/com/earth2me/essentials/commands/Commandpowertooltoggle.java index c8b737dfa2..a71f3887d1 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandpowertooltoggle.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandpowertooltoggle.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import org.bukkit.Server; @@ -17,11 +17,11 @@ protected void run(final Server server, final User user, final String commandLab { if (!user.hasPowerTools()) { - user.sendMessage(_("noPowerTools")); + user.sendMessage(tl("noPowerTools")); return; } user.sendMessage(user.togglePowerToolsEnabled() - ? _("powerToolsEnabled") - : _("powerToolsDisabled")); + ? tl("powerToolsEnabled") + : tl("powerToolsDisabled")); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandptime.java b/Essentials/src/com/earth2me/essentials/commands/Commandptime.java index 5cca2f6f59..077cdef933 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandptime.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandptime.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.DescParseTickFormat; import java.util.*; @@ -50,7 +50,7 @@ public void run(final Server server, final CommandSource sender, final String co User user = ess.getUser(sender.getPlayer()); if (user != null && (!users.contains(user) || users.size() > 1) && !user.isAuthorized("essentials.ptime.others")) { - user.sendMessage(_("pTimeOthersPermission")); + user.sendMessage(tl("pTimeOthersPermission")); return; } } @@ -96,25 +96,25 @@ private void getUsersTime(final CommandSource sender, final Collection use { if (users.size() > 1) { - sender.sendMessage(_("pTimePlayers")); + sender.sendMessage(tl("pTimePlayers")); } for (User user : users) { if (user.getPlayerTimeOffset() == 0) { - sender.sendMessage(_("pTimeNormal", user.getName())); + sender.sendMessage(tl("pTimeNormal", user.getName())); } else { String time = DescParseTickFormat.format(user.getPlayerTime()); if (!user.isPlayerTimeRelative()) { - sender.sendMessage(_("pTimeCurrentFixed", user.getName(), time)); + sender.sendMessage(tl("pTimeCurrentFixed", user.getName(), time)); } else { - sender.sendMessage(_("pTimeCurrent", user.getName(), time)); + sender.sendMessage(tl("pTimeCurrent", user.getName(), time)); } } } @@ -165,18 +165,18 @@ private void setUsersTime(final CommandSource sender, final Collection use // Inform the sender of the change if (ticks == null) { - sender.sendMessage(_("pTimeReset", msg.toString())); + sender.sendMessage(tl("pTimeReset", msg.toString())); } else { String time = DescParseTickFormat.format(ticks); if (!relative) { - sender.sendMessage(_("pTimeSetFixed", time, msg.toString())); + sender.sendMessage(tl("pTimeSetFixed", time, msg.toString())); } else { - sender.sendMessage(_("pTimeSet", time, msg.toString())); + sender.sendMessage(tl("pTimeSet", time, msg.toString())); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandpweather.java b/Essentials/src/com/earth2me/essentials/commands/Commandpweather.java index 0c067b6822..79969a0cd4 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandpweather.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandpweather.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import java.util.*; import org.bukkit.Server; @@ -59,7 +59,7 @@ public void run(final Server server, final CommandSource sender, final String co User user = ess.getUser(sender.getPlayer()); if (user != null && (!users.contains(user) || users.size() > 1) && !user.isAuthorized("essentials.pweather.others")) { - user.sendMessage(_("pWeatherOthersPermission")); + user.sendMessage(tl("pWeatherOthersPermission")); return; } } @@ -74,18 +74,18 @@ private void getUsersWeather(final CommandSource sender, final Collection { if (users.size() > 1) { - sender.sendMessage(_("pWeatherPlayers")); + sender.sendMessage(tl("pWeatherPlayers")); } for (User user : users) { if (user.getPlayerWeather() == null) { - sender.sendMessage(_("pWeatherNormal", user.getName())); + sender.sendMessage(tl("pWeatherNormal", user.getName())); } else { - sender.sendMessage(_("pWeatherCurrent", user.getName(), user.getPlayerWeather().toString().toLowerCase(Locale.ENGLISH))); + sender.sendMessage(tl("pWeatherCurrent", user.getName(), user.getPlayerWeather().toString().toLowerCase(Locale.ENGLISH))); } } } @@ -114,20 +114,20 @@ private void setUsersWeather(final CommandSource sender, final Collection user.resetPlayerWeather(); } - sender.sendMessage(_("pWeatherReset", msg)); + sender.sendMessage(tl("pWeatherReset", msg)); } else { if (!weatherAliases.containsKey(weatherType)) { - throw new NotEnoughArgumentsException(_("pWeatherInvalidAlias")); + throw new NotEnoughArgumentsException(tl("pWeatherInvalidAlias")); } for (User user : users) { user.setPlayerWeather(weatherAliases.get(weatherType)); } - sender.sendMessage(_("pWeatherSet", weatherType, msg.toString())); + sender.sendMessage(tl("pWeatherSet", weatherType, msg.toString())); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandr.java b/Essentials/src/com/earth2me/essentials/commands/Commandr.java index a9073a9eb7..b79d10f1ee 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandr.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandr.java @@ -2,7 +2,7 @@ import com.earth2me.essentials.CommandSource; import com.earth2me.essentials.Console; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.IReplyTo; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.FormatUtil; @@ -46,12 +46,12 @@ public void run(final Server server, final CommandSource sender, final String co if (target == null || (target.isPlayer() && !target.getPlayer().isOnline())) { - throw new Exception(_("foreverAlone")); + throw new Exception(tl("foreverAlone")); } final String targetName = target.isPlayer() ? target.getPlayer().getDisplayName() : Console.NAME; - sender.sendMessage(_("msgFormat", _("me"), targetName, message)); + sender.sendMessage(tl("msgFormat", tl("me"), targetName, message)); if (target.isPlayer()) { User player = ess.getUser(target.getPlayer()); @@ -60,7 +60,7 @@ public void run(final Server server, final CommandSource sender, final String co return; } } - target.sendMessage(_("msgFormat", senderName, _("me"), message)); + target.sendMessage(tl("msgFormat", senderName, tl("me"), message)); replyTo.setReplyTo(target); if (target != sender) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java b/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java index 6a4f600cc3..7a83641fc3 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.FormatUtil; import java.util.Locale; @@ -38,7 +38,7 @@ protected void run(final Server server, final CommandSource sender, final String if (displayName.contains(whois)) { foundUser = true; - sender.sendMessage(u.getDisplayName() + " " + _("is") + " " + u.getName()); + sender.sendMessage(u.getDisplayName() + " " + tl("is") + " " + u.getName()); } } if (!foundUser) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandrecipe.java b/Essentials/src/com/earth2me/essentials/commands/Commandrecipe.java index 565067a5e6..01289a0e96 100755 --- a/Essentials/src/com/earth2me/essentials/commands/Commandrecipe.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandrecipe.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.NumberUtil; import java.util.HashMap; @@ -39,23 +39,23 @@ public void run(final Server server, final CommandSource sender, final String co } else { - throw new Exception(_("invalidNumber")); + throw new Exception(tl("invalidNumber")); } } final List recipesOfType = ess.getServer().getRecipesFor(itemType); if (recipesOfType.size() < 1) { - throw new Exception(_("recipeNone", getMaterialName(itemType))); + throw new Exception(tl("recipeNone", getMaterialName(itemType))); } if (recipeNo < 0 || recipeNo >= recipesOfType.size()) { - throw new Exception(_("recipeBadIndex")); + throw new Exception(tl("recipeBadIndex")); } final Recipe selectedRecipe = recipesOfType.get(recipeNo); - sender.sendMessage(_("recipe", getMaterialName(itemType), recipeNo + 1, recipesOfType.size())); + sender.sendMessage(tl("recipe", getMaterialName(itemType), recipeNo + 1, recipesOfType.size())); if (selectedRecipe instanceof FurnaceRecipe) { @@ -72,13 +72,13 @@ else if (selectedRecipe instanceof ShapelessRecipe) if (recipesOfType.size() > 1 && args.length == 1) { - sender.sendMessage(_("recipeMore", commandLabel, args[0], getMaterialName(itemType))); + sender.sendMessage(tl("recipeMore", commandLabel, args[0], getMaterialName(itemType))); } } public void furnaceRecipe(final CommandSource sender, final FurnaceRecipe recipe) { - sender.sendMessage(_("recipeFurnace", getMaterialName(recipe.getInput()))); + sender.sendMessage(tl("recipeFurnace", getMaterialName(recipe.getInput()))); } public void shapedRecipe(final CommandSource sender, final ShapedRecipe recipe) @@ -128,16 +128,16 @@ public void shapedRecipe(final CommandSource sender, final ShapedRecipe recipe) materials[j][k] = item == null ? null : item.getType(); } } - sender.sendMessage(_("recipeGrid", colorMap.get(materials[0][0]), colorMap.get(materials[0][1]), colorMap.get(materials[0][2]))); - sender.sendMessage(_("recipeGrid", colorMap.get(materials[1][0]), colorMap.get(materials[1][1]), colorMap.get(materials[1][2]))); - sender.sendMessage(_("recipeGrid", colorMap.get(materials[2][0]), colorMap.get(materials[2][1]), colorMap.get(materials[2][2]))); + sender.sendMessage(tl("recipeGrid", colorMap.get(materials[0][0]), colorMap.get(materials[0][1]), colorMap.get(materials[0][2]))); + sender.sendMessage(tl("recipeGrid", colorMap.get(materials[1][0]), colorMap.get(materials[1][1]), colorMap.get(materials[1][2]))); + sender.sendMessage(tl("recipeGrid", colorMap.get(materials[2][0]), colorMap.get(materials[2][1]), colorMap.get(materials[2][2]))); StringBuilder s = new StringBuilder(); for (Material items : colorMap.keySet().toArray(new Material[colorMap.size()])) { - s.append(_("recipeGridItem", colorMap.get(items), getMaterialName(items))); + s.append(tl("recipeGridItem", colorMap.get(items), getMaterialName(items))); } - sender.sendMessage(_("recipeWhere", s.toString())); + sender.sendMessage(tl("recipeWhere", s.toString())); } } @@ -167,7 +167,7 @@ public void shapelessRecipe(final CommandSource sender, final ShapelessRecipe re } s.append(" "); } - sender.sendMessage(_("recipeShapeless", s.toString())); + sender.sendMessage(tl("recipeShapeless", s.toString())); } } @@ -175,7 +175,7 @@ public String getMaterialName(final ItemStack stack) { if (stack == null) { - return _("recipeNothing"); + return tl("recipeNothing"); } return getMaterialName(stack.getType()); } @@ -184,7 +184,7 @@ public String getMaterialName(final Material type) { if (type == null) { - return _("recipeNothing"); + return tl("recipeNothing"); } return type.toString().replace("_", " ").toLowerCase(Locale.ENGLISH); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandremove.java b/Essentials/src/com/earth2me/essentials/commands/Commandremove.java index 9fa946260c..f8dcc54019 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandremove.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandremove.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.Mob; import com.earth2me.essentials.User; import java.util.ArrayList; @@ -69,7 +69,7 @@ private void parseCommand(Server server, CommandSource sender, String[] args, Wo if (world == null) { - throw new Exception(_("invalidWorld")); + throw new Exception(tl("invalidWorld")); } if (args[0].contentEquals("*") || args[0].contentEquals("all")) @@ -136,7 +136,7 @@ private void removeHandler(CommandSource sender, List types, List types, List 0 + sender.sendMessage(tl("whoisJail", (user.getJailTimeout() > 0 ? DateUtil.formatDateDiff(user.getJailTimeout()) - : _("true")))); + : tl("true")))); } if (user.isMuted()) { - sender.sendMessage(_("whoisMuted", (user.getMuteTimeout() > 0 + sender.sendMessage(tl("whoisMuted", (user.getMuteTimeout() > 0 ? DateUtil.formatDateDiff(user.getMuteTimeout()) - : _("true")))); + : tl("true")))); } final String location = user.getGeoLocation(); if (location != null && (!(sender.isPlayer()) || ess.getUser(sender.getPlayer()).isAuthorized("essentials.geoip.show"))) { - sender.sendMessage(_("whoisGeoLocation", location)); + sender.sendMessage(tl("whoisGeoLocation", location)); } if (extra) { - sender.sendMessage(_("whoisIPAddress", user.getAddress().getAddress().toString())); + sender.sendMessage(tl("whoisIPAddress", user.getAddress().getAddress().toString())); } } @@ -103,31 +103,31 @@ private void seenOffline(final Server server, final CommandSource sender, User u user.setDisplayNick(); if (user.getLastLogout() > 0) { - sender.sendMessage(_("seenOffline", user.getName(), DateUtil.formatDateDiff(user.getLastLogout()))); + sender.sendMessage(tl("seenOffline", user.getName(), DateUtil.formatDateDiff(user.getLastLogout()))); } else { - sender.sendMessage(_("userUnknown", user.getName())); + sender.sendMessage(tl("userUnknown", user.getName())); } if (user.isBanned()) { - sender.sendMessage(_("whoisBanned", showBan ? user.getBanReason() : _("true"))); + sender.sendMessage(tl("whoisBanned", showBan ? user.getBanReason() : tl("true"))); } final String location = user.getGeoLocation(); if (location != null && (!(sender.isPlayer()) || ess.getUser(sender.getPlayer()).isAuthorized("essentials.geoip.show"))) { - sender.sendMessage(_("whoisGeoLocation", location)); + sender.sendMessage(tl("whoisGeoLocation", location)); } if (extra) { if (!user.getLastLoginAddress().isEmpty()) { - sender.sendMessage(_("whoisIPAddress", user.getLastLoginAddress())); + sender.sendMessage(tl("whoisIPAddress", user.getLastLoginAddress())); } final Location loc = user.getLogoutLocation(); if (loc != null) { - sender.sendMessage(_("whoisLocation", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); + sender.sendMessage(tl("whoisLocation", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); } } } @@ -138,10 +138,10 @@ private void seenIP(final Server server, final CommandSource sender, final Strin if (server.getIPBans().contains(ipAddress)) { - sender.sendMessage(_("isIpBanned", ipAddress)); + sender.sendMessage(tl("isIpBanned", ipAddress)); } - sender.sendMessage(_("runningPlayerMatch", ipAddress)); + sender.sendMessage(tl("runningPlayerMatch", ipAddress)); ess.runTaskAsynchronously(new Runnable() { @@ -167,12 +167,12 @@ public void run() if (matches.size() > 0) { - sender.sendMessage(_("matchingIPAddress")); + sender.sendMessage(tl("matchingIPAddress")); sender.sendMessage(StringUtil.joinList(matches)); } else { - sender.sendMessage(_("noMatchingPlayers")); + sender.sendMessage(tl("noMatchingPlayers")); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java index 61c05ce072..c5722df26c 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsell.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsell.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.NumberUtil; @@ -63,11 +63,11 @@ public void run(final Server server, final User user, final String commandLabel, { if (args[0].equalsIgnoreCase("blocks")) { - user.sendMessage(_("totalWorthBlocks", type, NumberUtil.displayCurrency(totalWorth, ess))); + user.sendMessage(tl("totalWorthBlocks", type, NumberUtil.displayCurrency(totalWorth, ess))); } else { - user.sendMessage(_("totalWorthAll", type, NumberUtil.displayCurrency(totalWorth, ess))); + user.sendMessage(tl("totalWorthAll", type, NumberUtil.displayCurrency(totalWorth, ess))); } } } @@ -79,13 +79,13 @@ private BigDecimal sellItem(User user, ItemStack is, String[] args, boolean isBu if (worth == null) { - throw new Exception(_("itemCannotBeSold")); + throw new Exception(tl("itemCannotBeSold")); } if (amount <= 0) { if (!isBulkSell) { - user.sendMessage(_("itemSold", NumberUtil.displayCurrency(BigDecimal.ZERO, ess), BigDecimal.ZERO, is.getType().toString().toLowerCase(Locale.ENGLISH), NumberUtil.displayCurrency(worth, ess))); + user.sendMessage(tl("itemSold", NumberUtil.displayCurrency(BigDecimal.ZERO, ess), BigDecimal.ZERO, is.getType().toString().toLowerCase(Locale.ENGLISH), NumberUtil.displayCurrency(worth, ess))); } return BigDecimal.ZERO; } @@ -104,8 +104,8 @@ private BigDecimal sellItem(User user, ItemStack is, String[] args, boolean isBu user.updateInventory(); Trade.log("Command", "Sell", "Item", user.getName(), new Trade(ris, ess), user.getName(), new Trade(result, ess), user.getLocation(), ess); user.giveMoney(result); - user.sendMessage(_("itemSold", NumberUtil.displayCurrency(result, ess), amount, is.getType().toString().toLowerCase(Locale.ENGLISH), NumberUtil.displayCurrency(worth, ess))); - logger.log(Level.INFO, _("itemSoldConsole", user.getDisplayName(), is.getType().toString().toLowerCase(Locale.ENGLISH), NumberUtil.displayCurrency(result, ess), amount, NumberUtil.displayCurrency(worth, ess))); + user.sendMessage(tl("itemSold", NumberUtil.displayCurrency(result, ess), amount, is.getType().toString().toLowerCase(Locale.ENGLISH), NumberUtil.displayCurrency(worth, ess))); + logger.log(Level.INFO, tl("itemSoldConsole", user.getDisplayName(), is.getType().toString().toLowerCase(Locale.ENGLISH), NumberUtil.displayCurrency(result, ess), amount, NumberUtil.displayCurrency(worth, ess))); return result; } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java b/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java index 434816254f..15f10e7868 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.NumberUtil; import java.util.Locale; @@ -54,10 +54,10 @@ public void run(final Server server, final User user, final String commandLabel, } if ("bed".equals(name) || NumberUtil.isInt(name)) { - throw new NoSuchFieldException(_("invalidHomeName")); + throw new NoSuchFieldException(tl("invalidHomeName")); } usersHome.setHome(name, location); - user.sendMessage(_("homeSet", user.getLocation().getWorld().getName(), user.getLocation().getBlockX(), user.getLocation().getBlockY(), user.getLocation().getBlockZ(), name)); + user.sendMessage(tl("homeSet", user.getLocation().getWorld().getName(), user.getLocation().getBlockX(), user.getLocation().getBlockY(), user.getLocation().getBlockZ(), name)); } @@ -72,7 +72,7 @@ private boolean checkHomeLimit(final User user, final User usersHome, String nam } if (usersHome.getHomes().size() >= limit) { - throw new Exception(_("maxHomes", ess.getSettings().getHomeLimit(user))); + throw new Exception(tl("maxHomes", ess.getSettings().getHomeLimit(user))); } if (limit == 1) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsetjail.java b/Essentials/src/com/earth2me/essentials/commands/Commandsetjail.java index 7d590b3523..9cf89bfaf6 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsetjail.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsetjail.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.StringUtil; import org.bukkit.Server; @@ -21,7 +21,7 @@ public void run(final Server server, final User user, final String commandLabel, throw new NotEnoughArgumentsException(); } ess.getJails().setJail(args[0], user.getLocation()); - user.sendMessage(_("jailSet", StringUtil.sanitizeString(args[0]))); + user.sendMessage(tl("jailSet", StringUtil.sanitizeString(args[0]))); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java b/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java index a1c825ff9c..b0fa51caf6 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import com.earth2me.essentials.api.IWarps; import com.earth2me.essentials.utils.NumberUtil; @@ -27,7 +27,7 @@ public void run(final Server server, final User user, final String commandLabel, if (NumberUtil.isInt(args[0]) || args[0].isEmpty()) { - throw new NoSuchFieldException(_("invalidWarpName")); + throw new NoSuchFieldException(tl("invalidWarpName")); } final Location loc = user.getLocation(); @@ -51,8 +51,8 @@ public void run(final Server server, final User user, final String commandLabel, } else { - throw new Exception(_("warpOverwrite")); + throw new Exception(tl("warpOverwrite")); } - user.sendMessage(_("warpSet", args[0])); + user.sendMessage(tl("warpSet", args[0])); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java b/Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java index ecc11cd523..07938ef72f 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import org.bukkit.Server; import org.bukkit.inventory.ItemStack; @@ -37,7 +37,7 @@ public void run(final Server server, final User user, final String commandLabel, } ess.getWorth().setPrice(stack, Double.parseDouble(price)); - user.sendMessage(_("worthSet")); + user.sendMessage(tl("worthSet")); } @Override @@ -50,6 +50,6 @@ public void run(final Server server, final CommandSource sender, final String co ItemStack stack = ess.getItemDb().get(args[0]); ess.getWorth().setPrice(stack, Double.parseDouble(args[1])); - sender.sendMessage(_("worthSet")); + sender.sendMessage(tl("worthSet")); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandskull.java b/Essentials/src/com/earth2me/essentials/commands/Commandskull.java index 77d69f74d6..4f00e991ff 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandskull.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandskull.java @@ -1,15 +1,10 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import com.earth2me.essentials.craftbukkit.InventoryWorkaround; -import com.earth2me.essentials.utils.LocationUtil; - -import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Server; -import org.bukkit.block.BlockState; -import org.bukkit.block.Skull; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.SkullMeta; @@ -27,7 +22,7 @@ protected void run(final Server server, final User user, final String commandLab if (args.length > 0 && user.isAuthorized("essentials.skull.others")) { if (!args[0].matches("^[A-Za-z0-9_]+$")) { - throw new IllegalArgumentException(_("alphaNames")); + throw new IllegalArgumentException(tl("alphaNames")); } owner = args[0]; } @@ -49,12 +44,12 @@ else if (user.isAuthorized("essentials.skull.spawn")) spawn = true; } else { - throw new Exception(_("invalidSkull")); + throw new Exception(tl("invalidSkull")); } if (metaSkull.hasOwner() && !user.isAuthorized("essentials.skull.modify")) { - throw new Exception(_("noPermissionSkull")); + throw new Exception(tl("noPermissionSkull")); } metaSkull.setDisplayName("§fSkull of " + owner); @@ -64,10 +59,10 @@ else if (user.isAuthorized("essentials.skull.spawn")) if (spawn) { InventoryWorkaround.addItems(user.getBase().getInventory(), itemSkull); - user.sendMessage(_("givenSkull", owner)); + user.sendMessage(tl("givenSkull", owner)); } else { - user.sendMessage(_("skullChanged", owner)); + user.sendMessage(tl("skullChanged", owner)); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsocialspy.java b/Essentials/src/com/earth2me/essentials/commands/Commandsocialspy.java index 63d3764be0..8b23396374 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsocialspy.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsocialspy.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import org.bukkit.Server; @@ -55,10 +55,10 @@ void togglePlayer(CommandSource sender, User user, Boolean enabled) throws NotEn user.setSocialSpyEnabled(enabled); - user.sendMessage(_("socialSpy", user.getDisplayName(), enabled ? _("enabled") : _("disabled"))); + user.sendMessage(tl("socialSpy", user.getDisplayName(), enabled ? tl("enabled") : tl("disabled"))); if (!sender.isPlayer() || !sender.getPlayer().equals(user.getBase())) { - sender.sendMessage(_("socialSpy", user.getDisplayName(), enabled ? _("enabled") : _("disabled"))); + sender.sendMessage(tl("socialSpy", user.getDisplayName(), enabled ? tl("enabled") : tl("disabled"))); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java index 38e84870ae..96c871c4cf 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.Mob; import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; @@ -26,13 +26,13 @@ protected void run(final Server server, final User user, final String commandLab { if (args.length < 1 || args[0].length() < 2) { - throw new NotEnoughArgumentsException(_("mobsAvailable", StringUtil.joinList(Mob.getMobList()))); + throw new NotEnoughArgumentsException(tl("mobsAvailable", StringUtil.joinList(Mob.getMobList()))); } final Location target = LocationUtil.getTarget(user.getBase()); if (target == null || target.getBlock().getType() != Material.MOB_SPAWNER) { - throw new Exception(_("mobSpawnTarget")); + throw new Exception(tl("mobSpawnTarget")); } String name = args[0]; @@ -42,15 +42,15 @@ protected void run(final Server server, final User user, final String commandLab mob = Mob.fromName(name); if (mob == null) { - throw new Exception(_("invalidMob")); + throw new Exception(tl("invalidMob")); } if (ess.getSettings().getProtectPreventSpawn(mob.getType().toString().toLowerCase(Locale.ENGLISH))) { - throw new Exception(_("disabledToSpawnMob")); + throw new Exception(tl("disabledToSpawnMob")); } if (!user.isAuthorized("essentials.spawner." + mob.name.toLowerCase(Locale.ENGLISH))) { - throw new Exception(_("noPermToSpawnMob")); + throw new Exception(tl("noPermToSpawnMob")); } if (args.length > 1) { @@ -70,10 +70,10 @@ protected void run(final Server server, final User user, final String commandLab } catch (Throwable ex) { - throw new Exception(_("mobSpawnError"), ex); + throw new Exception(tl("mobSpawnError"), ex); } charge.charge(user); - user.sendMessage(_("setSpawner", mob.name)); + user.sendMessage(tl("setSpawner", mob.name)); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java index 4c37e35bb2..2626d9dad4 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.Mob; import com.earth2me.essentials.SpawnMob; import com.earth2me.essentials.User; @@ -23,7 +23,7 @@ public void run(final Server server, final User user, final String commandLabel, if (args.length < 1) { final String mobList = SpawnMob.mobList(user); - throw new NotEnoughArgumentsException(_("mobsAvailable", mobList)); + throw new NotEnoughArgumentsException(tl("mobsAvailable", mobList)); } List mobParts = SpawnMob.mobParts(args[0]); @@ -37,7 +37,7 @@ public void run(final Server server, final User user, final String commandLabel, if (mobParts.size() > 1 && !user.isAuthorized("essentials.spawnmob.stack")) { - throw new Exception(_("cannotStackMob")); + throw new Exception(tl("cannotStackMob")); } if (args.length >= 3) @@ -56,7 +56,7 @@ public void run(final Server server, final CommandSource sender, final String co if (args.length < 3) { final String mobList = StringUtil.joinList(Mob.getMobList()); - throw new NotEnoughArgumentsException(_("mobsAvailable", mobList)); + throw new NotEnoughArgumentsException(tl("mobsAvailable", mobList)); } List mobParts = SpawnMob.mobParts(args[0]); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspeed.java b/Essentials/src/com/earth2me/essentials/commands/Commandspeed.java index ce361e786f..9dca9dead6 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspeed.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspeed.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import java.util.List; import org.bukkit.Server; @@ -61,12 +61,12 @@ protected void run(final Server server, final User user, final String commandLab if (isFly) { user.setFlySpeed(getRealMoveSpeed(speed, isFly, isBypass)); - user.sendMessage(_("moveSpeed", _("flying"), speed, user.getDisplayName())); + user.sendMessage(tl("moveSpeed", tl("flying"), speed, user.getDisplayName())); } else { user.setWalkSpeed(getRealMoveSpeed(speed, isFly, isBypass)); - user.sendMessage(_("moveSpeed", _("walking"), speed, user.getDisplayName())); + user.sendMessage(tl("moveSpeed", tl("walking"), speed, user.getDisplayName())); } } @@ -86,12 +86,12 @@ private void speedOtherPlayers(final Server server, final CommandSource sender, if (isFly) { matchPlayer.setFlySpeed(getRealMoveSpeed(speed, isFly, isBypass)); - sender.sendMessage(_("moveSpeed", _("flying"), speed, matchPlayer.getDisplayName())); + sender.sendMessage(tl("moveSpeed", tl("flying"), speed, matchPlayer.getDisplayName())); } else { matchPlayer.setWalkSpeed(getRealMoveSpeed(speed, isFly, isBypass)); - sender.sendMessage(_("moveSpeed", _("walking"), speed, matchPlayer.getDisplayName())); + sender.sendMessage(tl("moveSpeed", tl("walking"), speed, matchPlayer.getDisplayName())); } } if (!foundUser) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java b/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java index a5a8f7aabb..2c2567be21 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import java.util.Locale; import java.util.logging.Level; @@ -31,7 +31,7 @@ public void run(final Server server, final CommandSource sender, final String co { if (user.isAuthorized("essentials.sudo.exempt") && sender.isPlayer()) { - throw new Exception(_("sudoExempt")); + throw new Exception(tl("sudoExempt")); } user.chat(getFinalArg(args, 1).substring(2)); return; @@ -45,10 +45,10 @@ public void run(final Server server, final CommandSource sender, final String co if (user.isAuthorized("essentials.sudo.exempt") && sender.isPlayer()) { - throw new Exception(_("sudoExempt")); + throw new Exception(tl("sudoExempt")); } - sender.sendMessage(_("sudoRun", user.getDisplayName(), command, getFinalArg(arguments, 0))); + sender.sendMessage(tl("sudoRun", user.getDisplayName(), command, getFinalArg(arguments, 0))); final PluginCommand execCommand = ess.getServer().getPluginCommand(command); if (execCommand != null) @@ -65,7 +65,7 @@ public void run() }); } else { - sender.sendMessage(_("errorCallingCommand", command)); + sender.sendMessage(tl("errorCallingCommand", command)); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsuicide.java b/Essentials/src/com/earth2me/essentials/commands/Commandsuicide.java index 6cae113d9a..69c1137c9e 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsuicide.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsuicide.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import org.bukkit.Server; import org.bukkit.event.entity.EntityDamageEvent; @@ -23,8 +23,8 @@ public void run(final Server server, final User user, final String commandLabel, { user.setHealth(0); } - user.sendMessage(_("suicideMessage")); + user.sendMessage(tl("suicideMessage")); user.setDisplayNick(); - ess.broadcastMessage(user, _("suicideSuccess", user.getDisplayName())); + ess.broadcastMessage(user, tl("suicideSuccess", user.getDisplayName())); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java b/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java index 0728f1a226..84806ad0b9 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java @@ -2,7 +2,7 @@ import com.earth2me.essentials.CommandSource; import com.earth2me.essentials.Console; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.DateUtil; import java.util.GregorianCalendar; @@ -29,7 +29,7 @@ public void run(final Server server, final CommandSource sender, final String co if (sender.isPlayer() && !ess.getUser(sender.getPlayer()).isAuthorized("essentials.tempban.offline")) { - sender.sendMessage(_("tempbanExemptOffline")); + sender.sendMessage(tl("tempbanExemptOffline")); return; } } @@ -37,7 +37,7 @@ public void run(final Server server, final CommandSource sender, final String co { if (user.isAuthorized("essentials.tempban.exempt") && sender.isPlayer()) { - sender.sendMessage(_("tempbanExempt")); + sender.sendMessage(tl("tempbanExempt")); return; } } @@ -48,17 +48,17 @@ public void run(final Server server, final CommandSource sender, final String co if (maxBanLength > 0 && ((banTimestamp - GregorianCalendar.getInstance().getTimeInMillis()) > maxBanLength) && sender.isPlayer() && !(ess.getUser(sender.getPlayer()).isAuthorized("essentials.tempban.unlimited"))) { - sender.sendMessage(_("oversizedTempban")); + sender.sendMessage(tl("oversizedTempban")); throw new NoChargeException(); } final String senderName = sender.isPlayer() ? sender.getPlayer().getDisplayName() : Console.NAME; - final String banReason = _("tempBanned", DateUtil.formatDateDiff(banTimestamp), senderName); + final String banReason = tl("tempBanned", DateUtil.formatDateDiff(banTimestamp), senderName); user.setBanReason(banReason); user.setBanTimeout(banTimestamp); user.setBanned(true); user.kickPlayer(banReason); - ess.broadcastMessage("essentials.ban.notify", _("playerBanned", senderName, user.getName(), banReason, DateUtil.formatDateDiff(banTimestamp))); + ess.broadcastMessage("essentials.ban.notify", tl("playerBanned", senderName, user.getName(), banReason, DateUtil.formatDateDiff(banTimestamp))); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandthunder.java b/Essentials/src/com/earth2me/essentials/commands/Commandthunder.java index 3cb60e6e3c..25deb69c04 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandthunder.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandthunder.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import org.bukkit.Server; import org.bukkit.World; @@ -28,13 +28,13 @@ public void run(final Server server, final User user, final String commandLabel, world.setThundering(setThunder ? true : false); world.setThunderDuration(Integer.parseInt(args[1]) * 20); - user.sendMessage(_("thunderDuration", (setThunder ? _("enabled") : _("disabled")), Integer.parseInt(args[1]))); + user.sendMessage(tl("thunderDuration", (setThunder ? tl("enabled") : tl("disabled")), Integer.parseInt(args[1]))); } else { world.setThundering(setThunder ? true : false); - user.sendMessage(_("thunder", setThunder ? _("enabled") : _("disabled"))); + user.sendMessage(tl("thunder", setThunder ? tl("enabled") : tl("disabled"))); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtime.java b/Essentials/src/com/earth2me/essentials/commands/Commandtime.java index e29be16f55..4768a3089c 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtime.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtime.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.DescParseTickFormat; import com.earth2me.essentials.utils.NumberUtil; @@ -67,7 +67,7 @@ else if (commandLabel.equalsIgnoreCase("night") || commandLabel.equalsIgnoreCase final User user = ess.getUser(sender.getPlayer()); if (user != null && !user.isAuthorized("essentials.time.set")) { - user.sendMessage(_("timeSetPermission")); + user.sendMessage(tl("timeSetPermission")); return; } @@ -99,7 +99,7 @@ private void getWorldsTime(final CommandSource sender, final Collection w for (World world : worlds) { - sender.sendMessage(_("timeWorldCurrent", world.getName(), DescParseTickFormat.format(world.getTime()))); + sender.sendMessage(tl("timeWorldCurrent", world.getName(), DescParseTickFormat.format(world.getTime()))); } } @@ -130,7 +130,7 @@ private void setWorldsTime(final CommandSource sender, final Collection w output.append(world.getName()); } - sender.sendMessage(_("timeWorldSet", DescParseTickFormat.format(ticks), output.toString())); + sender.sendMessage(tl("timeWorldSet", DescParseTickFormat.format(ticks), output.toString())); } /** @@ -170,7 +170,7 @@ else if (selector.equalsIgnoreCase("*") || selector.equalsIgnoreCase("all")) // We failed to understand the world target... else { - throw new Exception(_("invalidWorld")); + throw new Exception(tl("invalidWorld")); } return worlds; diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java b/Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java index 4a223387c6..927462f212 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.DateUtil; import org.bukkit.Server; @@ -31,7 +31,7 @@ public void run(final Server server, final CommandSource sender, final String co if (sender.isPlayer() && !ess.getUser(sender.getPlayer()).isAuthorized("essentials.togglejail.offline")) { - sender.sendMessage(_("mayNotJailOffline")); + sender.sendMessage(tl("mayNotJailOffline")); return; } } @@ -39,7 +39,7 @@ public void run(final Server server, final CommandSource sender, final String co { if (player.isAuthorized("essentials.jail.exempt")) { - sender.sendMessage(_("mayNotJail")); + sender.sendMessage(tl("mayNotJail")); return; } } @@ -53,7 +53,7 @@ public void run(final Server server, final CommandSource sender, final String co ess.getJails().getJail(args[1]); } player.setJailed(true); - player.sendMessage(_("userJailed")); + player.sendMessage(tl("userJailed")); player.setJail(null); player.setJail(args[1]); long timeDiff = 0; @@ -64,14 +64,14 @@ public void run(final Server server, final CommandSource sender, final String co player.setJailTimeout(timeDiff); } sender.sendMessage((timeDiff > 0 - ? _("playerJailedFor", player.getName(), DateUtil.formatDateDiff(timeDiff)) - : _("playerJailed", player.getName()))); + ? tl("playerJailedFor", player.getName(), DateUtil.formatDateDiff(timeDiff)) + : tl("playerJailed", player.getName()))); return; } if (args.length >= 2 && player.isJailed() && !args[1].equalsIgnoreCase(player.getJail())) { - sender.sendMessage(_("jailAlreadyIncarcerated", player.getJail())); + sender.sendMessage(tl("jailAlreadyIncarcerated", player.getJail())); return; } @@ -80,7 +80,7 @@ public void run(final Server server, final CommandSource sender, final String co final String time = getFinalArg(args, 2); final long timeDiff = DateUtil.parseDateDiff(time, true); player.setJailTimeout(timeDiff); - sender.sendMessage(_("jailSentenceExtended", DateUtil.formatDateDiff(timeDiff))); + sender.sendMessage(tl("jailSentenceExtended", DateUtil.formatDateDiff(timeDiff))); return; } @@ -92,13 +92,13 @@ public void run(final Server server, final CommandSource sender, final String co } player.setJailed(false); player.setJailTimeout(0); - player.sendMessage(_("jailReleasedPlayerNotify")); + player.sendMessage(tl("jailReleasedPlayerNotify")); player.setJail(null); if (player.isOnline()) { player.getTeleport().back(); } - sender.sendMessage(_("jailReleased", player.getName())); + sender.sendMessage(tl("jailReleased", player.getName())); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtop.java b/Essentials/src/com/earth2me/essentials/commands/Commandtop.java index b088c31e68..d41646f2d5 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtop.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtop.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.LocationUtil; @@ -25,7 +25,7 @@ public void run(final Server server, final User user, final String commandLabel, final float yaw = user.getLocation().getYaw(); final Location loc = LocationUtil.getSafeDestination(new Location(user.getWorld(), topX, user.getWorld().getMaxHeight(), topZ, yaw, pitch)); user.getTeleport().teleport(loc, new Trade(this.getName(), ess), TeleportCause.COMMAND); - user.sendMessage(_("teleportTop", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); + user.sendMessage(tl("teleportTop", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java index 99fc3da8a6..4fc135c849 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java @@ -2,7 +2,7 @@ import com.earth2me.essentials.CommandSource; import com.earth2me.essentials.Console; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; import org.bukkit.Location; @@ -29,12 +29,12 @@ public void run(final Server server, final User user, final String commandLabel, final User player = getPlayer(server, user, args, 0); if (!player.isTeleportEnabled()) { - throw new Exception(_("teleportDisabled", player.getDisplayName())); + throw new Exception(tl("teleportDisabled", player.getDisplayName())); } if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() && !user.isAuthorized("essentials.worlds." + player.getWorld().getName())) { - throw new Exception(_("noPerm", "essentials.worlds." + player.getWorld().getName())); + throw new Exception(tl("noPerm", "essentials.worlds." + player.getWorld().getName())); } final Trade charge = new Trade(this.getName(), ess); charge.isAffordableFor(user); @@ -43,7 +43,7 @@ public void run(final Server server, final User user, final String commandLabel, case 4: if (!user.isAuthorized("essentials.tp.others")) { - throw new Exception(_("noPerm", "essentials.tp.others")); + throw new Exception(tl("noPerm", "essentials.tp.others")); } final User target2 = getPlayer(server, user, args, 0); final double x = args[1].startsWith("~") ? target2.getLocation().getX() + Integer.parseInt(args[1].substring(1)) : Integer.parseInt(args[1]); @@ -51,40 +51,40 @@ public void run(final Server server, final User user, final String commandLabel, final double z = args[3].startsWith("~") ? target2.getLocation().getZ() + Integer.parseInt(args[3].substring(1)) : Integer.parseInt(args[3]); if (x > 30000000 || y > 30000000 || z > 30000000 || x < -30000000 || y < -30000000 || z < -30000000) { - throw new NotEnoughArgumentsException(_("teleportInvalidLocation")); + throw new NotEnoughArgumentsException(tl("teleportInvalidLocation")); } final Location loc = new Location(target2.getWorld(), x, y, z, target2.getLocation().getYaw(), target2.getLocation().getPitch()); if (!target2.isTeleportEnabled()) { - throw new Exception(_("teleportDisabled", target2.getDisplayName())); + throw new Exception(tl("teleportDisabled", target2.getDisplayName())); } target2.getTeleport().now(loc, false, TeleportCause.COMMAND); - user.sendMessage(_("teleporting", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); - target2.sendMessage(_("teleporting", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); + user.sendMessage(tl("teleporting", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); + target2.sendMessage(tl("teleporting", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); break; case 2: default: if (!user.isAuthorized("essentials.tp.others")) { - throw new Exception(_("noPerm", "essentials.tp.others")); + throw new Exception(tl("noPerm", "essentials.tp.others")); } final User target = getPlayer(server, user, args, 0); final User toPlayer = getPlayer(server, user, args, 1); if (!target.isTeleportEnabled()) { - throw new Exception(_("teleportDisabled", target.getDisplayName())); + throw new Exception(tl("teleportDisabled", target.getDisplayName())); } if (!toPlayer.isTeleportEnabled()) { - throw new Exception(_("teleportDisabled", toPlayer.getDisplayName())); + throw new Exception(tl("teleportDisabled", toPlayer.getDisplayName())); } if (target.getWorld() != toPlayer.getWorld() && ess.getSettings().isWorldTeleportPermissions() && !user.isAuthorized("essentials.worlds." + toPlayer.getWorld().getName())) { - throw new Exception(_("noPerm", "essentials.worlds." + toPlayer.getWorld().getName())); + throw new Exception(tl("noPerm", "essentials.worlds." + toPlayer.getWorld().getName())); } target.getTeleport().now(toPlayer.getBase(), false, TeleportCause.COMMAND); - target.sendMessage(_("teleportAtoB", user.getDisplayName(), toPlayer.getDisplayName())); + target.sendMessage(tl("teleportAtoB", user.getDisplayName(), toPlayer.getDisplayName())); break; } } @@ -102,7 +102,7 @@ public void run(final Server server, final CommandSource sender, final String co { final User toPlayer = getPlayer(server, args, 1, true, false); target.getTeleport().now(toPlayer.getBase(), false, TeleportCause.COMMAND); - target.sendMessage(_("teleportAtoB", Console.NAME, toPlayer.getDisplayName())); + target.sendMessage(tl("teleportAtoB", Console.NAME, toPlayer.getDisplayName())); } else if (args.length > 3) { @@ -111,12 +111,12 @@ else if (args.length > 3) final double z = args[3].startsWith("~") ? target.getLocation().getZ() + Integer.parseInt(args[3].substring(1)) : Integer.parseInt(args[3]); if (x > 30000000 || y > 30000000 || z > 30000000 || x < -30000000 || y < -30000000 || z < -30000000) { - throw new NotEnoughArgumentsException(_("teleportInvalidLocation")); + throw new NotEnoughArgumentsException(tl("teleportInvalidLocation")); } final Location loc = new Location(target.getWorld(), x, y, z, target.getLocation().getYaw(), target.getLocation().getPitch()); target.getTeleport().now(loc, false, TeleportCause.COMMAND); - target.sendMessage(_("teleporting", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); - sender.sendMessage(_("teleporting", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); + target.sendMessage(tl("teleporting", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); + sender.sendMessage(tl("teleporting", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); } else { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java index 4ee8b21c50..94dd672bbb 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import org.bukkit.Server; @@ -27,24 +27,24 @@ public void run(Server server, User user, String commandLabel, String[] args) th } if (!player.isTeleportEnabled()) { - throw new Exception(_("teleportDisabled", player.getDisplayName())); + throw new Exception(tl("teleportDisabled", player.getDisplayName())); } if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() && !user.isAuthorized("essentials.worlds." + player.getWorld().getName())) { - throw new Exception(_("noPerm", "essentials.worlds." + player.getWorld().getName())); + throw new Exception(tl("noPerm", "essentials.worlds." + player.getWorld().getName())); } if (!player.isIgnoredPlayer(user)) { player.requestTeleport(user, false); - player.sendMessage(_("teleportRequest", user.getDisplayName())); - player.sendMessage(_("typeTpaccept")); - player.sendMessage(_("typeTpdeny")); + player.sendMessage(tl("teleportRequest", user.getDisplayName())); + player.sendMessage(tl("typeTpaccept")); + player.sendMessage(tl("typeTpdeny")); if (ess.getSettings().getTpaAcceptCancellation() != 0) { - player.sendMessage(_("teleportRequestTimeoutInfo", ess.getSettings().getTpaAcceptCancellation())); + player.sendMessage(tl("teleportRequestTimeoutInfo", ess.getSettings().getTpaAcceptCancellation())); } } - user.sendMessage(_("requestSent", player.getDisplayName())); + user.sendMessage(tl("requestSent", player.getDisplayName())); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpaall.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpaall.java index 689fdcc576..572083540c 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpaall.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpaall.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import org.bukkit.Server; import org.bukkit.entity.Player; @@ -33,7 +33,7 @@ public void run(final Server server, final CommandSource sender, final String co private void teleportAAllPlayers(final Server server, final CommandSource sender, final User target) { - sender.sendMessage(_("teleportAAll")); + sender.sendMessage(tl("teleportAAll")); for (Player onlinePlayer : server.getOnlinePlayers()) { final User player = ess.getUser(onlinePlayer); @@ -54,11 +54,11 @@ private void teleportAAllPlayers(final Server server, final CommandSource sender try { player.requestTeleport(target, true); - player.sendMessage(_("teleportHereRequest", target.getDisplayName())); - player.sendMessage(_("typeTpaccept")); + player.sendMessage(tl("teleportHereRequest", target.getDisplayName())); + player.sendMessage(tl("typeTpaccept")); if (ess.getSettings().getTpaAcceptCancellation() != 0) { - player.sendMessage(_("teleportRequestTimeoutInfo", ess.getSettings().getTpaAcceptCancellation())); + player.sendMessage(tl("teleportRequestTimeoutInfo", ess.getSettings().getTpaAcceptCancellation())); } } catch (Exception ex) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java index 73d408ddde..4ae22a01ab 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; import org.bukkit.Location; @@ -25,43 +25,43 @@ public void run(final Server server, final User user, final String commandLabel, } catch (Exception ex) { - throw new Exception(_("noPendingRequest")); + throw new Exception(tl("noPendingRequest")); } if (!requester.isOnline()) { - throw new Exception(_("noPendingRequest")); + throw new Exception(tl("noPendingRequest")); } if (user.isTpRequestHere() && ((!requester.isAuthorized("essentials.tpahere") && !requester.isAuthorized("essentials.tpaall")) || (user.getWorld() != requester.getWorld() && ess.getSettings().isWorldTeleportPermissions() && !user.isAuthorized("essentials.worlds." + user.getWorld().getName())))) { - throw new Exception(_("noPendingRequest")); + throw new Exception(tl("noPendingRequest")); } if (!user.isTpRequestHere() && (!requester.isAuthorized("essentials.tpa") || (user.getWorld() != requester.getWorld() && ess.getSettings().isWorldTeleportPermissions() && !user.isAuthorized("essentials.worlds." + requester.getWorld().getName())))) { - throw new Exception(_("noPendingRequest")); + throw new Exception(tl("noPendingRequest")); } if (args.length > 0 && !requester.getName().contains(args[0])) { - throw new Exception(_("noPendingRequest")); + throw new Exception(tl("noPendingRequest")); } long timeout = ess.getSettings().getTpaAcceptCancellation(); if (timeout != 0 && (System.currentTimeMillis() - user.getTeleportRequestTime()) / 1000 > timeout) { user.requestTeleport(null, false); - throw new Exception(_("requestTimedOut")); + throw new Exception(tl("requestTimedOut")); } final Trade charge = new Trade(this.getName(), ess); - user.sendMessage(_("requestAccepted")); - requester.sendMessage(_("requestAcceptedFrom", user.getDisplayName())); + user.sendMessage(tl("requestAccepted")); + requester.sendMessage(tl("requestAcceptedFrom", user.getDisplayName())); try { @@ -69,7 +69,7 @@ public void run(final Server server, final User user, final String commandLabel, { final Location loc = user.getTpRequestLocation(); requester.getTeleport().teleportPlayer(user, user.getTpRequestLocation(), charge, TeleportCause.COMMAND); - requester.sendMessage(_("teleporting", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); + requester.sendMessage(tl("teleporting", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); } else { @@ -78,7 +78,7 @@ public void run(final Server server, final User user, final String commandLabel, } catch (Exception ex) { - user.sendMessage(_("pendingTeleportCancelled")); + user.sendMessage(tl("pendingTeleportCancelled")); ess.showError(requester.getSource(), ex, commandLabel); } user.requestTeleport(null, false); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java index 7bfdb72787..d0d3e47fde 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import org.bukkit.Server; @@ -27,24 +27,24 @@ public void run(final Server server, final User user, final String commandLabel, } if (!player.isTeleportEnabled()) { - throw new Exception(_("teleportDisabled", player.getDisplayName())); + throw new Exception(tl("teleportDisabled", player.getDisplayName())); } if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() && !user.isAuthorized("essentials.worlds." + user.getWorld().getName())) { - throw new Exception(_("noPerm", "essentials.worlds." + user.getWorld().getName())); + throw new Exception(tl("noPerm", "essentials.worlds." + user.getWorld().getName())); } if (!player.isIgnoredPlayer(user)) { player.requestTeleport(user, true); - player.sendMessage(_("teleportHereRequest", user.getDisplayName())); - player.sendMessage(_("typeTpaccept")); - player.sendMessage(_("typeTpdeny")); + player.sendMessage(tl("teleportHereRequest", user.getDisplayName())); + player.sendMessage(tl("typeTpaccept")); + player.sendMessage(tl("typeTpdeny")); if (ess.getSettings().getTpaAcceptCancellation() != 0) { - player.sendMessage(_("teleportRequestTimeoutInfo", ess.getSettings().getTpaAcceptCancellation())); + player.sendMessage(tl("teleportRequestTimeoutInfo", ess.getSettings().getTpaAcceptCancellation())); } } - user.sendMessage(_("requestSent", player.getDisplayName())); + user.sendMessage(tl("requestSent", player.getDisplayName())); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java index 360f9ca2a7..503d29e98b 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import org.bukkit.Location; import org.bukkit.Server; @@ -35,7 +35,7 @@ public void run(final Server server, final CommandSource sender, final String co private void teleportAllPlayers(Server server, CommandSource sender, User target) { - sender.sendMessage(_("teleportAll")); + sender.sendMessage(tl("teleportAll")); final Location loc = target.getLocation(); for (Player onlinePlayer : server.getOnlinePlayers()) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpdeny.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpdeny.java index 2f2e6c41ce..c0dfde4468 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpdeny.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpdeny.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import org.bukkit.Server; @@ -18,11 +18,11 @@ public void run(final Server server, final User user, final String commandLabel, final User player = ess.getUser(user.getTeleportRequest()); if (player == null) { - throw new Exception(_("noPendingRequest")); + throw new Exception(tl("noPendingRequest")); } - user.sendMessage(_("requestDenied")); - player.sendMessage(_("requestDeniedFrom", user.getDisplayName())); + user.sendMessage(tl("requestDenied")); + player.sendMessage(tl("requestDeniedFrom", user.getDisplayName())); user.requestTeleport(null, false); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java b/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java index 5c47cffadb..ec792b2893 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; import org.bukkit.Server; @@ -20,12 +20,12 @@ public void run(final Server server, final User user, final String commandLabel, final User player = getPlayer(server, user, args, 0); if (!player.isTeleportEnabled()) { - throw new Exception(_("teleportDisabled", player.getDisplayName())); + throw new Exception(tl("teleportDisabled", player.getDisplayName())); } if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() && !user.isAuthorized("essentials.worlds." + user.getWorld().getName())) { - throw new Exception(_("noPerm", "essentials.worlds." + user.getWorld().getName())); + throw new Exception(tl("noPerm", "essentials.worlds." + user.getWorld().getName())); } user.getTeleport().teleportPlayer(player, user.getBase(), new Trade(this.getName(), ess), TeleportCause.COMMAND); throw new NoChargeException(); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java index cd80b45fdf..0befdfc3b9 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import org.bukkit.Server; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; @@ -26,7 +26,7 @@ public void run(final Server server, final User user, final String commandLabel, if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() && !user.isAuthorized("essentials.worlds." + player.getWorld().getName())) { - throw new Exception(_("noPerm", "essentials.worlds." + player.getWorld().getName())); + throw new Exception(tl("noPerm", "essentials.worlds." + player.getWorld().getName())); } user.getTeleport().now(player.getBase(), false, TeleportCause.COMMAND); break; @@ -34,7 +34,7 @@ public void run(final Server server, final User user, final String commandLabel, default: if (!user.isAuthorized("essentials.tp.others")) { - throw new Exception(_("noPerm", "essentials.tp.others")); + throw new Exception(tl("noPerm", "essentials.tp.others")); } final User target = getPlayer(server, user, args, 0); final User toPlayer = getPlayer(server, user, args, 1); @@ -42,11 +42,11 @@ public void run(final Server server, final User user, final String commandLabel, if (target.getWorld() != toPlayer.getWorld() && ess.getSettings().isWorldTeleportPermissions() && !user.isAuthorized("essentials.worlds." + toPlayer.getWorld().getName())) { - throw new Exception(_("noPerm", "essentials.worlds." + toPlayer.getWorld().getName())); + throw new Exception(tl("noPerm", "essentials.worlds." + toPlayer.getWorld().getName())); } target.getTeleport().now(toPlayer.getBase(), false, TeleportCause.COMMAND); - target.sendMessage(_("teleportAtoB", user.getDisplayName(), toPlayer.getDisplayName())); + target.sendMessage(tl("teleportAtoB", user.getDisplayName(), toPlayer.getDisplayName())); break; } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java index c23c435879..bb0d924ebb 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import org.bukkit.Server; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; @@ -27,7 +27,7 @@ public void run(final Server server, final User user, final String commandLabel, if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() && !user.isAuthorized("essentials.worlds." + user.getWorld().getName())) { - throw new Exception(_("noPerm", "essentials.worlds." + user.getWorld().getName())); + throw new Exception(tl("noPerm", "essentials.worlds." + user.getWorld().getName())); } // Verify permission diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java b/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java index a333523338..0d48acc59e 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; import org.bukkit.Location; @@ -38,11 +38,11 @@ public void run(final Server server, final User user, final String commandLabel, } if (x > 30000000 || y > 30000000 || z > 30000000 || x < -30000000 || y < -30000000 || z < -30000000) { - throw new NotEnoughArgumentsException(_("teleportInvalidLocation")); + throw new NotEnoughArgumentsException(tl("teleportInvalidLocation")); } final Trade charge = new Trade(this.getName(), ess); charge.isAffordableFor(user); - user.sendMessage(_("teleporting", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); + user.sendMessage(tl("teleporting", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); user.getTeleport().teleport(loc, charge, TeleportCause.COMMAND); throw new NoChargeException(); } @@ -70,10 +70,10 @@ public void run(final Server server, final CommandSource sender, final String co } if (x > 30000000 || y > 30000000 || z > 30000000 || x < -30000000 || y < -30000000 || z < -30000000) { - throw new NotEnoughArgumentsException(_("teleportInvalidLocation")); + throw new NotEnoughArgumentsException(tl("teleportInvalidLocation")); } - sender.sendMessage(_("teleporting", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); - user.sendMessage(_("teleporting", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); + sender.sendMessage(tl("teleporting", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); + user.sendMessage(tl("teleporting", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); user.getTeleport().teleport(loc, null, TeleportCause.COMMAND); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtptoggle.java b/Essentials/src/com/earth2me/essentials/commands/Commandtptoggle.java index 97052876ba..3bc02b02e1 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtptoggle.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtptoggle.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import org.bukkit.Server; @@ -54,10 +54,10 @@ void togglePlayer(CommandSource sender, User user, Boolean enabled) user.setTeleportEnabled(enabled); - user.sendMessage(enabled ? _("teleportationEnabled") : _("teleportationDisabled")); + user.sendMessage(enabled ? tl("teleportationEnabled") : tl("teleportationDisabled")); if (!sender.isPlayer() || !sender.getPlayer().equals(user.getBase())) { - sender.sendMessage(enabled ? _("teleportationEnabledFor", user.getDisplayName()) : _("teleportationDisabledFor", user.getDisplayName())); + sender.sendMessage(enabled ? tl("teleportationEnabledFor", user.getDisplayName()) : tl("teleportationDisabledFor", user.getDisplayName())); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtree.java b/Essentials/src/com/earth2me/essentials/commands/Commandtree.java index b58e05da84..6240cf4357 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtree.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtree.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.Essentials; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.LocationUtil; import org.bukkit.Location; @@ -82,11 +82,11 @@ else if (args[0].equalsIgnoreCase("darkoak")) final boolean success = user.getWorld().generateTree(safeLocation, tree); if (success) { - user.sendMessage(_("treeSpawned")); + user.sendMessage(tl("treeSpawned")); } else { - user.sendMessage(_("treeFailure")); + user.sendMessage(tl("treeFailure")); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandunban.java b/Essentials/src/com/earth2me/essentials/commands/Commandunban.java index eeb60985d9..b64c0f6c3f 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandunban.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandunban.java @@ -2,7 +2,7 @@ import com.earth2me.essentials.CommandSource; import com.earth2me.essentials.Console; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import java.util.logging.Level; import org.bukkit.OfflinePlayer; @@ -37,14 +37,14 @@ public void run(final Server server, final CommandSource sender, final String co name = player.getName(); if (!player.isBanned()) { - throw new Exception(_("playerNotFound"), e); + throw new Exception(tl("playerNotFound"), e); } player.setBanned(false); } final String senderName = sender.isPlayer() ? sender.getPlayer().getDisplayName() : Console.NAME; - server.getLogger().log(Level.INFO, _("playerUnbanned", senderName, name)); + server.getLogger().log(Level.INFO, tl("playerUnbanned", senderName, name)); - ess.broadcastMessage("essentials.ban.notify", _("playerUnbanned", senderName, name)); + ess.broadcastMessage("essentials.ban.notify", tl("playerUnbanned", senderName, name)); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java b/Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java index c3de1b48e5..1d79c94e0d 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java @@ -2,7 +2,7 @@ import com.earth2me.essentials.CommandSource; import com.earth2me.essentials.Console; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.FormatUtil; import java.util.logging.Level; @@ -49,8 +49,8 @@ public void run(final Server server, final CommandSource sender, final String co ess.getServer().unbanIP(ipAddress); final String senderName = sender.isPlayer() ? sender.getPlayer().getDisplayName() : Console.NAME; - server.getLogger().log(Level.INFO, _("playerUnbanIpAddress", senderName, ipAddress)); + server.getLogger().log(Level.INFO, tl("playerUnbanIpAddress", senderName, ipAddress)); - ess.broadcastMessage("essentials.ban.notify", _("playerUnbanIpAddress", senderName, ipAddress)); + ess.broadcastMessage("essentials.ban.notify", tl("playerUnbanIpAddress", senderName, ipAddress)); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandunlimited.java b/Essentials/src/com/earth2me/essentials/commands/Commandunlimited.java index c70490c3f8..df005421fa 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandunlimited.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandunlimited.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import java.util.List; import java.util.Locale; @@ -59,12 +59,12 @@ else if (args[0].equalsIgnoreCase("clear")) private String getList(final User target) { final StringBuilder output = new StringBuilder(); - output.append(_("unlimitedItems")).append(" "); + output.append(tl("unlimitedItems")).append(" "); boolean first = true; final List items = target.getUnlimited(); if (items.isEmpty()) { - output.append(_("none")); + output.append(tl("none")); } for (Integer integer : items) { @@ -93,7 +93,7 @@ private Boolean toggleUnlimited(final User user, final User target, final String && !((stack.getType() == Material.WATER_BUCKET || stack.getType() == Material.LAVA_BUCKET) && user.isAuthorized("essentials.unlimited.item-bucket")))) { - throw new Exception(_("unlimitedItemPermission", itemname)); + throw new Exception(tl("unlimitedItemPermission", itemname)); } String message = "disableUnlimited"; @@ -110,9 +110,9 @@ private Boolean toggleUnlimited(final User user, final User target, final String if (user != target) { - user.sendMessage(_(message, itemname, target.getDisplayName())); + user.sendMessage(tl(message, itemname, target.getDisplayName())); } - target.sendMessage(_(message, itemname, target.getDisplayName())); + target.sendMessage(tl(message, itemname, target.getDisplayName())); target.setUnlimited(stack, enableUnlimited); return true; diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandvanish.java b/Essentials/src/com/earth2me/essentials/commands/Commandvanish.java index 34aa82f648..fd2bd6d924 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandvanish.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandvanish.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import org.bukkit.Server; @@ -53,15 +53,15 @@ void togglePlayer(CommandSource sender, User user, Boolean enabled) throws NotEn } user.setVanished(enabled); - user.sendMessage(_("vanish", user.getDisplayName(), enabled ? _("enabled") : _("disabled"))); + user.sendMessage(tl("vanish", user.getDisplayName(), enabled ? tl("enabled") : tl("disabled"))); if (enabled == true) { - user.sendMessage(_("vanished")); + user.sendMessage(tl("vanished")); } if (!sender.isPlayer() || !sender.getPlayer().equals(user.getBase())) { - sender.sendMessage(_("vanish", user.getDisplayName(), enabled ? _("enabled") : _("disabled"))); + sender.sendMessage(tl("vanish", user.getDisplayName(), enabled ? tl("enabled") : tl("disabled"))); } } } \ No newline at end of file diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandwarp.java b/Essentials/src/com/earth2me/essentials/commands/Commandwarp.java index 3a574c6287..8c2e88a4a0 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandwarp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandwarp.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; import com.earth2me.essentials.api.IWarps; @@ -33,7 +33,7 @@ public void run(final Server server, final User user, final String commandLabel, { if (!user.isAuthorized("essentials.warp.list")) { - throw new Exception(_("warpListPermission")); + throw new Exception(tl("warpListPermission")); } warpList(user.getSource(), args, user); throw new NoChargeException(); @@ -87,7 +87,7 @@ private void warpList(final CommandSource sender, final String[] args, final IUs } if (warpNameList.isEmpty()) { - throw new Exception(_("noWarpsDefined")); + throw new Exception(tl("noWarpsDefined")); } int page = 1; if (args.length > 0 && NumberUtil.isInt(args[0])) @@ -107,12 +107,12 @@ private void warpList(final CommandSource sender, final String[] args, final IUs if (warpNameList.size() > WARPS_PER_PAGE) { - sender.sendMessage(_("warpsCount", warpNameList.size(), page, maxPages)); - sender.sendMessage(_("warpList", warpList)); + sender.sendMessage(tl("warpsCount", warpNameList.size(), page, maxPages)); + sender.sendMessage(tl("warpList", warpList)); } else { - sender.sendMessage(_("warps", warpList)); + sender.sendMessage(tl("warps", warpList)); } } @@ -125,7 +125,7 @@ private void warpUser(final User owner, final User user, final String name) thro charge.isAffordableFor(owner); if (ess.getSettings().getPerWarpPermission() && !owner.isAuthorized("essentials.warps." + name)) { - throw new Exception(_("warpUsePermission")); + throw new Exception(tl("warpUsePermission")); } owner.getTeleport().warp(user, name, charge, TeleportCause.COMMAND); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandweather.java b/Essentials/src/com/earth2me/essentials/commands/Commandweather.java index 287efe3592..15947e2610 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandweather.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandweather.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import org.bukkit.Server; import org.bukkit.World; @@ -46,15 +46,15 @@ else if (commandLabel.equalsIgnoreCase("storm") || commandLabel.equalsIgnoreCase world.setStorm(isStorm); world.setWeatherDuration(Integer.parseInt(args[1]) * 20); user.sendMessage(isStorm - ? _("weatherStormFor", world.getName(), args[1]) - : _("weatherSunFor", world.getName(), args[1])); + ? tl("weatherStormFor", world.getName(), args[1]) + : tl("weatherSunFor", world.getName(), args[1])); } else { world.setStorm(isStorm); user.sendMessage(isStorm - ? _("weatherStorm", world.getName()) - : _("weatherSun", world.getName())); + ? tl("weatherStorm", world.getName()) + : tl("weatherSun", world.getName())); } } @@ -70,7 +70,7 @@ protected void run(final Server server, final CommandSource sender, final String final World world = server.getWorld(args[0]); if (world == null) { - throw new Exception(_("weatherInvalidWorldWorld", args[0])); + throw new Exception(tl("weatherInvalidWorldWorld", args[0])); } if (args.length > 2) { @@ -78,15 +78,15 @@ protected void run(final Server server, final CommandSource sender, final String world.setStorm(isStorm); world.setWeatherDuration(Integer.parseInt(args[2]) * 20); sender.sendMessage(isStorm - ? _("weatherStormFor", world.getName(), args[2]) - : _("weatherSunFor", world.getName(), args[2])); + ? tl("weatherStormFor", world.getName(), args[2]) + : tl("weatherSunFor", world.getName(), args[2])); } else { world.setStorm(isStorm); sender.sendMessage(isStorm - ? _("weatherStorm", world.getName()) - : _("weatherSun", world.getName())); + ? tl("weatherStorm", world.getName()) + : tl("weatherSun", world.getName())); } } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java b/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java index 4d4b5df7a8..a3f7f6ae89 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import com.earth2me.essentials.craftbukkit.SetExpFix; import com.earth2me.essentials.utils.DateUtil; @@ -27,39 +27,39 @@ public void run(final Server server, final CommandSource sender, final String co User user = getPlayer(server, sender, args, 0); - sender.sendMessage(_("whoisTop", user.getName())); + sender.sendMessage(tl("whoisTop", user.getName())); user.setDisplayNick(); - sender.sendMessage(_("whoisNick", user.getDisplayName())); - sender.sendMessage(_("whoisHealth", user.getHealth())); - sender.sendMessage(_("whoisHunger", user.getFoodLevel(), user.getSaturation())); - sender.sendMessage(_("whoisExp", SetExpFix.getTotalExperience(user.getBase()), user.getLevel())); - sender.sendMessage(_("whoisLocation", user.getLocation().getWorld().getName(), user.getLocation().getBlockX(), user.getLocation().getBlockY(), user.getLocation().getBlockZ())); + sender.sendMessage(tl("whoisNick", user.getDisplayName())); + sender.sendMessage(tl("whoisHealth", user.getHealth())); + sender.sendMessage(tl("whoisHunger", user.getFoodLevel(), user.getSaturation())); + sender.sendMessage(tl("whoisExp", SetExpFix.getTotalExperience(user.getBase()), user.getLevel())); + sender.sendMessage(tl("whoisLocation", user.getLocation().getWorld().getName(), user.getLocation().getBlockX(), user.getLocation().getBlockY(), user.getLocation().getBlockZ())); if (!ess.getSettings().isEcoDisabled()) { - sender.sendMessage(_("whoisMoney", NumberUtil.displayCurrency(user.getMoney(), ess))); + sender.sendMessage(tl("whoisMoney", NumberUtil.displayCurrency(user.getMoney(), ess))); } - sender.sendMessage(_("whoisIPAddress", user.getAddress().getAddress().toString())); + sender.sendMessage(tl("whoisIPAddress", user.getAddress().getAddress().toString())); final String location = user.getGeoLocation(); if (location != null && (sender.isPlayer() ? ess.getUser(sender.getPlayer()).isAuthorized("essentials.geoip.show") : true)) { - sender.sendMessage(_("whoisGeoLocation", location)); + sender.sendMessage(tl("whoisGeoLocation", location)); } - sender.sendMessage(_("whoisGamemode", _(user.getGameMode().toString().toLowerCase(Locale.ENGLISH)))); - sender.sendMessage(_("whoisGod", (user.isGodModeEnabled() ? _("true") : _("false")))); - sender.sendMessage(_("whoisOp", (user.isOp() ? _("true") : _("false")))); - sender.sendMessage(_("whoisFly", user.getAllowFlight() ? _("true") : _("false"), user.isFlying() ? _("flying") : _("notFlying"))); - sender.sendMessage(_("whoisAFK", (user.isAfk() ? _("true") : _("false")))); - sender.sendMessage(_("whoisJail", (user.isJailed() + sender.sendMessage(tl("whoisGamemode", tl(user.getGameMode().toString().toLowerCase(Locale.ENGLISH)))); + sender.sendMessage(tl("whoisGod", (user.isGodModeEnabled() ? tl("true") : tl("false")))); + sender.sendMessage(tl("whoisOp", (user.isOp() ? tl("true") : tl("false")))); + sender.sendMessage(tl("whoisFly", user.getAllowFlight() ? tl("true") : tl("false"), user.isFlying() ? tl("flying") : tl("notFlying"))); + sender.sendMessage(tl("whoisAFK", (user.isAfk() ? tl("true") : tl("false")))); + sender.sendMessage(tl("whoisJail", (user.isJailed() ? user.getJailTimeout() > 0 ? DateUtil.formatDateDiff(user.getJailTimeout()) - : _("true") - : _("false")))); - sender.sendMessage(_("whoisMuted", (user.isMuted() + : tl("true") + : tl("false")))); + sender.sendMessage(tl("whoisMuted", (user.isMuted() ? user.getMuteTimeout() > 0 ? DateUtil.formatDateDiff(user.getMuteTimeout()) - : _("true") - : _("false")))); + : tl("true") + : tl("false")))); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandworld.java b/Essentials/src/com/earth2me/essentials/commands/Commandworld.java index b0559a4a09..1a6d3ea7ba 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandworld.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandworld.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; import java.util.List; @@ -47,16 +47,16 @@ protected void run(final Server server, final User user, final String commandLab world = ess.getWorld(getFinalArg(args, 0)); if (world == null) { - user.sendMessage(_("invalidWorld")); - user.sendMessage(_("possibleWorlds", server.getWorlds().size() - 1)); - user.sendMessage(_("typeWorldName")); + user.sendMessage(tl("invalidWorld")); + user.sendMessage(tl("possibleWorlds", server.getWorlds().size() - 1)); + user.sendMessage(tl("typeWorldName")); throw new NoChargeException(); } } if (ess.getSettings().isWorldTeleportPermissions() && !user.isAuthorized("essentials.worlds." + world.getName())) { - throw new Exception(_("noPerm", "essentials.worlds." + world.getName())); + throw new Exception(tl("noPerm", "essentials.worlds." + world.getName())); } double factor; diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandworth.java b/Essentials/src/com/earth2me/essentials/commands/Commandworth.java index eeea2d7e38..097812ce27 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandworth.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandworth.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.NumberUtil; import java.math.BigDecimal; @@ -60,11 +60,11 @@ public void run(final Server server, final User user, final String commandLabel, { if (args.length > 0 && args[0].equalsIgnoreCase("blocks")) { - user.sendMessage(_("totalSellableBlocks", type, NumberUtil.displayCurrency(totalWorth, ess))); + user.sendMessage(tl("totalSellableBlocks", type, NumberUtil.displayCurrency(totalWorth, ess))); } else { - user.sendMessage(_("totalSellableAll", type, NumberUtil.displayCurrency(totalWorth, ess))); + user.sendMessage(tl("totalSellableAll", type, NumberUtil.displayCurrency(totalWorth, ess))); } } } @@ -110,7 +110,7 @@ private BigDecimal itemWorth(CommandSource sender, User user, ItemStack is, Stri if (worth == null) { - throw new Exception(_("itemCannotBeSold")); + throw new Exception(tl("itemCannotBeSold")); } if (amount < 0) @@ -121,13 +121,13 @@ private BigDecimal itemWorth(CommandSource sender, User user, ItemStack is, Stri BigDecimal result = worth.multiply(BigDecimal.valueOf(amount)); sender.sendMessage(is.getDurability() != 0 - ? _("worthMeta", + ? tl("worthMeta", is.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", ""), is.getDurability(), NumberUtil.displayCurrency(result, ess), amount, NumberUtil.displayCurrency(worth, ess)) - : _("worth", + : tl("worth", is.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", ""), NumberUtil.displayCurrency(result, ess), amount, diff --git a/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java b/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java index d9f239a7c1..b13e6a92fa 100644 --- a/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java +++ b/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.*; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.utils.FormatUtil; import java.util.List; import java.util.Locale; @@ -163,7 +163,7 @@ public final void run(final Server server, final CommandSource sender, final Str protected void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception { - throw new Exception(_("onlyPlayers", commandLabel)); + throw new Exception(tl("onlyPlayers", commandLabel)); } public static String getFinalArg(final String[] args, final int start) diff --git a/Essentials/src/com/earth2me/essentials/commands/PlayerNotFoundException.java b/Essentials/src/com/earth2me/essentials/commands/PlayerNotFoundException.java index c33e875227..1f5a00fbd0 100644 --- a/Essentials/src/com/earth2me/essentials/commands/PlayerNotFoundException.java +++ b/Essentials/src/com/earth2me/essentials/commands/PlayerNotFoundException.java @@ -1,11 +1,11 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; public class PlayerNotFoundException extends NoSuchFieldException { public PlayerNotFoundException() { - super(_("playerNotFound")); + super(tl("playerNotFound")); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/WarpNotFoundException.java b/Essentials/src/com/earth2me/essentials/commands/WarpNotFoundException.java index bfba73818e..38573bfda5 100644 --- a/Essentials/src/com/earth2me/essentials/commands/WarpNotFoundException.java +++ b/Essentials/src/com/earth2me/essentials/commands/WarpNotFoundException.java @@ -1,12 +1,12 @@ package com.earth2me.essentials.commands; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; public class WarpNotFoundException extends Exception { public WarpNotFoundException() { - super(_("warpNotExist")); + super(tl("warpNotExist")); } public WarpNotFoundException(String message) diff --git a/Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java b/Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java index 78e8d33bfe..096a7fc5ea 100644 --- a/Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java +++ b/Essentials/src/com/earth2me/essentials/signs/EssentialsSign.java @@ -1,13 +1,12 @@ package com.earth2me.essentials.signs; import com.earth2me.essentials.*; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.utils.NumberUtil; import java.math.BigDecimal; import java.util.HashSet; import java.util.Locale; import java.util.Set; -import java.util.logging.Level; import net.ess3.api.IEssentials; import net.ess3.api.MaxMoneyException; import net.ess3.api.events.SignBreakEvent; @@ -44,7 +43,7 @@ protected final boolean onSignCreate(final SignChangeEvent event, final IEssenti // they won't change it to §1[Signname] return true; } - sign.setLine(0, _("signFormatFail", this.signName)); + sign.setLine(0, tl("signFormatFail", this.signName)); final SignCreateEvent signEvent = new SignCreateEvent(sign, this, user); ess.getServer().getPluginManager().callEvent(signEvent); @@ -76,12 +75,12 @@ protected final boolean onSignCreate(final SignChangeEvent event, final IEssenti public String getSuccessName() { - return _("signFormatSuccess", this.signName); + return tl("signFormatSuccess", this.signName); } public String getTemplateName() { - return _("signFormatTemplate", this.signName); + return tl("signFormatTemplate", this.signName); } public String getName() @@ -365,7 +364,7 @@ protected final Trade getTrade(final ISign sign, final int amountIndex, final in final int amount = Math.min(getIntegerPositive(getSignText(sign, amountIndex)), item.getType().getMaxStackSize() * player.getInventory().getSize()); if (item.getType() == Material.AIR || amount < 1) { - throw new SignException(_("moreThanZero")); + throw new SignException(tl("moreThanZero")); } item.setAmount(amount); return new Trade(item, ess); @@ -387,7 +386,7 @@ protected final int getIntegerPositive(final String line) throws SignException final int quantity = getInteger(line); if (quantity < 1) { - throw new SignException(_("moreThanZero")); + throw new SignException(tl("moreThanZero")); } return quantity; } @@ -451,7 +450,7 @@ protected final BigDecimal getBigDecimalPositive(final String line) throws SignE final BigDecimal quantity = getBigDecimal(line); if (quantity.compareTo(MINTRANSACTION) < 0) { - throw new SignException(_("moreThanZero")); + throw new SignException(tl("moreThanZero")); } return quantity; } @@ -491,7 +490,7 @@ protected final Trade getTrade(final ISign sign, final int index, final int decr final String[] split = line.split("[ :]+", 2); if (split.length != 2) { - throw new SignException(_("invalidCharge")); + throw new SignException(tl("invalidCharge")); } final int quantity = getIntegerPositive(split[0]); diff --git a/Essentials/src/com/earth2me/essentials/signs/SignBalance.java b/Essentials/src/com/earth2me/essentials/signs/SignBalance.java index 0682a46c55..bd5b10f09b 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignBalance.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignBalance.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.signs; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.NumberUtil; import net.ess3.api.IEssentials; @@ -16,7 +16,7 @@ public SignBalance() @Override protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException { - player.sendMessage(_("balance", NumberUtil.displayCurrency(player.getMoney(), ess))); + player.sendMessage(tl("balance", NumberUtil.displayCurrency(player.getMoney(), ess))); return true; } } diff --git a/Essentials/src/com/earth2me/essentials/signs/SignEnchant.java b/Essentials/src/com/earth2me/essentials/signs/SignEnchant.java index a3ca295911..ce3b856440 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignEnchant.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignEnchant.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.signs; import com.earth2me.essentials.*; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import java.util.Locale; import net.ess3.api.IEssentials; import org.bukkit.enchantments.Enchantment; @@ -32,13 +32,13 @@ protected boolean onSignCreate(final ISign sign, final User player, final String if (enchantLevel.length != 2) { sign.setLine(2, "§c"); - throw new SignException(_("invalidSignLine", 3)); + throw new SignException(tl("invalidSignLine", 3)); } final Enchantment enchantment = Enchantments.getByName(enchantLevel[0]); if (enchantment == null) { sign.setLine(2, "§c"); - throw new SignException(_("enchantmentNotFound")); + throw new SignException(tl("enchantmentNotFound")); } int level; try @@ -89,12 +89,12 @@ protected boolean onSignInteract(ISign sign, User player, String username, IEsse final String[] enchantLevel = sign.getLine(2).split(":"); if (enchantLevel.length != 2) { - throw new SignException(_("invalidSignLine", 3)); + throw new SignException(tl("invalidSignLine", 3)); } final Enchantment enchantment = Enchantments.getByName(enchantLevel[0]); if (enchantment == null) { - throw new SignException(_("enchantmentNotFound")); + throw new SignException(tl("enchantmentNotFound")); } int level; try @@ -112,11 +112,11 @@ protected boolean onSignInteract(ISign sign, User player, String username, IEsse || (playerHand.containsEnchantment(enchantment) && playerHand.getEnchantmentLevel(enchantment) == level)) { - throw new SignException(_("missingItems", 1, sign.getLine(1))); + throw new SignException(tl("missingItems", 1, sign.getLine(1))); } if (search != null && playerHand.getType() != search.getType()) { - throw new SignException(_("missingItems", 1, search.getType().toString().toLowerCase(Locale.ENGLISH).replace('_', ' '))); + throw new SignException(tl("missingItems", 1, search.getType().toString().toLowerCase(Locale.ENGLISH).replace('_', ' '))); } final ItemStack toEnchant = playerHand; @@ -146,11 +146,11 @@ protected boolean onSignInteract(ISign sign, User player, String username, IEsse final String enchantmentName = enchantment.getName().toLowerCase(Locale.ENGLISH); if (level == 0) { - player.sendMessage(_("enchantmentRemoved", enchantmentName.replace('_', ' '))); + player.sendMessage(tl("enchantmentRemoved", enchantmentName.replace('_', ' '))); } else { - player.sendMessage(_("enchantmentApplied", enchantmentName.replace('_', ' '))); + player.sendMessage(tl("enchantmentApplied", enchantmentName.replace('_', ' '))); } charge.charge(player); diff --git a/Essentials/src/com/earth2me/essentials/signs/SignFree.java b/Essentials/src/com/earth2me/essentials/signs/SignFree.java index e16a4846f4..7414981887 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignFree.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignFree.java @@ -1,10 +1,9 @@ package com.earth2me.essentials.signs; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; import net.ess3.api.IEssentials; -import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; @@ -43,7 +42,7 @@ protected boolean onSignInteract(final ISign sign, final User player, final Stri if (item.getType() == Material.AIR) { - throw new SignException(_("cantSpawnItem", "Air")); + throw new SignException(tl("cantSpawnItem", "Air")); } item.setAmount(item.getType().getMaxStackSize()); diff --git a/Essentials/src/com/earth2me/essentials/signs/SignGameMode.java b/Essentials/src/com/earth2me/essentials/signs/SignGameMode.java index 126fd01249..396b2cf6a4 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignGameMode.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignGameMode.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.signs; import com.earth2me.essentials.ChargeException; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; import java.util.Locale; @@ -39,13 +39,13 @@ protected boolean onSignInteract(final ISign sign, final User player, final Stri if (mode.isEmpty()) { - throw new SignException(_("invalidSignLine", 2)); + throw new SignException(tl("invalidSignLine", 2)); } charge.isAffordableFor(player); performSetMode(mode.toLowerCase(Locale.ENGLISH), player.getBase()); - player.sendMessage(_("gameMode", _(player.getGameMode().toString().toLowerCase(Locale.ENGLISH)), player.getDisplayName())); + player.sendMessage(tl("gameMode", tl(player.getGameMode().toString().toLowerCase(Locale.ENGLISH)), player.getDisplayName())); Trade.log("Sign", "gameMode", "Interact", username, null, username, charge, sign.getBlock().getLocation(), ess); charge.charge(player); return true; @@ -67,7 +67,7 @@ else if (mode.contains("advent") || mode.equalsIgnoreCase("2")) } else { - throw new SignException(_("invalidSignLine", 2)); + throw new SignException(tl("invalidSignLine", 2)); } } } diff --git a/Essentials/src/com/earth2me/essentials/signs/SignHeal.java b/Essentials/src/com/earth2me/essentials/signs/SignHeal.java index edd15ce292..18b744bef7 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignHeal.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignHeal.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.signs; import com.earth2me.essentials.ChargeException; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; import net.ess3.api.IEssentials; @@ -26,14 +26,14 @@ protected boolean onSignInteract(final ISign sign, final User player, final Stri { if (player.getHealth() == 0) { - throw new SignException(_("healDead")); + throw new SignException(tl("healDead")); } final Trade charge = getTrade(sign, 1, ess); charge.isAffordableFor(player); player.setHealth(20); player.setFoodLevel(20); player.setFireTicks(0); - player.sendMessage(_("youAreHealed")); + player.sendMessage(tl("youAreHealed")); charge.charge(player); Trade.log("Sign", "Heal", "Interact", username, null, username, charge, sign.getBlock().getLocation(), ess); return true; diff --git a/Essentials/src/com/earth2me/essentials/signs/SignKit.java b/Essentials/src/com/earth2me/essentials/signs/SignKit.java index ed7a9d753a..dc181953b3 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignKit.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignKit.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.signs; import com.earth2me.essentials.*; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.commands.NoChargeException; import java.util.List; import java.util.Locale; @@ -79,10 +79,10 @@ protected boolean onSignInteract(final ISign sign, final User player, final Stri else { if (group.isEmpty()) { - throw new SignException(_("noKitPermission", "essentials.kits." + kitName)); + throw new SignException(tl("noKitPermission", "essentials.kits." + kitName)); } else { - throw new SignException(_("noKitGroup", group)); + throw new SignException(tl("noKitGroup", group)); } } } diff --git a/Essentials/src/com/earth2me/essentials/signs/SignMail.java b/Essentials/src/com/earth2me/essentials/signs/SignMail.java index 85859b2eaf..85f150eca7 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignMail.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignMail.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.signs; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import java.util.List; import net.ess3.api.IEssentials; @@ -19,14 +19,14 @@ protected boolean onSignInteract(final ISign sign, final User player, final Stri final List mail = player.getMails(); if (mail.isEmpty()) { - player.sendMessage(_("noNewMail")); + player.sendMessage(tl("noNewMail")); return false; } for (String s : mail) { player.sendMessage(s); } - player.sendMessage(_("markMailAsRead")); + player.sendMessage(tl("markMailAsRead")); return true; } } diff --git a/Essentials/src/com/earth2me/essentials/signs/SignProtection.java b/Essentials/src/com/earth2me/essentials/signs/SignProtection.java index 6e9166fda7..ac74534647 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignProtection.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignProtection.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.signs; import com.earth2me.essentials.*; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.Trade.OverflowType; import com.earth2me.essentials.utils.FormatUtil; import java.util.*; @@ -43,7 +43,7 @@ protected boolean onSignCreate(final ISign sign, final User player, final String return true; } } - player.sendMessage(_("signProtectInvalidLocation")); + player.sendMessage(tl("signProtectInvalidLocation")); return false; } @@ -256,7 +256,7 @@ protected boolean onBlockPlace(final Block block, final User player, final Strin if ((state == SignProtectionState.ALLOWED || state == SignProtectionState.NOT_ALLOWED) && !player.isAuthorized("essentials.signs.protection.override")) { - player.sendMessage(_("noPlacePermission", block.getType().toString().toLowerCase(Locale.ENGLISH))); + player.sendMessage(tl("noPlacePermission", block.getType().toString().toLowerCase(Locale.ENGLISH))); return false; } } @@ -281,7 +281,7 @@ protected boolean onBlockInteract(final Block block, final User player, final St } - player.sendMessage(_("noAccessPermission", block.getType().toString().toLowerCase(Locale.ENGLISH))); + player.sendMessage(tl("noAccessPermission", block.getType().toString().toLowerCase(Locale.ENGLISH))); return false; } @@ -304,7 +304,7 @@ protected boolean onBlockBreak(final Block block, final User player, final Strin } - player.sendMessage(_("noDestroyPermission", block.getType().toString().toLowerCase(Locale.ENGLISH))); + player.sendMessage(tl("noDestroyPermission", block.getType().toString().toLowerCase(Locale.ENGLISH))); return false; } diff --git a/Essentials/src/com/earth2me/essentials/signs/SignRepair.java b/Essentials/src/com/earth2me/essentials/signs/SignRepair.java index 2348a09747..91c4a4314f 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignRepair.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignRepair.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.signs; import com.earth2me.essentials.ChargeException; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; import com.earth2me.essentials.commands.Commandrepair; @@ -27,7 +27,7 @@ protected boolean onSignCreate(final ISign sign, final User player, final String else if (!repairTarget.equalsIgnoreCase("all") && !repairTarget.equalsIgnoreCase("hand")) { sign.setLine(1, "§c"); - throw new SignException(_("invalidSignLine", 2)); + throw new SignException(tl("invalidSignLine", 2)); } validateTrade(sign, 2, ess); return true; diff --git a/Essentials/src/com/earth2me/essentials/signs/SignTime.java b/Essentials/src/com/earth2me/essentials/signs/SignTime.java index 026f9f19dc..2f6390f7ad 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignTime.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignTime.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.signs; import com.earth2me.essentials.ChargeException; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; import net.ess3.api.IEssentials; @@ -29,7 +29,7 @@ protected boolean onSignCreate(final ISign sign, final User player, final String sign.setLine(1, "§2Night"); return true; } - throw new SignException(_("onlyDayNight")); + throw new SignException(tl("onlyDayNight")); } @Override @@ -54,6 +54,6 @@ protected boolean onSignInteract(final ISign sign, final User player, final Stri Trade.log("Sign", "TimeNight", "Interact", username, null, username, charge, sign.getBlock().getLocation(), ess); return true; } - throw new SignException(_("onlyDayNight")); + throw new SignException(tl("onlyDayNight")); } } diff --git a/Essentials/src/com/earth2me/essentials/signs/SignTrade.java b/Essentials/src/com/earth2me/essentials/signs/SignTrade.java index b0c644c833..f51611aafd 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignTrade.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignTrade.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.signs; import com.earth2me.essentials.*; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.Trade.OverflowType; import com.earth2me.essentials.Trade.TradeType; import com.earth2me.essentials.utils.NumberUtil; @@ -67,7 +67,7 @@ protected boolean onSignInteract(final ISign sign, final User player, final Stri { if (store == null) { - throw new SignException(_("tradeSignEmptyOwner"), e); + throw new SignException(tl("tradeSignEmptyOwner"), e); } } Trade.log("Sign", "Trade", "Deposit", username, store, username, null, sign.getBlock().getLocation(), ess); @@ -190,7 +190,7 @@ protected final void validateTrade(final ISign sign, final int index, final bool amount = amount.subtract(amount.remainder(money)); if (amount.compareTo(MINTRANSACTION) < 0 || money.compareTo(MINTRANSACTION) < 0) { - throw new SignException(_("moreThanZero")); + throw new SignException(tl("moreThanZero")); } sign.setLine(index, NumberUtil.shortCurrency(money, ess) + ":" + NumberUtil.shortCurrency(amount, ess).substring(1)); return; @@ -203,12 +203,12 @@ protected final void validateTrade(final ISign sign, final int index, final bool if (amount < 1) { - throw new SignException(_("moreThanZero")); + throw new SignException(tl("moreThanZero")); } if (!(split[1].equalsIgnoreCase("exp") || split[1].equalsIgnoreCase("xp")) && getItemStack(split[1], amount, ess).getType() == Material.AIR) { - throw new SignException(_("moreThanZero")); + throw new SignException(tl("moreThanZero")); } String newline = amount + " " + split[1] + ":0"; if ((newline + amount).length() > 15) @@ -226,17 +226,17 @@ && getItemStack(split[1], amount, ess).getType() == Material.AIR) amount -= amount % stackamount; if (amount < 1 || stackamount < 1) { - throw new SignException(_("moreThanZero")); + throw new SignException(tl("moreThanZero")); } if (!(split[1].equalsIgnoreCase("exp") || split[1].equalsIgnoreCase("xp")) && getItemStack(split[1], stackamount, ess).getType() == Material.AIR) { - throw new SignException(_("moreThanZero")); + throw new SignException(tl("moreThanZero")); } sign.setLine(index, stackamount + " " + split[1] + ":" + amount); return; } - throw new SignException(_("invalidSignLine", index + 1)); + throw new SignException(tl("invalidSignLine", index + 1)); } protected final Trade getTrade(final ISign sign, final int index, final AmountType amountType, final boolean notEmpty, final IEssentials ess) throws SignException @@ -261,7 +261,7 @@ protected final Trade getTrade(final ISign sign, final int index, final AmountTy } catch (SignException e) { - throw new SignException(_("tradeSignEmpty"), e); + throw new SignException(tl("tradeSignEmpty"), e); } } @@ -277,7 +277,7 @@ protected final Trade getTrade(final ISign sign, final int index, final AmountTy } if (notEmpty && (amount < 1 || stackamount < 1)) { - throw new SignException(_("tradeSignEmpty")); + throw new SignException(tl("tradeSignEmpty")); } return new Trade((amountType == AmountType.COST ? stackamount : amount), ess); } @@ -292,13 +292,13 @@ protected final Trade getTrade(final ISign sign, final int index, final AmountTy } if (notEmpty && (amount < 1 || stackamount < 1 || item.getType() == Material.AIR || amount < stackamount)) { - throw new SignException(_("tradeSignEmpty")); + throw new SignException(tl("tradeSignEmpty")); } item.setAmount(amountType == AmountType.COST ? stackamount : amount); return new Trade(item, ess); } } - throw new SignException(_("invalidSignLine", index + 1)); + throw new SignException(tl("invalidSignLine", index + 1)); } protected final void subtractAmount(final ISign sign, final int index, final Trade trade, final IEssentials ess) throws SignException @@ -361,7 +361,7 @@ private void changeAmount(final ISign sign, final int index, final BigDecimal va setAmount(sign, index, amount, ess); return; } - throw new SignException(_("invalidSignLine", index + 1)); + throw new SignException(tl("invalidSignLine", index + 1)); } //TODO: Translate these exceptions. @@ -417,7 +417,7 @@ private void setAmount(final ISign sign, final int index, final BigDecimal value return; } } - throw new SignException(_("invalidSignLine", index + 1)); + throw new SignException(tl("invalidSignLine", index + 1)); } diff --git a/Essentials/src/com/earth2me/essentials/signs/SignWarp.java b/Essentials/src/com/earth2me/essentials/signs/SignWarp.java index 1d6960d14f..2281ec6501 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignWarp.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignWarp.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.signs; import com.earth2me.essentials.ChargeException; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; import net.ess3.api.IEssentials; @@ -24,7 +24,7 @@ protected boolean onSignCreate(final ISign sign, final User player, final String if (warpName.isEmpty()) { sign.setLine(1, "§c"); - throw new SignException(_("invalidSignLine", 1)); + throw new SignException(tl("invalidSignLine", 1)); } else { diff --git a/Essentials/src/com/earth2me/essentials/signs/SignWeather.java b/Essentials/src/com/earth2me/essentials/signs/SignWeather.java index 45f7158268..910adeb328 100644 --- a/Essentials/src/com/earth2me/essentials/signs/SignWeather.java +++ b/Essentials/src/com/earth2me/essentials/signs/SignWeather.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.signs; import com.earth2me.essentials.ChargeException; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; import net.ess3.api.IEssentials; @@ -30,7 +30,7 @@ protected boolean onSignCreate(final ISign sign, final User player, final String return true; } sign.setLine(1, "§c"); - throw new SignException(_("onlySunStorm")); + throw new SignException(tl("onlySunStorm")); } @Override @@ -53,6 +53,6 @@ protected boolean onSignInteract(final ISign sign, final User player, final Stri Trade.log("Sign", "WeatherStorm", "Interact", username, null, username, charge, sign.getBlock().getLocation(), ess); return true; } - throw new SignException(_("onlySunStorm")); + throw new SignException(tl("onlySunStorm")); } } diff --git a/Essentials/src/com/earth2me/essentials/textreader/BookPager.java b/Essentials/src/com/earth2me/essentials/textreader/BookPager.java index aacd3a0383..311f608633 100644 --- a/Essentials/src/com/earth2me/essentials/textreader/BookPager.java +++ b/Essentials/src/com/earth2me/essentials/textreader/BookPager.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.textreader; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import java.util.ArrayList; import java.util.List; import java.util.Locale; @@ -26,7 +26,7 @@ public List getPages(final String pageStr) throws Exception //This checks to see if we have the chapter in the index if (!bookmarks.containsKey(pageStr.toLowerCase(Locale.ENGLISH))) { - throw new Exception(_("infoUnknownChapter")); + throw new Exception(tl("infoUnknownChapter")); } //Since we have a valid chapter, count the number of lines in the chapter diff --git a/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java b/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java index c51b0cba89..1e74871d4f 100644 --- a/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java +++ b/Essentials/src/com/earth2me/essentials/textreader/HelpInput.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.textreader; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import java.io.IOException; import java.util.*; @@ -29,7 +29,7 @@ public HelpInput(final User user, final String match, final IEssentials ess) thr String pluginNameLow = ""; if (!match.equalsIgnoreCase("")) { - lines.add(_("helpMatching", match)); + lines.add(tl("helpMatching", match)); } for (Plugin p : ess.getServer().getPluginManager().getPlugins()) @@ -45,7 +45,7 @@ public HelpInput(final User user, final String match, final IEssentials ess) thr { lines.clear(); newLines.clear(); - lines.add(_("helpFrom", p.getDescription().getName())); + lines.add(tl("helpFrom", p.getDescription().getName())); } final boolean isOnWhitelist = user.isAuthorized("essentials.help." + pluginNameLow); @@ -65,7 +65,7 @@ public HelpInput(final User user, final String match, final IEssentials ess) thr final String node = "essentials." + k.getKey(); if (!ess.getSettings().isCommandDisabled(k.getKey()) && user.isAuthorized(node)) { - pluginLines.add(_("helpLine", k.getKey(), k.getValue().get(DESCRIPTION))); + pluginLines.add(tl("helpLine", k.getKey(), k.getValue().get(DESCRIPTION))); } } else @@ -84,7 +84,7 @@ else if (value.containsKey(PERMISSIONS)) } if (isOnWhitelist || user.isAuthorized("essentials.help." + pluginNameLow + "." + k.getKey())) { - pluginLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); + pluginLines.add(tl("helpLine", k.getKey(), value.get(DESCRIPTION))); } else if (permissions instanceof List && !((List)permissions).isEmpty()) { @@ -99,21 +99,21 @@ else if (permissions instanceof List && !((List)permissions).isEmpty()) } if (enabled) { - pluginLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); + pluginLines.add(tl("helpLine", k.getKey(), value.get(DESCRIPTION))); } } else if (permissions instanceof String && !"".equals(permissions)) { if (user.isAuthorized(permissions.toString())) { - pluginLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); + pluginLines.add(tl("helpLine", k.getKey(), value.get(DESCRIPTION))); } } else { if (!ess.getSettings().hidePermissionlessHelp()) { - pluginLines.add(_("helpLine", k.getKey(), value.get(DESCRIPTION))); + pluginLines.add(tl("helpLine", k.getKey(), value.get(DESCRIPTION))); } } } @@ -132,7 +132,7 @@ else if (permissions instanceof String && !"".equals(permissions)) } if (match.equalsIgnoreCase("")) { - lines.add(_("helpPlugin", pluginName, pluginNameLow)); + lines.add(tl("helpPlugin", pluginName, pluginNameLow)); } } } @@ -143,7 +143,7 @@ else if (permissions instanceof String && !"".equals(permissions)) { if (!reported) { - logger.log(Level.WARNING, _("commandHelpFailedForPlugin", pluginNameLow), ex); + logger.log(Level.WARNING, tl("commandHelpFailedForPlugin", pluginNameLow), ex); } reported = true; } diff --git a/Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java b/Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java index 22bf1778d0..2f4b1f2a52 100644 --- a/Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java +++ b/Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java @@ -2,7 +2,7 @@ import com.earth2me.essentials.CommandSource; import com.earth2me.essentials.ExecuteTimer; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.PlayerList; import com.earth2me.essentials.User; import static com.earth2me.essentials.textreader.KeywordType.DISPLAYNAME; @@ -284,7 +284,7 @@ else if (matchTokens.length > 2) if (user != null) { final Location location = user.getLocation(); - replacer = _("coordsKeyword", location.getBlockX(), location.getBlockY(), location.getBlockZ()); + replacer = tl("coordsKeyword", location.getBlockX(), location.getBlockY(), location.getBlockZ()); } break; case TPS: diff --git a/Essentials/src/com/earth2me/essentials/textreader/TextPager.java b/Essentials/src/com/earth2me/essentials/textreader/TextPager.java index e3a259333f..13b8aca001 100644 --- a/Essentials/src/com/earth2me/essentials/textreader/TextPager.java +++ b/Essentials/src/com/earth2me/essentials/textreader/TextPager.java @@ -2,7 +2,7 @@ import com.earth2me.essentials.CommandSource; import com.earth2me.essentials.I18n; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import java.util.List; import java.util.Locale; import java.util.Map; @@ -42,7 +42,7 @@ public void showPage(final String pageStr, final String chapterPageStr, final St { return; } - sender.sendMessage(_("infoChapter")); + sender.sendMessage(tl("infoChapter")); final StringBuilder sb = new StringBuilder(); boolean first = true; for (String string : chapters) @@ -99,7 +99,7 @@ public void showPage(final String pageStr, final String chapterPageStr, final St { content.append(I18n.capitalCase(commandName)); } - sender.sendMessage(_("infoPages", page, pages, content)); + sender.sendMessage(tl("infoPages", page, pages, content)); } for (int i = start; i < end && i < start + (onePage ? 20 : 9); i++) { @@ -107,7 +107,7 @@ public void showPage(final String pageStr, final String chapterPageStr, final St } if (!onePage && page < pages && commandName != null) { - sender.sendMessage(_("readNextPage", commandName, page + 1)); + sender.sendMessage(tl("readNextPage", commandName, page + 1)); } return; } @@ -134,7 +134,7 @@ public void showPage(final String pageStr, final String chapterPageStr, final St //This checks to see if we have the chapter in the index if (!bookmarks.containsKey(pageStr.toLowerCase(Locale.ENGLISH))) { - sender.sendMessage(_("infoUnknownChapter")); + sender.sendMessage(tl("infoUnknownChapter")); return; } @@ -159,7 +159,7 @@ public void showPage(final String pageStr, final String chapterPageStr, final St StringBuilder content = new StringBuilder(); content.append(I18n.capitalCase(commandName)).append(": "); content.append(pageStr); - sender.sendMessage(_("infoChapterPages", content, page, pages)); + sender.sendMessage(tl("infoChapterPages", content, page, pages)); } for (int i = start; i < chapterend && i < start + (onePage ? 20 : 9); i++) { @@ -167,7 +167,7 @@ public void showPage(final String pageStr, final String chapterPageStr, final St } if (!onePage && page < pages && commandName != null) { - sender.sendMessage(_("readNextPage", commandName, pageStr + " " + (page + 1))); + sender.sendMessage(tl("readNextPage", commandName, pageStr + " " + (page + 1))); } } } diff --git a/Essentials/src/com/earth2me/essentials/utils/DateUtil.java b/Essentials/src/com/earth2me/essentials/utils/DateUtil.java index e416fbb0ed..911e817050 100644 --- a/Essentials/src/com/earth2me/essentials/utils/DateUtil.java +++ b/Essentials/src/com/earth2me/essentials/utils/DateUtil.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.utils; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import java.util.Calendar; import java.util.GregorianCalendar; import java.util.regex.Matcher; @@ -70,7 +70,7 @@ public static long parseDateDiff(String time, boolean future) throws Exception } if (!found) { - throw new Exception(_("illegalDate")); + throw new Exception(tl("illegalDate")); } Calendar c = new GregorianCalendar(); if (years > 0) @@ -138,7 +138,7 @@ public static String formatDateDiff(Calendar fromDate, Calendar toDate) boolean future = false; if (toDate.equals(fromDate)) { - return _("now"); + return tl("now"); } if (toDate.after(fromDate)) { @@ -151,7 +151,7 @@ public static String formatDateDiff(Calendar fromDate, Calendar toDate) }; String[] names = new String[] { - _("year"), _("years"), _("month"), _("months"), _("day"), _("days"), _("hour"), _("hours"), _("minute"), _("minutes"), _("second"), _("seconds") + tl("year"), tl("years"), tl("month"), tl("months"), tl("day"), tl("days"), tl("hour"), tl("hours"), tl("minute"), tl("minutes"), tl("second"), tl("seconds") }; int accuracy = 0; for (int i = 0; i < types.length; i++) diff --git a/Essentials/src/com/earth2me/essentials/utils/DescParseTickFormat.java b/Essentials/src/com/earth2me/essentials/utils/DescParseTickFormat.java index b10412e602..f2087f914a 100644 --- a/Essentials/src/com/earth2me/essentials/utils/DescParseTickFormat.java +++ b/Essentials/src/com/earth2me/essentials/utils/DescParseTickFormat.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.utils; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import java.text.SimpleDateFormat; import java.util.*; @@ -222,7 +222,7 @@ public static boolean meansReset(final String desc) // ============================================ public static String format(final long ticks) { - return _("timeFormat", format24(ticks), format12(ticks), formatTicks(ticks)); + return tl("timeFormat", format24(ticks), format12(ticks), formatTicks(ticks)); } public static String formatTicks(final long ticks) { diff --git a/Essentials/src/com/earth2me/essentials/utils/LocationUtil.java b/Essentials/src/com/earth2me/essentials/utils/LocationUtil.java index 1d2cbb6ae0..d9871983c8 100644 --- a/Essentials/src/com/earth2me/essentials/utils/LocationUtil.java +++ b/Essentials/src/com/earth2me/essentials/utils/LocationUtil.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.utils; import com.earth2me.essentials.Essentials; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; @@ -282,7 +282,7 @@ public static Location getSafeDestination(final Location loc) throws Exception { if (loc == null || loc.getWorld() == null) { - throw new Exception(_("destinationNotSet")); + throw new Exception(tl("destinationNotSet")); } final World world = loc.getWorld(); int x = loc.getBlockX(); @@ -338,7 +338,7 @@ public static Location getSafeDestination(final Location loc) throws Exception y = world.getHighestBlockYAt(x, z); if (x - 48 > loc.getBlockX()) { - throw new Exception(_("holeInFloor")); + throw new Exception(tl("holeInFloor")); } } } diff --git a/Essentials/src/com/earth2me/essentials/utils/NumberUtil.java b/Essentials/src/com/earth2me/essentials/utils/NumberUtil.java index 2655c111aa..2c03d33da4 100644 --- a/Essentials/src/com/earth2me/essentials/utils/NumberUtil.java +++ b/Essentials/src/com/earth2me/essentials/utils/NumberUtil.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.utils; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import java.math.BigDecimal; import java.math.RoundingMode; import java.text.DecimalFormat; @@ -38,7 +38,7 @@ public static String formatAsCurrency(final BigDecimal value) public static String displayCurrency(final BigDecimal value, final IEssentials ess) { - return _("currency", ess.getSettings().getCurrencySymbol(), formatAsCurrency(value)); + return tl("currency", ess.getSettings().getCurrencySymbol(), formatAsCurrency(value)); } public static boolean isInt(final String sInt) diff --git a/Essentials/src/net/ess3/api/InvalidWorldException.java b/Essentials/src/net/ess3/api/InvalidWorldException.java index 89f27bbdd5..210b077620 100644 --- a/Essentials/src/net/ess3/api/InvalidWorldException.java +++ b/Essentials/src/net/ess3/api/InvalidWorldException.java @@ -1,6 +1,6 @@ package net.ess3.api; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; public class InvalidWorldException extends Exception @@ -9,7 +9,7 @@ public class InvalidWorldException extends Exception public InvalidWorldException(final String world) { - super(_("invalidWorld")); + super(tl("invalidWorld")); this.world = world; } diff --git a/Essentials/src/net/ess3/api/MaxMoneyException.java b/Essentials/src/net/ess3/api/MaxMoneyException.java index 4ac45be5b6..bdc78aad21 100644 --- a/Essentials/src/net/ess3/api/MaxMoneyException.java +++ b/Essentials/src/net/ess3/api/MaxMoneyException.java @@ -1,12 +1,12 @@ package net.ess3.api; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; public class MaxMoneyException extends Exception { public MaxMoneyException() { - super(_("maxMoney")); + super(tl("maxMoney")); } } diff --git a/Essentials/src/net/ess3/api/NoLoanPermittedException.java b/Essentials/src/net/ess3/api/NoLoanPermittedException.java index 761a42da3c..ed9cd8ca94 100644 --- a/Essentials/src/net/ess3/api/NoLoanPermittedException.java +++ b/Essentials/src/net/ess3/api/NoLoanPermittedException.java @@ -1,12 +1,12 @@ package net.ess3.api; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; public class NoLoanPermittedException extends Exception { public NoLoanPermittedException() { - super(_("negativeBalanceError")); + super(tl("negativeBalanceError")); } } diff --git a/Essentials/src/net/ess3/api/UserDoesNotExistException.java b/Essentials/src/net/ess3/api/UserDoesNotExistException.java index 4423301b61..9be186a5a4 100644 --- a/Essentials/src/net/ess3/api/UserDoesNotExistException.java +++ b/Essentials/src/net/ess3/api/UserDoesNotExistException.java @@ -1,12 +1,12 @@ package net.ess3.api; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; public class UserDoesNotExistException extends Exception { public UserDoesNotExistException(String name) { - super(_("userDoesNotExist", name)); + super(tl("userDoesNotExist", name)); } } diff --git a/Essentials/src/net/ess3/api/events/LocalChatSpyEvent.java b/Essentials/src/net/ess3/api/events/LocalChatSpyEvent.java index bfa7eeb843..1071a9f6d0 100644 --- a/Essentials/src/net/ess3/api/events/LocalChatSpyEvent.java +++ b/Essentials/src/net/ess3/api/events/LocalChatSpyEvent.java @@ -1,6 +1,6 @@ package net.ess3.api.events; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import java.util.IllegalFormatException; import java.util.Set; import org.bukkit.entity.Player; @@ -21,7 +21,7 @@ public class LocalChatSpyEvent extends Event implements Cancellable public LocalChatSpyEvent(final boolean async, final Player who, final String format, final String message, final Set players) { super(async); - this.format = _("chatTypeLocal").concat(_("chatTypeSpy")).concat(format); + this.format = tl("chatTypeLocal").concat(tl("chatTypeSpy")).concat(format); this.message = message; recipients = players; player = who; diff --git a/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java b/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java index 27ca5fe355..43fb60d2ed 100644 --- a/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java +++ b/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.antibuild; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import net.ess3.api.IEssentials; import java.util.logging.Level; @@ -85,7 +85,7 @@ public void onBlockPlace(final BlockPlaceEvent event) { if (ess.getSettings().warnOnBuildDisallow()) { - user.sendMessage(_("antiBuildPlace", type.toString())); + user.sendMessage(tl("antiBuildPlace", type.toString())); } event.setCancelled(true); return; @@ -95,7 +95,7 @@ public void onBlockPlace(final BlockPlaceEvent event) { if (ess.getSettings().warnOnBuildDisallow()) { - user.sendMessage(_("antiBuildPlace", type.toString())); + user.sendMessage(tl("antiBuildPlace", type.toString())); } event.setCancelled(true); return; @@ -104,7 +104,7 @@ public void onBlockPlace(final BlockPlaceEvent event) if (prot.checkProtectionItems(AntiBuildConfig.alert_on_placement, typeId) && !user.isAuthorized("essentials.protect.alerts.notrigger")) { - prot.getEssentialsConnect().alert(user, type.toString(), _("alertPlaced")); + prot.getEssentialsConnect().alert(user, type.toString(), tl("alertPlaced")); } } @@ -121,7 +121,7 @@ public void onBlockBreak(final BlockBreakEvent event) { if (ess.getSettings().warnOnBuildDisallow()) { - user.sendMessage(_("antiBuildBreak", type.toString())); + user.sendMessage(tl("antiBuildBreak", type.toString())); } event.setCancelled(true); return; @@ -132,7 +132,7 @@ public void onBlockBreak(final BlockBreakEvent event) { if (ess.getSettings().warnOnBuildDisallow()) { - user.sendMessage(_("antiBuildBreak", type.toString())); + user.sendMessage(tl("antiBuildBreak", type.toString())); } event.setCancelled(true); return; @@ -141,7 +141,7 @@ public void onBlockBreak(final BlockBreakEvent event) if (prot.checkProtectionItems(AntiBuildConfig.alert_on_break, typeId) && !user.isAuthorized("essentials.protect.alerts.notrigger")) { - prot.getEssentialsConnect().alert(user, type.toString(), _("alertBroke")); + prot.getEssentialsConnect().alert(user, type.toString(), tl("alertBroke")); } } @@ -160,7 +160,7 @@ public void onHangingBreak(final HangingBreakByEntityEvent event) { if (warn) { - user.sendMessage(_("antiBuildBreak", Material.PAINTING.toString())); + user.sendMessage(tl("antiBuildBreak", Material.PAINTING.toString())); } event.setCancelled(true); } @@ -168,7 +168,7 @@ else if(type == EntityType.ITEM_FRAME && !metaPermCheck(user, "break", Material. { if (warn) { - user.sendMessage(_("antiBuildBreak", Material.ITEM_FRAME.toString())); + user.sendMessage(tl("antiBuildBreak", Material.ITEM_FRAME.toString())); } event.setCancelled(true); } @@ -216,7 +216,7 @@ public void onPlayerInteract(final PlayerInteractEvent event) { if (ess.getSettings().warnOnBuildDisallow()) { - user.sendMessage(_("antiBuildUse", item.getType().toString())); + user.sendMessage(tl("antiBuildUse", item.getType().toString())); } event.setCancelled(true); return; @@ -226,7 +226,7 @@ public void onPlayerInteract(final PlayerInteractEvent event) && prot.checkProtectionItems(AntiBuildConfig.alert_on_use, item.getTypeId()) && !user.isAuthorized("essentials.protect.alerts.notrigger")) { - prot.getEssentialsConnect().alert(user, item.getType().toString(), _("alertUsed")); + prot.getEssentialsConnect().alert(user, item.getType().toString(), tl("alertUsed")); } if (prot.getSettingBool(AntiBuildConfig.disable_use) && !user.canBuild() && !user.isAuthorized("essentials.build")) @@ -236,7 +236,7 @@ public void onPlayerInteract(final PlayerInteractEvent event) event.setCancelled(true); if (ess.getSettings().warnOnBuildDisallow()) { - user.sendMessage(_("antiBuildUse", item.getType().toString())); + user.sendMessage(tl("antiBuildUse", item.getType().toString())); } return; } @@ -245,7 +245,7 @@ public void onPlayerInteract(final PlayerInteractEvent event) event.setCancelled(true); if (ess.getSettings().warnOnBuildDisallow()) { - user.sendMessage(_("antiBuildInteract", event.getClickedBlock().getType().toString())); + user.sendMessage(tl("antiBuildInteract", event.getClickedBlock().getType().toString())); } } } @@ -268,7 +268,7 @@ public void onCraftItemEvent(final CraftItemEvent event) event.setCancelled(true); if (ess.getSettings().warnOnBuildDisallow()) { - user.sendMessage(_("antiBuildCraft", item.getType().toString())); + user.sendMessage(tl("antiBuildCraft", item.getType().toString())); } } } @@ -307,7 +307,7 @@ public void onPlayerDropItem(final PlayerDropItemEvent event) user.updateInventory(); if (ess.getSettings().warnOnBuildDisallow()) { - user.sendMessage(_("antiBuildDrop", item.getType().toString())); + user.sendMessage(tl("antiBuildDrop", item.getType().toString())); } } } diff --git a/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsConnect.java b/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsConnect.java index 6f568a1098..2a7b4ecf7c 100644 --- a/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsConnect.java +++ b/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsConnect.java @@ -2,7 +2,7 @@ import com.earth2me.essentials.IConf; import com.earth2me.essentials.User; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import net.ess3.api.IEssentials; import java.util.logging.Level; import java.util.logging.Logger; @@ -21,7 +21,7 @@ public EssentialsConnect(Plugin essPlugin, Plugin essProtect) { if (!essProtect.getDescription().getVersion().equals(essPlugin.getDescription().getVersion())) { - LOGGER.log(Level.WARNING, _("versionMismatchAll")); + LOGGER.log(Level.WARNING, tl("versionMismatchAll")); } ess = (IEssentials)essPlugin; protect = (IAntiBuild)essProtect; @@ -42,7 +42,7 @@ public IEssentials getEssentials() public void alert(final User user, final String item, final String type) { final Location loc = user.getLocation(); - final String warnMessage = _("alertFormat", user.getName(), type, item, + final String warnMessage = tl("alertFormat", user.getName(), type, item, loc.getWorld().getName() + "," + loc.getBlockX() + "," + loc.getBlockY() + "," + loc.getBlockZ()); LOGGER.log(Level.WARNING, warnMessage); diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java index db1d0066cd..3ce515f3b2 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java +++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChat.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.chat; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import net.ess3.api.IEssentials; import java.util.Collections; import java.util.HashMap; @@ -23,7 +23,7 @@ public void onEnable() final IEssentials ess = (IEssentials)pluginManager.getPlugin("Essentials"); if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion())) { - LOGGER.log(Level.WARNING, _("versionMismatchAll")); + LOGGER.log(Level.WARNING, tl("versionMismatchAll")); } if (!ess.isEnabled()) { diff --git a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerNormal.java b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerNormal.java index 284da0a9bc..07e81d9d44 100644 --- a/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerNormal.java +++ b/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerNormal.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.chat; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import static com.earth2me.essentials.chat.EssentialsChatPlayer.logger; import net.ess3.api.IEssentials; @@ -63,14 +63,14 @@ public void onPlayerChat(final AsyncPlayerChatEvent event) final StringBuilder format = new StringBuilder(); format.append(chatStore.getType()).append("Format"); event.setMessage(event.getMessage().substring(1)); - event.setFormat(_(format.toString(), event.getFormat())); + event.setFormat(tl(format.toString(), event.getFormat())); return; } final StringBuilder errorMsg = new StringBuilder(); errorMsg.append("notAllowedTo").append(chatStore.getType().substring(0, 1).toUpperCase(Locale.ENGLISH)).append(chatStore.getType().substring(1)); - user.sendMessage(_(errorMsg.toString())); + user.sendMessage(tl(errorMsg.toString())); event.setCancelled(true); return; } @@ -100,9 +100,9 @@ public void onPlayerChat(final AsyncPlayerChatEvent event) } final String format = event.getFormat(); - event.setFormat(_("chatTypeLocal").concat(event.getFormat())); + event.setFormat(tl("chatTypeLocal").concat(event.getFormat())); - logger.info(_("localFormat", user.getName(), event.getMessage())); + logger.info(tl("localFormat", user.getName(), event.getMessage())); final Iterator it = outList.iterator(); while (it.hasNext()) @@ -137,7 +137,7 @@ public void onPlayerChat(final AsyncPlayerChatEvent event) } if (outList.size() < 2) { - user.sendMessage(_("localNoOne")); + user.sendMessage(tl("localNoOne")); } LocalChatSpyEvent spyEvent = new LocalChatSpyEvent(event.isAsynchronous(), event.getPlayer(), format, event.getMessage(), spyList); diff --git a/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIP.java b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIP.java index 02e901b5b8..aced4ccb8d 100644 --- a/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIP.java +++ b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIP.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.geoip; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import net.ess3.api.IEssentials; import java.util.logging.Level; import org.bukkit.plugin.PluginManager; @@ -25,7 +25,7 @@ public void onEnable() final IEssentials ess = (IEssentials)pm.getPlugin("Essentials"); if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion())) { - getLogger().log(Level.WARNING, _("versionMismatchAll")); + getLogger().log(Level.WARNING, tl("versionMismatchAll")); } if (!ess.isEnabled()) { this.setEnabled(false); diff --git a/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java index 89debe9fe4..a6cb28ddc3 100644 --- a/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java +++ b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.geoip; import com.earth2me.essentials.EssentialsConf; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.IConf; import com.earth2me.essentials.User; import net.ess3.api.IEssentials; @@ -96,7 +96,7 @@ public void delayedJoin(Player player) User user = ess.getUser(onlinePlayer); if (user.isAuthorized("essentials.geoip.show")) { - user.sendMessage(_("geoipJoinFormat", u.getDisplayName(), sb.toString())); + user.sendMessage(tl("geoipJoinFormat", u.getDisplayName(), sb.toString())); } } } @@ -123,7 +123,7 @@ public final void reloadConfig() } else { - logger.log(Level.SEVERE, _("cantFindGeoIpDB")); + logger.log(Level.SEVERE, tl("cantFindGeoIpDB")); return; } } @@ -133,7 +133,7 @@ public final void reloadConfig() } catch (IOException ex) { - logger.log(Level.SEVERE, _("cantReadGeoIpDB"), ex); + logger.log(Level.SEVERE, tl("cantReadGeoIpDB"), ex); } } @@ -152,10 +152,10 @@ private void downloadDatabase() } if (url == null || url.isEmpty()) { - logger.log(Level.SEVERE, _("geoIpUrlEmpty")); + logger.log(Level.SEVERE, tl("geoIpUrlEmpty")); return; } - logger.log(Level.INFO, _("downloadingGeoIp")); + logger.log(Level.INFO, tl("downloadingGeoIp")); URL downloadUrl = new URL(url); URLConnection conn = downloadUrl.openConnection(); conn.setConnectTimeout(10000); @@ -178,12 +178,12 @@ private void downloadDatabase() } catch (MalformedURLException ex) { - logger.log(Level.SEVERE, _("geoIpUrlInvalid"), ex); + logger.log(Level.SEVERE, tl("geoIpUrlInvalid"), ex); return; } catch (IOException ex) { - logger.log(Level.SEVERE, _("connectionFailed"), ex); + logger.log(Level.SEVERE, tl("connectionFailed"), ex); } } } diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java index 2c87ce3320..58290a8b84 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsConnect.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.protect; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.IConf; import net.ess3.api.IEssentials; import java.util.logging.Level; @@ -18,7 +18,7 @@ public EssentialsConnect(Plugin essPlugin, Plugin essProtect) { if (!essProtect.getDescription().getVersion().equals(essPlugin.getDescription().getVersion())) { - LOGGER.log(Level.WARNING, _("versionMismatchAll")); + LOGGER.log(Level.WARNING, tl("versionMismatchAll")); } ess = (IEssentials)essPlugin; protect = (IProtect)essProtect; diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandsetspawn.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandsetspawn.java index c6c89a20da..15d2ca2ab2 100644 --- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandsetspawn.java +++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandsetspawn.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.spawn; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.User; import com.earth2me.essentials.commands.EssentialsCommand; import org.bukkit.Server; @@ -18,6 +18,6 @@ public void run(final Server server, final User user, final String commandLabel, { final String group = args.length > 0 ? getFinalArg(args, 0) : "default"; ((SpawnStorage)module).setSpawn(user.getLocation(), group); - user.sendMessage(_("spawnSet", group)); + user.sendMessage(tl("spawnSet", group)); } } diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java index cccce4284f..34a4eb6bd4 100644 --- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java +++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.spawn; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.Console; import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; @@ -31,7 +31,7 @@ public void run(final Server server, final User user, final String commandLabel, respawn(user.getSource(), user, otherUser, charge); if (!otherUser.equals(user)) { - otherUser.sendMessage(_("teleportAtoB", user.getDisplayName(), "spawn")); + otherUser.sendMessage(tl("teleportAtoB", user.getDisplayName(), "spawn")); } } else @@ -50,7 +50,7 @@ protected void run(final Server server, final CommandSource sender, final String } final User user = getPlayer(server, args, 0, true, false); respawn(sender, null, user, null); - user.sendMessage(_("teleportAtoB", Console.NAME, "spawn")); + user.sendMessage(tl("teleportAtoB", Console.NAME, "spawn")); } @@ -58,7 +58,7 @@ private void respawn(final CommandSource sender, final User teleportOwner, final { final SpawnStorage spawns = (SpawnStorage)this.module; final Location spawn = spawns.getSpawn(teleportee.getGroup()); - sender.sendMessage(_("teleporting", spawn.getWorld().getName(), spawn.getBlockX(), spawn.getBlockY(), spawn.getBlockZ())); + sender.sendMessage(tl("teleporting", spawn.getWorld().getName(), spawn.getBlockX(), spawn.getBlockY(), spawn.getBlockZ())); if (teleportOwner == null) { teleportee.getTeleport().now(spawn, false, TeleportCause.COMMAND); diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawn.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawn.java index a22615550b..d076373038 100644 --- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawn.java +++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawn.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.spawn; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import net.ess3.api.IEssentials; import java.util.logging.Level; import java.util.logging.Logger; @@ -31,7 +31,7 @@ public void onEnable() ess = (IEssentials)pluginManager.getPlugin("Essentials"); if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion())) { - LOGGER.log(Level.WARNING, _("versionMismatchAll")); + LOGGER.log(Level.WARNING, tl("versionMismatchAll")); } if (!ess.isEnabled()) { diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java index b1732f5788..e5611b4946 100644 --- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java +++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.spawn; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.Kit; import com.earth2me.essentials.OfflinePlayer; import com.earth2me.essentials.User; @@ -165,7 +165,7 @@ public void run() } catch (Exception ex) { - Bukkit.getLogger().log(Level.WARNING, _("teleportNewPlayerError"), ex); + Bukkit.getLogger().log(Level.WARNING, tl("teleportNewPlayerError"), ex); } } } diff --git a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java index c2dece3906..ab7cf986cf 100644 --- a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java +++ b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/EssentialsXMPP.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.xmpp; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; import com.earth2me.essentials.IEssentials; import net.ess3.api.IUser; import java.util.List; @@ -36,7 +36,7 @@ public void onEnable() ess = (IEssentials)pluginManager.getPlugin("Essentials"); if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion())) { - LOGGER.log(Level.WARNING, _("versionMismatchAll")); + LOGGER.log(Level.WARNING, tl("versionMismatchAll")); } if (!ess.isEnabled()) {