diff options
author | FearFree <fearfree@cubetown.net> | 2014-03-20 10:54:07 -0500 |
---|---|---|
committer | Chris Ward <chris@chrisgward.com> | 2014-03-22 16:08:11 +1100 |
commit | 51bd0d88f393dbd675d2227e84d24fe9d6313712 (patch) | |
tree | 3f1b11f2eed0ed31c63e7a82cb666c3082f2df95 | |
parent | 726690817781c43b2bdeaf9212cc7c7d23c2c8ff (diff) | |
download | Essentials-51bd0d88f393dbd675d2227e84d24fe9d6313712.tar Essentials-51bd0d88f393dbd675d2227e84d24fe9d6313712.tar.gz Essentials-51bd0d88f393dbd675d2227e84d24fe9d6313712.tar.lz Essentials-51bd0d88f393dbd675d2227e84d24fe9d6313712.tar.xz Essentials-51bd0d88f393dbd675d2227e84d24fe9d6313712.zip |
Future Java versions may not support _ as identifier.
176 files changed, 1032 insertions, 1028 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Backup.java b/Essentials/src/com/earth2me/essentials/Backup.java index 3c6621864..aa8334310 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 class Backup implements Runnable 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 class Backup implements Runnable 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 36c36c602..f942b2998 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.BlockCommandSender; 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<String> vanishedPlayers = new ArrayList<String>(); + private final transient List<String> vanishedPlayers = new ArrayList<String>(); public Essentials() { @@ -131,7 +129,7 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials } 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 class Essentials extends JavaPlugin implements net.ess3.api.IEssentials && !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 class Essentials extends JavaPlugin implements net.ess3.api.IEssentials } 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 class Essentials extends JavaPlugin implements net.ess3.api.IEssentials { 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 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials 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 class Essentials extends JavaPlugin implements net.ess3.api.IEssentials if (user.isVanished()) { user.setVanished(false); - user.sendMessage(_("unvanishedReload")); + user.sendMessage(tl("unvanishedReload")); } } cleanupOpenInventories(); @@ -441,7 +439,7 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials final List<String> mail = user.getMails(); if (mail != null && !mail.isEmpty()) { - user.sendMessage(_("youHaveNewMail", mail.size())); + user.sendMessage(tl("youHaveNewMail", mail.size())); } } @@ -467,16 +465,16 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials } 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 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials { 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 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials } 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 class Essentials extends JavaPlugin implements net.ess3.api.IEssentials @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 class Essentials extends JavaPlugin implements net.ess3.api.IEssentials { 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 4faecf4a5..7fdf3baf4 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 class EssentialsConf extends YamlConfiguration { 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 class EssentialsConf extends YamlConfiguration { if (templateName != null) { - LOGGER.log(Level.INFO, _("creatingConfigFromTemplate", configFile.toString())); + LOGGER.log(Level.INFO, tl("creatingConfigFromTemplate", configFile.toString())); createFromTemplate(); } else @@ -189,7 +189,7 @@ public class EssentialsConf extends YamlConfiguration 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 @@ public class EssentialsConf extends YamlConfiguration } 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 @@ public class EssentialsConf extends YamlConfiguration } 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 class EssentialsConf extends YamlConfiguration { 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 db6efb62d..649dca27c 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 class EssentialsEntityListener implements Listener 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 b6743a59f..e82ef0cf0 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 class EssentialsPlayerListener implements Listener 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 @@ public class EssentialsPlayerListener implements Listener final List<String> mail = user.getMails(); if (mail.isEmpty()) { - user.sendMessage(_("noNewMail")); + user.sendMessage(tl("noNewMail")); } else { - user.sendMessage(_("youHaveNewMail", mail.size())); + user.sendMessage(tl("youHaveNewMail", mail.size())); } } @@ -310,7 +310,7 @@ public class EssentialsPlayerListener implements Listener { 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 class EssentialsPlayerListener implements Listener 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 class EssentialsPlayerListener implements Listener 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 class EssentialsPlayerListener implements Listener 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 class EssentialsPlayerListener implements Listener 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 68cb4ec48..fe3f5129d 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 @@ public class EssentialsUpgrade } catch (Exception e) { - LOGGER.log(Level.SEVERE, _("upgradingFilesError"), e); + LOGGER.log(Level.SEVERE, tl("upgradingFilesError"), e); } } @@ -117,7 +117,7 @@ public class EssentialsUpgrade } catch (IOException e) { - LOGGER.log(Level.SEVERE, _("upgradingFilesError"), e); + LOGGER.log(Level.SEVERE, tl("upgradingFilesError"), e); } } @@ -167,11 +167,11 @@ public class EssentialsUpgrade { 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 @@ public class EssentialsUpgrade 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 @@ public class EssentialsUpgrade 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 @@ public class EssentialsUpgrade 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 @@ public class EssentialsUpgrade } 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 @@ public class EssentialsUpgrade } 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 f4f03a795..3857c541b 100644 --- a/Essentials/src/com/earth2me/essentials/I18n.java +++ b/Essentials/src/com/earth2me/essentials/I18n.java @@ -71,7 +71,7 @@ public class I18n implements net.ess3.api.II18n } } - 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 8ab7d8616..508ba903a 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 @@ public class ItemDb implements IConf, net.ess3.api.IItemDb } 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 @@ public class ItemDb implements IConf, net.ess3.api.IItemDb 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 303de169c..0555f442b 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 class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.sett 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 class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.sett { 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 class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.sett { 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 class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.sett { 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 21a948784..994a2d594 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 @@ public class Kit 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<String, Object> 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 @@ public class Kit } catch (Exception ex) { - throw new Exception(_("kitError"), ex); + throw new Exception(tl("kitError"), ex); } } @@ -73,12 +73,12 @@ public class Kit } else if (nextUse < 0L) { - user.sendMessage(_("kitOnce")); + user.sendMessage(tl("kitOnce")); throw new NoChargeException(); } else { - user.sendMessage(_("kitTimed", DateUtil.formatDateDiff(nextUse))); + user.sendMessage(tl("kitTimed", DateUtil.formatDateDiff(nextUse))); throw new NoChargeException(); } } @@ -100,7 +100,7 @@ public class Kit } catch (Exception e) { - throw new Exception(_("kitError2")); + throw new Exception(tl("kitError2")); } // When was the last kit used? @@ -138,7 +138,7 @@ public class Kit { if (kit == null) { - throw new Exception(_("kitNotFound")); + throw new Exception(tl("kitNotFound")); } try { @@ -162,7 +162,7 @@ public class Kit 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 class Kit 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 84daefdef..3fa46d5c3 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 class ManagedFile } 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 7c6634115..164624319 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 class MetaItemStack } catch (NoSuchMethodError nsme) { - throw new Exception(_("noMetaJson"), nsme); + throw new Exception(tl("noMetaJson"), nsme); } catch (Throwable throwable) { @@ -122,14 +122,14 @@ public class MetaItemStack { 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 @@ public class MetaItemStack } 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 @@ public class MetaItemStack } else { - throw new Exception(_("leatherSyntax")); + throw new Exception(tl("leatherSyntax")); } } else @@ -260,14 +260,14 @@ public class MetaItemStack { 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 class MetaItemStack } 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 @@ public class MetaItemStack } 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 @@ public class MetaItemStack } 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 @@ public class MetaItemStack } else { - throw new Exception(_("invalidFireworkFormat", split[1], split[0])); + throw new Exception(tl("invalidFireworkFormat", split[1], split[0])); } } } @@ -370,12 +370,12 @@ public class MetaItemStack } 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 @@ public class MetaItemStack } 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 @@ public class MetaItemStack } else { - throw new Exception(_("invalidPotionMeta", split[1])); + throw new Exception(tl("invalidPotionMeta", split[1])); } } @@ -413,7 +413,7 @@ public class MetaItemStack 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 class MetaItemStack { if (enchantment == null) { - throw new Exception(_("enchantmentNotFound")); + throw new Exception(tl("enchantmentNotFound")); } try { @@ -508,7 +508,7 @@ public class MetaItemStack if (!hasMetaPermission(user, "enchantments." + enchantmentName, true, false)) { - throw new Exception(_("enchantmentPerm", enchantmentName)); + throw new Exception(tl("enchantmentPerm", enchantmentName)); } return enchantment; } @@ -533,7 +533,7 @@ public class MetaItemStack } 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 2c3201aad..712f5cc0f 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 enum Mob final Entity entity = world.spawn(loc, (Class<? extends Entity>)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 1e2877880..40e23f579 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 @@ public enum MobData } 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 @@ public enum MobData } 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 @@ public enum MobData } 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 788437c28..de183e5f0 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 class OfflinePlayer implements Player @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 class OfflinePlayer implements Player @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<Block> getLineOfSight(HashSet<Byte> hs, int i) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public Block getTargetBlock(HashSet<Byte> hs, int i) { - throw new UnsupportedOperationException(_("notSupportedYet")); + throw new UnsupportedOperationException(tl("notSupportedYet")); } @Override public List<Block> getLastTwoTargetBlocks(HashSet<Byte> 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 class OfflinePlayer implements Player 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<Entity> 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 class OfflinePlayer implements Player @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 ef986a68a..2ea820adf 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 class PlayerList 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 class PlayerList 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 class PlayerList } if (users == null || users.isEmpty()) { - throw new Exception(_("groupDoesNotExist")); + throw new Exception(tl("groupDoesNotExist")); } final StringBuilder displayGroupName = new StringBuilder(); displayGroupName.append(Character.toTitleCase(groupName.charAt(0))); @@ -144,7 +144,7 @@ public class PlayerList public static String outputFormat(final String group, final String message) { final StringBuilder outputString = new StringBuilder(); - outputString.append(_("listGroupTag", FormatUtil.replaceFormat(group))); + outputString.append(tl("listGroupTag", FormatUtil.replaceFormat(group))); outputString.append(message); return outputString.toString(); } diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index ebeb2a12c..0bc4dba7f 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.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.signs.EssentialsSign; import com.earth2me.essentials.signs.Signs; @@ -570,7 +570,7 @@ public class Settings implements net.ess3.api.ISettings } 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 @@ public class Settings implements net.ess3.api.ISettings } 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 class Settings implements net.ess3.api.ISettings } 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 cfd0c5cec..edf9b4fc5 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 class SpawnMob } if (availableList.isEmpty()) { - availableList.add(_("none")); + availableList.add(tl("none")); } return StringUtil.joinList(availableList); } @@ -88,7 +88,7 @@ public class SpawnMob 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 class SpawnMob 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 class SpawnMob { 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 @@ public class SpawnMob { 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 @@ public class SpawnMob 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 4812296bd..c17181dd8 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 @@ public class Teleport implements net.ess3.api.ITeleport 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 @@ public class Teleport implements net.ess3.api.ITeleport 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 class Teleport implements net.ess3.api.ITeleport } 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 @@ public class Teleport implements net.ess3.api.ITeleport } 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 class Teleport implements net.ess3.api.ITeleport { 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 class Teleport implements net.ess3.api.ITeleport { 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 @@ public class Teleport implements net.ess3.api.ITeleport 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 class Teleport implements net.ess3.api.ITeleport 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 1b972c17c..5775cb609 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 class TimedTeleport implements Runnable } 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")); timer_chargeFor.isAffordableFor(teleportOwner); if (timer_respawn) { @@ -144,10 +142,10 @@ public class TimedTeleport implements Runnable 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 dbdc430e4..e7426b4c4 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 class Trade && 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 @@ public class Trade && (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 class Trade } if (!user.canAfford(getMoney()) && getMoney().signum() > 0) { - throw new ChargeException(_("notEnoughMoney")); + throw new ChargeException(tl("notEnoughMoney")); } user.takeMoney(getMoney()); } @@ -235,7 +235,7 @@ public class Trade } 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 class Trade 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 class Trade 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 f1a564d1a..1b2a8fc6a 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.AfkStatusChangeEvent; 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 class User extends UserData implements Comparable<User>, IReplyTo, net.es 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 class User extends UserData implements Comparable<User>, IReplyTo, net.es 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 class User extends UserData implements Comparable<User>, IReplyTo, net.es { 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 class User extends UserData implements Comparable<User>, IReplyTo, net.es { //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 class User extends UserData implements Comparable<User>, IReplyTo, net.es { setJailTimeout(0); setJailed(false); - sendMessage(_("haveBeenReleased")); + sendMessage(tl("haveBeenReleased")); setJail(null); try { @@ -563,7 +562,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, net.es if (getMuteTimeout() > 0 && getMuteTimeout() < currentTime && isMuted()) { setMuteTimeout(0); - sendMessage(_("canTalkAgain")); + sendMessage(tl("canTalkAgain")); setMuted(false); return true; } @@ -590,7 +589,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, net.es 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 class User extends UserData implements Comparable<User>, IReplyTo, net.es 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 class User extends UserData implements Comparable<User>, IReplyTo, net.es 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 class User extends UserData implements Comparable<User>, IReplyTo, net.es 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 73f2771eb..20734b461 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 abstract class UserData extends PlayerExtension implements IConf } 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 b993311c2..3e0f93a55 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 class Warps implements IConf, net.ess3.api.IWarps 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 class Warps implements IConf, net.ess3.api.IWarps } catch (IOException ex) { - throw new IOException(_("invalidWarpName")); + throw new IOException(tl("invalidWarpName")); } } @@ -94,11 +94,11 @@ public class Warps implements IConf, net.ess3.api.IWarps 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 class Warps implements IConf, net.ess3.api.IWarps } 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 9c50e2ae4..fff2c992c 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 class Worth implements IConf { 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 class Worth implements IConf if (requireStack && !stack) { - throw new Exception(_("itemMustBeStacked")); + throw new Exception(tl("itemMustBeStacked")); } int max = 0; @@ -141,9 +141,9 @@ public class Worth implements IConf { 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 1ae89e868..13f8e3559 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 @@ public class Economy { 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 03fe986d4..e5b87464c 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 531d9ead6..fd51c04e8 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 e14b02a80..0052677b5 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 @@ public class Commandafk extends EssentialsCommand //user.sendMessage(_("markedAsNotAway")); if (!user.isHidden()) { - msg = _("userIsNotAway", user.getDisplayName()); + msg = tl("userIsNotAway", user.getDisplayName()); } user.updateActivity(false); } @@ -59,7 +59,7 @@ public class Commandafk extends EssentialsCommand //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 ebe305f93..5db82d048 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 @@ public class Commandback extends EssentialsCommand { 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 4da00e26e..a384cb6bd 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbackup.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbackup.java @@ -2,7 +2,7 @@ package com.earth2me.essentials.commands; 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 @@ public class Commandbackup extends EssentialsCommand 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 8db3d6816..5015c3574 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 @@ public class Commandbalance extends EssentialsCommand } 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 class Commandbalance extends EssentialsCommand { 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 18371df62..29f32f8e8 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.*; 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 @@ public class Commandbalancetop extends EssentialsCommand } if (ess.getUserMap().getUniqueUsers() > MINUSERS) { - sender.sendMessage(_("orderBalances", ess.getUserMap().getUniqueUsers())); + sender.sendMessage(tl("orderBalances", ess.getUserMap().getUniqueUsers())); } } finally @@ -72,7 +71,7 @@ public class Commandbalancetop extends EssentialsCommand { 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 @@ public class Commandbalancetop extends EssentialsCommand 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 class Commandbalancetop extends EssentialsCommand } }); - cache.getLines().add(_("serverTotal", NumberUtil.displayCurrency(totalMoney, ess))); + cache.getLines().add(tl("serverTotal", NumberUtil.displayCurrency(totalMoney, ess))); int pos = 1; for (Map.Entry<String, BigDecimal> entry : sortedEntries) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandban.java b/Essentials/src/com/earth2me/essentials/commands/Commandban.java index 4286ae19f..3a2b0267c 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandban.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandban.java @@ -2,7 +2,7 @@ package com.earth2me.essentials.commands; 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 class Commandban extends EssentialsCommand { 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 class Commandban extends EssentialsCommand } 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 9246f89ad..3dea97ceb 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java @@ -2,7 +2,7 @@ package com.earth2me.essentials.commands; 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 class Commandbanip extends EssentialsCommand } 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 3d46eeaef..ed5b7957e 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 @@ public class Commandbigtree extends EssentialsCommand 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 afa57d186..f2cb79bd2 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 class Commandbook extends EssentialsCommand { 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 @@ public class Commandbook extends EssentialsCommand { 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 @@ public class Commandbook extends EssentialsCommand 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 @@ public class Commandbook extends EssentialsCommand 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 af11f597d..92ccd9dc4 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 class Commandbreak extends EssentialsCommand } if (block.getType() == Material.BEDROCK && !user.isAuthorized("essentials.break.bedrock")) { - throw new Exception(_("noBreakBedrock")); + throw new Exception(tl("noBreakBedrock")); } //final List<ItemStack> list = (List<ItemStack>)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 a97ed54c9..2b692b78b 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 @@ public class Commandbroadcast extends EssentialsCommand 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 019768750..b0ae498de 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 @@ public class Commandburn extends EssentialsCommand 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 d48f60543..d403b0e0d 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 @@ public class Commandclearinventory extends EssentialsCommand 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 @@ public class Commandclearinventory extends EssentialsCommand { if (showExtended) { - sender.sendMessage(_("inventoryClearingAllItems", player.getDisplayName())); + sender.sendMessage(tl("inventoryClearingAllItems", player.getDisplayName())); } player.getInventory().clear(); } @@ -111,7 +111,7 @@ public class Commandclearinventory extends EssentialsCommand { if (showExtended) { - sender.sendMessage(_("inventoryClearingAllArmor", player.getDisplayName())); + sender.sendMessage(tl("inventoryClearingAllArmor", player.getDisplayName())); } player.getInventory().clear(); player.getInventory().setArmorContents(null); @@ -123,7 +123,7 @@ public class Commandclearinventory extends EssentialsCommand 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 @@ public class Commandclearinventory extends EssentialsCommand 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 @@ public class Commandclearinventory extends EssentialsCommand 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 25f8c34f6..53dce03d1 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 @@ public class Commandcompass extends EssentialsCommand { 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 555bcd4a2..8459700a5 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 @@ public class Commanddelhome extends EssentialsCommand 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 17e0411ad..7b5937a09 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 @@ public class Commanddeljail extends EssentialsCommand } 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 754f62118..4fbf5f91c 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 class Commanddelwarp extends EssentialsCommand } 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 6c4fa2647..b7d56b6a1 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 class Commanddepth extends EssentialsCommand 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 dac835655..5efe54818 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandeco.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandeco.java @@ -2,13 +2,11 @@ package com.earth2me.essentials.commands; 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 class Commandeco extends EssentialsLoopCommand { 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 @@ public class Commandeco extends EssentialsLoopCommand { // 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 @@ public class Commandeco extends EssentialsLoopCommand 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 d26833041..1a41147b7 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 @@ public class Commandenchant extends EssentialsCommand 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 @@ public class Commandenchant extends EssentialsCommand //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 @@ public class Commandenchant extends EssentialsCommand 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 96bd4b094..9b6242fab 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 @@ public class Commandessentials extends EssentialsCommand } if (disabledCommands.length() > 0) { - sender.sendMessage(_("blockList")); + sender.sendMessage(tl("blockList")); sender.sendMessage(disabledCommands.toString()); } } @@ -104,7 +104,7 @@ public class Commandessentials extends EssentialsCommand 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 @@ public class Commandessentials extends EssentialsCommand sender.sendMessage("Unless you define larger default values, this command wil ignore people who have more than 0 money/homes/bans."); throw new Exception("/<command> cleanup <days> [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 class Commandessentials extends EssentialsCommand 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 2f301fb34..86a11f7d4 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 @@ public class Commandexp extends EssentialsCommand 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 @@ public class Commandexp extends EssentialsCommand 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 06e09aba7..8cba548ad 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 class Commandext extends EssentialsLoopCommand if (args.length < 1) { extPlayer(user.getBase()); - user.sendMessage(_("extinguish")); + user.sendMessage(tl("extinguish")); return; } @@ -42,7 +42,7 @@ public class Commandext extends EssentialsLoopCommand 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 85c414b62..545475ed3 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 @@ public class Commandfeed extends EssentialsLoopCommand } feedPlayer(user.getBase()); - user.sendMessage(_("feed")); + user.sendMessage(tl("feed")); } @Override @@ -50,7 +50,7 @@ public class Commandfeed extends EssentialsLoopCommand 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 ecf0561e1..3206d931c 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 @@ public class Commandfirework extends EssentialsCommand 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 @@ public class Commandfirework extends EssentialsCommand } 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 @@ public class Commandfirework extends EssentialsCommand if (amount > serverLimit) { amount = serverLimit; - user.sendMessage(_("mobSpawnLimit")); + user.sendMessage(tl("mobSpawnLimit")); } } else @@ -117,7 +117,7 @@ public class Commandfirework extends EssentialsCommand } catch (Exception e) { - user.sendMessage(_("fireworkSyntax")); + user.sendMessage(tl("fireworkSyntax")); throw e; } } @@ -128,15 +128,15 @@ public class Commandfirework extends EssentialsCommand 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 @@ public class Commandfirework extends EssentialsCommand } 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 dcd1d5187..3628884b1 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 @@ public class Commandfly extends EssentialsToggleCommand 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 8c5c36aac..f5ce82b95 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 @@ public class Commandgamemode extends EssentialsCommand 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 @@ public class Commandgamemode extends EssentialsCommand } 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 0faf037e5..42931feff 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 @@ public class Commandgc extends EssentialsCommand 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<World> worlds = server.getWorlds(); for (World w : worlds) @@ -63,7 +63,7 @@ public class Commandgc extends EssentialsCommand 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 0a9959461..f76d28e03 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 @@ public class Commandgetpos extends EssentialsCommand 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 8c1d57a48..1f4f66b72 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 class Commandgive extends EssentialsCommand : (!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 @@ public class Commandgive extends EssentialsCommand 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<Integer, ItemStack> leftovers; @@ -109,7 +109,7 @@ public class Commandgive extends EssentialsCommand 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 44d930cc7..2fb647cc2 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 @@ public class Commandgod extends EssentialsToggleCommand 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 0b28ef1e3..9919ffbe7 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 @@ public class Commandhat extends EssentialsCommand 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 @@ public class Commandhat extends EssentialsCommand 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 58679604d..6890af09f 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 @@ public class Commandheal extends EssentialsLoopCommand try { healPlayer(player); - sender.sendMessage(_("healOther", player.getDisplayName())); + sender.sendMessage(tl("healOther", player.getDisplayName())); } catch (QuietAbortException e) { @@ -65,7 +65,7 @@ public class Commandheal extends EssentialsLoopCommand if (player.getHealth() == 0) { - throw new PlayerExemptException(_("healDead")); + throw new PlayerExemptException(tl("healDead")); } final double amount = player.getMaxHealth() - player.getHealth(); @@ -85,7 +85,7 @@ public class Commandheal extends EssentialsLoopCommand 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 03cd37374..87e2c5b15 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 @@ public class Commandhelp extends EssentialsCommand @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 7f4647de5..945f7c688 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandhelpop.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandhelpop.java @@ -2,7 +2,7 @@ package com.earth2me.essentials.commands; 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 @@ public class Commandhelpop extends EssentialsCommand { 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 a030cb4cf..f06f22b95 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 class Commandhome extends EssentialsCommand } else { - throw new Exception(_("bedMissing")); + throw new Exception(tl("bedMissing")); } } goHome(user, player, homeName.toLowerCase(Locale.ENGLISH), charge); @@ -69,7 +69,7 @@ public class Commandhome extends EssentialsCommand } 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 @@ public class Commandhome extends EssentialsCommand { 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 @@ public class Commandhome extends EssentialsCommand 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 250ecf6b7..c5bc21d46 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 @@ public class Commandignore extends EssentialsCommand 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 @@ public class Commandignore extends EssentialsCommand 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 09715dff1..ef5756ec4 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 class Commanditem extends EssentialsCommand : (!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 @@ public class Commanditem extends EssentialsCommand 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 a07b10459..02ea1c637 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 @@ public class Commanditemdb extends EssentialsCommand { 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 @@ public class Commanditemdb extends EssentialsCommand 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 e9e60bdce..228df82b0 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 class Commandjump extends EssentialsCommand } 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 316b50300..30d7d9d8d 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkick.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkick.java @@ -2,7 +2,7 @@ package com.earth2me.essentials.commands; 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 class Commandkick extends EssentialsCommand 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 48833b1de..ba885731a 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 class Commandkickall extends EssentialsCommand @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 class Commandkickall extends EssentialsCommand 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 2de3d1750..6c4062371 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 @@ public class Commandkill extends EssentialsLoopCommand 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 @@ public class Commandkill extends EssentialsLoopCommand 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 d7f4c2a93..aeb9a713f 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 class Commandkit extends EssentialsCommand 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 class Commandkit extends EssentialsCommand 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 class Commandkit extends EssentialsCommand final List<String> 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 @@ public class Commandkit extends EssentialsCommand { if (kitName.isEmpty()) { - throw new Exception(_("kitError2")); + throw new Exception(tl("kitError2")); } final Map<String, Object> 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<String> items = Kit.getItems(ess, userTo, kitName, kit); @@ -87,7 +87,7 @@ public class Commandkit extends EssentialsCommand 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 12cff3f1a..a3f7e10a4 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 class Commandlightning extends EssentialsLoopCommand @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 @@ public class Commandlightning extends EssentialsLoopCommand } 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 0e3620a34..46d8dd95a 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 @@ public class Commandlist extends EssentialsCommand int limit = Integer.parseInt(groupValue); if (matchedList.size() > 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 @@ public class Commandlist extends EssentialsCommand if (ess.getPermissionsHandler().getName().equals("ConfigPermissions")) { - groupName = _("connectedPlayers"); + groupName = tl("connectedPlayers"); } if (users == null || users.isEmpty()) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmail.java b/Essentials/src/com/earth2me/essentials/commands/Commandmail.java index b9f9a7b69..611e2e897 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandmail.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandmail.java @@ -8,7 +8,7 @@ import org.bukkit.Server; import java.util.List; -import static com.earth2me.essentials.I18n._; +import static com.earth2me.essentials.I18n.tl; public class Commandmail extends EssentialsCommand @@ -30,39 +30,39 @@ public class Commandmail extends EssentialsCommand final List<String> 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 class Commandmail extends EssentialsCommand 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 @@ public class Commandmail extends EssentialsCommand { 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 @@ public class Commandmail extends EssentialsCommand 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 382bbf06a..6dadd0a9c 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 class Commandme extends EssentialsCommand { if (user.isMuted()) { - throw new Exception(_("voiceSilenced")); + throw new Exception(tl("voiceSilenced")); } if (args.length < 1) @@ -31,7 +31,7 @@ public class Commandme extends EssentialsCommand 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 class Commandme extends EssentialsCommand 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 e50e21e45..61e951e1e 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 class Commandmore extends EssentialsCommand 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 class Commandmore extends EssentialsCommand : (!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 f6d6bf45f..642742730 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java @@ -2,7 +2,7 @@ package com.earth2me.essentials.commands; 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 @@ import org.bukkit.command.CommandSender; public class Commandmsg extends EssentialsLoopCommand { - final String translatedMe = _("me"); + final String translatedMe = tl("me"); public Commandmsg() { @@ -35,7 +35,7 @@ public class Commandmsg extends EssentialsLoopCommand 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 class Commandmsg extends EssentialsLoopCommand 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 @@ public class Commandmsg extends EssentialsLoopCommand 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 0da22d7e4..e27c97ead 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 class Commandmute extends EssentialsCommand { 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 class Commandmute extends EssentialsCommand 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 8cec4dd66..846534baf 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 @@ public class Commandnear extends EssentialsCommand if (radius > maxRadius && !user.isAuthorized("essentials.near.maxexempt")) { - user.sendMessage(_("radiusTooBig", maxRadius)); + user.sendMessage(tl("radiusTooBig", maxRadius)); radius = maxRadius; } @@ -70,7 +70,7 @@ public class Commandnear extends EssentialsCommand { otherUser = user; } - user.sendMessage(_("nearbyPlayers", getLocal(server, otherUser, radius))); + user.sendMessage(tl("nearbyPlayers", getLocal(server, otherUser, radius))); } @Override @@ -92,7 +92,7 @@ public class Commandnear extends EssentialsCommand { } } - 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 @@ public class Commandnear extends EssentialsCommand } } } - 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 dc27ca557..45fe4ce7e 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 class Commandnick extends EssentialsLoopCommand } 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 class Commandnick extends EssentialsLoopCommand } 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 @@ public class Commandnick extends EssentialsLoopCommand 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 @@ public class Commandnick extends EssentialsLoopCommand 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 173e28b5c..7e6e347c3 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 @@ public class Commandnuke extends EssentialsCommand { 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 51c2d1983..01492faed 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandpay.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandpay.java @@ -2,7 +2,7 @@ package com.earth2me.essentials.commands; 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 @@ public class Commandpay extends EssentialsLoopCommand } 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 0597ae6e5..1535ad6a2 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 class Commandping extends EssentialsCommand 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 73a6157b9..b7dbd4dfa 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 @@ public class Commandpotion extends EssentialsCommand 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 @@ public class Commandpotion extends EssentialsCommand } else { - user.sendMessage(_("invalidPotion")); + user.sendMessage(tl("invalidPotion")); throw new NotEnoughArgumentsException(); } } @@ -87,7 +87,7 @@ public class Commandpotion extends EssentialsCommand } 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 582a8fe99..65bb73320 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 @@ public class Commandpowertool extends EssentialsCommand 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 @@ public class Commandpowertool extends EssentialsCommand { 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 @@ public class Commandpowertool extends EssentialsCommand 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 @@ public class Commandpowertool extends EssentialsCommand { 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 @@ public class Commandpowertool extends EssentialsCommand } powertools.add(command); - sender.sendMessage(_("powerToolAttach", StringUtil.joinList(powertools), itemName)); + sender.sendMessage(tl("powerToolAttach", StringUtil.joinList(powertools), itemName)); } } else @@ -117,13 +117,13 @@ public class Commandpowertool extends EssentialsCommand { 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 c8b737dfa..a71f3887d 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 @@ public class Commandpowertooltoggle extends EssentialsCommand { 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 5cca2f6f5..077cdef93 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 class Commandptime extends EssentialsCommand 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 @@ public class Commandptime extends EssentialsCommand { 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 @@ public class Commandptime extends EssentialsCommand // 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 0c067b682..79969a0cd 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 class Commandpweather extends EssentialsCommand 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 @@ public class Commandpweather extends EssentialsCommand { 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 @@ public class Commandpweather extends EssentialsCommand 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 a9073a9eb..b79d10f1e 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandr.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandr.java @@ -2,7 +2,7 @@ package com.earth2me.essentials.commands; 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 class Commandr extends EssentialsCommand 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 class Commandr extends EssentialsCommand 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 6a4f600cc..7a83641fc 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 @@ public class Commandrealname extends EssentialsCommand 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 565067a5e..01289a0e9 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 class Commandrecipe extends EssentialsCommand }
else
{
- throw new Exception(_("invalidNumber"));
+ throw new Exception(tl("invalidNumber"));
}
}
final List<Recipe> 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 @@ public class Commandrecipe extends EssentialsCommand 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 class Commandrecipe extends EssentialsCommand 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 class Commandrecipe extends EssentialsCommand }
s.append(" ");
}
- sender.sendMessage(_("recipeShapeless", s.toString()));
+ sender.sendMessage(tl("recipeShapeless", s.toString()));
}
}
@@ -175,7 +175,7 @@ public class Commandrecipe extends EssentialsCommand {
if (stack == null)
{
- return _("recipeNothing");
+ return tl("recipeNothing");
}
return getMaterialName(stack.getType());
}
@@ -184,7 +184,7 @@ public class Commandrecipe extends EssentialsCommand {
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 9fa946260..f8dcc5401 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 @@ public class Commandremove extends EssentialsCommand if (world == null) { - throw new Exception(_("invalidWorld")); + throw new Exception(tl("invalidWorld")); } if (args[0].contentEquals("*") || args[0].contentEquals("all")) @@ -136,7 +136,7 @@ public class Commandremove extends EssentialsCommand if (warnUser) { - sender.sendMessage(_("invalidMob")); + sender.sendMessage(tl("invalidMob")); } for (Chunk chunk : world.getLoadedChunks()) @@ -283,7 +283,7 @@ public class Commandremove extends EssentialsCommand } } } - sender.sendMessage(_("removed", removed)); + sender.sendMessage(tl("removed", removed)); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandrepair.java b/Essentials/src/com/earth2me/essentials/commands/Commandrepair.java index df5310915..91bbaa9d8 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandrepair.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandrepair.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.StringUtil; import java.util.ArrayList; import java.util.List; @@ -44,14 +44,14 @@ public class Commandrepair extends EssentialsCommand final ItemStack item = user.getItemInHand(); if (item == null || item.getType().isBlock() || item.getDurability() == 0) { - throw new Exception(_("repairInvalidType")); + throw new Exception(tl("repairInvalidType")); } if (!item.getEnchantments().isEmpty() && !ess.getSettings().getRepairEnchanted() && !user.isAuthorized("essentials.repair.enchanted")) { - throw new Exception(_("repairEnchanted")); + throw new Exception(tl("repairEnchanted")); } final String itemName = item.getType().toString().toLowerCase(Locale.ENGLISH); @@ -63,7 +63,7 @@ public class Commandrepair extends EssentialsCommand charge.charge(user); user.updateInventory(); - user.sendMessage(_("repair", itemName.replace('_', ' '))); + user.sendMessage(tl("repair", itemName.replace('_', ' '))); } public void repairAll(User user) throws Exception @@ -79,11 +79,11 @@ public class Commandrepair extends EssentialsCommand user.updateInventory(); if (repaired.isEmpty()) { - throw new Exception(_("repairNone")); + throw new Exception(tl("repairNone")); } else { - user.sendMessage(_("repair", StringUtil.joinList(repaired))); + user.sendMessage(tl("repair", StringUtil.joinList(repaired))); } } @@ -92,12 +92,12 @@ public class Commandrepair extends EssentialsCommand final Material material = Material.getMaterial(item.getTypeId()); if (material.isBlock() || material.getMaxDurability() < 1) { - throw new Exception(_("repairInvalidType")); + throw new Exception(tl("repairInvalidType")); } if (item.getDurability() == 0) { - throw new Exception(_("repairAlreadyFixed")); + throw new Exception(tl("repairAlreadyFixed")); } item.setDurability((short)0); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java index c63671e1f..146a74fa3 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandseen.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.utils.DateUtil; @@ -54,7 +54,7 @@ public class Commandseen extends EssentialsCommand return; } else if (FormatUtil.validIP(args[0]) && (server.getIPBans().contains(args[0]))) { - sender.sendMessage(_("isIpBanned", args[0])); + sender.sendMessage(tl("isIpBanned", args[0])); return; } else @@ -70,31 +70,31 @@ public class Commandseen extends EssentialsCommand { user.setDisplayNick(); - sender.sendMessage(_("seenOnline", user.getDisplayName(), DateUtil.formatDateDiff(user.getLastLogin()))); + sender.sendMessage(tl("seenOnline", user.getDisplayName(), DateUtil.formatDateDiff(user.getLastLogin()))); if (user.isAfk()) { - sender.sendMessage(_("whoisAFK", _("true"))); + sender.sendMessage(tl("whoisAFK", tl("true"))); } if (user.isJailed()) { - sender.sendMessage(_("whoisJail", (user.getJailTimeout() > 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 @@ public class Commandseen extends EssentialsCommand 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 @@ public class Commandseen extends EssentialsCommand 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 class Commandseen extends EssentialsCommand 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 61c05ce07..c5722df26 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 class Commandsell extends EssentialsCommand { 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 @@ public class Commandsell extends EssentialsCommand 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 @@ public class Commandsell extends EssentialsCommand 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 434816254..15f10e786 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 class Commandsethome extends EssentialsCommand } 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 @@ public class Commandsethome extends EssentialsCommand } 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 7d590b352..9cf89bfaf 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 class Commandsetjail extends EssentialsCommand 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 a1c825ff9..b0fa51caf 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 class Commandsetwarp extends EssentialsCommand 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 class Commandsetwarp extends EssentialsCommand } 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 ecc11cd52..07938ef72 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 class Commandsetworth extends EssentialsCommand } ess.getWorth().setPrice(stack, Double.parseDouble(price)); - user.sendMessage(_("worthSet")); + user.sendMessage(tl("worthSet")); } @Override @@ -50,6 +50,6 @@ public class Commandsetworth extends EssentialsCommand 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 77d69f74d..4f00e991f 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 @@ public class Commandskull extends EssentialsCommand 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 @@ public class Commandskull extends EssentialsCommand 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 @@ public class Commandskull extends EssentialsCommand 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 63d3764be..8b2339637 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 @@ public class Commandsocialspy extends EssentialsToggleCommand 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 38e84870a..96c871c4c 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 @@ public class Commandspawner extends EssentialsCommand { 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 @@ public class Commandspawner extends EssentialsCommand 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 @@ public class Commandspawner extends EssentialsCommand } 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 4c37e35bb..2626d9dad 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 class Commandspawnmob extends EssentialsCommand if (args.length < 1) { final String mobList = SpawnMob.mobList(user); - throw new NotEnoughArgumentsException(_("mobsAvailable", mobList)); + throw new NotEnoughArgumentsException(tl("mobsAvailable", mobList)); } List<String> mobParts = SpawnMob.mobParts(args[0]); @@ -37,7 +37,7 @@ public class Commandspawnmob extends EssentialsCommand 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 class Commandspawnmob extends EssentialsCommand if (args.length < 3) { final String mobList = StringUtil.joinList(Mob.getMobList()); - throw new NotEnoughArgumentsException(_("mobsAvailable", mobList)); + throw new NotEnoughArgumentsException(tl("mobsAvailable", mobList)); } List<String> 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 ce361e786..9dca9dead 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 @@ public class Commandspeed extends EssentialsCommand 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 @@ public class Commandspeed extends EssentialsCommand 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 a5a8f7aab..2c2567be2 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 class Commandsudo extends EssentialsCommand { 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 class Commandsudo extends EssentialsCommand 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 class Commandsudo extends EssentialsCommand }); } 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 6cae113d9..69c1137c9 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 class Commandsuicide extends EssentialsCommand { 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 0728f1a22..84806ad0b 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java @@ -2,7 +2,7 @@ package com.earth2me.essentials.commands; 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 class Commandtempban extends EssentialsCommand if (sender.isPlayer() && !ess.getUser(sender.getPlayer()).isAuthorized("essentials.tempban.offline")) { - sender.sendMessage(_("tempbanExemptOffline")); + sender.sendMessage(tl("tempbanExemptOffline")); return; } } @@ -37,7 +37,7 @@ public class Commandtempban extends EssentialsCommand { if (user.isAuthorized("essentials.tempban.exempt") && sender.isPlayer()) { - sender.sendMessage(_("tempbanExempt")); + sender.sendMessage(tl("tempbanExempt")); return; } } @@ -48,17 +48,17 @@ public class Commandtempban extends EssentialsCommand 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 3cb60e6e3..25deb69c0 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 class Commandthunder extends EssentialsCommand 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 e29be16f5..4768a3089 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 @@ public class Commandtime extends EssentialsCommand 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 @@ public class Commandtime extends EssentialsCommand 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 @@ public class Commandtime extends EssentialsCommand 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 @@ public class Commandtime extends EssentialsCommand // 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 4a223387c..927462f21 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 class Commandtogglejail extends EssentialsCommand if (sender.isPlayer() && !ess.getUser(sender.getPlayer()).isAuthorized("essentials.togglejail.offline")) { - sender.sendMessage(_("mayNotJailOffline")); + sender.sendMessage(tl("mayNotJailOffline")); return; } } @@ -39,7 +39,7 @@ public class Commandtogglejail extends EssentialsCommand { if (player.isAuthorized("essentials.jail.exempt")) { - sender.sendMessage(_("mayNotJail")); + sender.sendMessage(tl("mayNotJail")); return; } } @@ -53,7 +53,7 @@ public class Commandtogglejail extends EssentialsCommand 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 class Commandtogglejail extends EssentialsCommand 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 class Commandtogglejail extends EssentialsCommand 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 class Commandtogglejail extends EssentialsCommand } 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 b088c31e6..d41646f2d 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 class Commandtop extends EssentialsCommand 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 99fc3da8a..4fc135c84 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java @@ -2,7 +2,7 @@ package com.earth2me.essentials.commands; 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 class Commandtp extends EssentialsCommand 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 class Commandtp extends EssentialsCommand 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 class Commandtp extends EssentialsCommand 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 class Commandtp extends EssentialsCommand { 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 @@ public class Commandtp extends EssentialsCommand 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 4ee8b21c5..94dd672bb 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 class Commandtpa extends EssentialsCommand } 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 689fdcc57..572083540 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 class Commandtpaall extends EssentialsCommand 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 @@ public class Commandtpaall extends EssentialsCommand 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 73d408ddd..4ae22a01a 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 class Commandtpaccept extends EssentialsCommand } 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 class Commandtpaccept extends EssentialsCommand { 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 class Commandtpaccept extends EssentialsCommand } 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 7bfdb7278..d0d3e47fd 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 class Commandtpahere extends EssentialsCommand } 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 360f9ca2a..503d29e98 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 class Commandtpall extends EssentialsCommand 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 2f2e6c41c..c0dfde446 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 class Commandtpdeny extends EssentialsCommand 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 5c47cffad..ec792b289 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 class Commandtphere extends EssentialsCommand 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 cd80b45fd..0befdfc3b 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 class Commandtpo extends EssentialsCommand 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 class Commandtpo extends EssentialsCommand 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 class Commandtpo extends EssentialsCommand 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 c23c43587..bb0d924eb 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 class Commandtpohere extends EssentialsCommand 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 a33352333..0d48acc59 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 class Commandtppos extends EssentialsCommand } 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 class Commandtppos extends EssentialsCommand } 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 97052876b..3bc02b02e 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 @@ public class Commandtptoggle extends EssentialsToggleCommand 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 b58e05da8..6240cf435 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 @@ public class Commandtree extends EssentialsCommand 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 eeb60985d..b64c0f6c3 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandunban.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandunban.java @@ -2,7 +2,7 @@ package com.earth2me.essentials.commands; 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 class Commandunban extends EssentialsCommand 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 c3de1b48e..1d79c94e0 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java @@ -2,7 +2,7 @@ package com.earth2me.essentials.commands; 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 class Commandunbanip extends EssentialsCommand 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 c70490c3f..df005421f 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 @@ public class Commandunlimited extends EssentialsCommand 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<Integer> items = target.getUnlimited(); if (items.isEmpty()) { - output.append(_("none")); + output.append(tl("none")); } for (Integer integer : items) { @@ -93,7 +93,7 @@ public class Commandunlimited extends EssentialsCommand && !((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 @@ public class Commandunlimited extends EssentialsCommand 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 34aa82f64..fd2bd6d92 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 @@ public class Commandvanish extends EssentialsToggleCommand } 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 3a574c628..8c2e88a4a 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 class Commandwarp extends EssentialsCommand { 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 @@ public class Commandwarp extends EssentialsCommand } 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 @@ public class Commandwarp extends EssentialsCommand 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 @@ public class Commandwarp extends EssentialsCommand 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 287efe359..15947e261 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 @@ public class Commandweather extends EssentialsCommand 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 @@ public class Commandweather extends EssentialsCommand 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 @@ public class Commandweather extends EssentialsCommand 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 4d4b5df7a..a3f7f6ae8 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 class Commandwhois extends EssentialsCommand 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 b0559a4a0..1a6d3ea7b 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 @@ public class Commandworld extends EssentialsCommand 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 eeea2d7e3..097812ce2 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 class Commandworth extends EssentialsCommand { 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 @@ public class Commandworth extends EssentialsCommand if (worth == null) { - throw new Exception(_("itemCannotBeSold")); + throw new Exception(tl("itemCannotBeSold")); } if (amount < 0) @@ -121,13 +121,13 @@ public class Commandworth extends EssentialsCommand 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 d9f239a7c..b13e6a92f 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 abstract class EssentialsCommand implements IEssentialsCommand 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 c33e87522..1f5a00fbd 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 bfba73818..38573bfda 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 78e8d33bf..096a7fc5e 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 @@ public class EssentialsSign // 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 @@ public class EssentialsSign 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 @@ public class EssentialsSign 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 @@ public class EssentialsSign final int quantity = getInteger(line); if (quantity < 1) { - throw new SignException(_("moreThanZero")); + throw new SignException(tl("moreThanZero")); } return quantity; } @@ -451,7 +450,7 @@ public class EssentialsSign 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 @@ public class EssentialsSign 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 0682a46c5..bd5b10f09 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 class SignBalance extends EssentialsSign @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 a3ca29591..ce3b85644 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 @@ public class SignEnchant extends EssentialsSign if (enchantLevel.length != 2) { sign.setLine(2, "§c<enchant>"); - 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<enchant>"); - throw new SignException(_("enchantmentNotFound")); + throw new SignException(tl("enchantmentNotFound")); } int level; try @@ -89,12 +89,12 @@ public class SignEnchant extends EssentialsSign 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 @@ public class SignEnchant extends EssentialsSign || (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 @@ public class SignEnchant extends EssentialsSign 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 e16a4846f..741498188 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 @@ public class SignFree extends EssentialsSign 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 126fd0124..396b2cf6a 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 @@ public class SignGameMode extends EssentialsSign 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 @@ public class SignGameMode extends EssentialsSign } 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 edd15ce29..18b744bef 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 @@ public class SignHeal extends EssentialsSign { 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 ed7a9d753..dc181953b 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 @@ public class SignKit extends EssentialsSign 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 85859b2ea..85f150eca 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 @@ public class SignMail extends EssentialsSign final List<String> 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 6e9166fda..ac7453464 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 @@ public class SignProtection extends EssentialsSign return true; } } - player.sendMessage(_("signProtectInvalidLocation")); + player.sendMessage(tl("signProtectInvalidLocation")); return false; } @@ -256,7 +256,7 @@ public class SignProtection extends EssentialsSign 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 @@ public class SignProtection extends EssentialsSign } - 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 @@ public class SignProtection extends EssentialsSign } - 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 2348a0974..91c4a4314 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 @@ public class SignRepair extends EssentialsSign else if (!repairTarget.equalsIgnoreCase("all") && !repairTarget.equalsIgnoreCase("hand")) { sign.setLine(1, "§c<hand|all>"); - 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 026f9f19d..2f6390f7a 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 @@ public class SignTime extends EssentialsSign sign.setLine(1, "§2Night"); return true; } - throw new SignException(_("onlyDayNight")); + throw new SignException(tl("onlyDayNight")); } @Override @@ -54,6 +54,6 @@ public class SignTime extends EssentialsSign 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 b0c644c83..f51611aaf 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 @@ public class SignTrade extends EssentialsSign { 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 @@ public class SignTrade extends EssentialsSign 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 @@ public class SignTrade extends EssentialsSign 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 @@ public class SignTrade extends EssentialsSign 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 @@ public class SignTrade extends EssentialsSign } catch (SignException e) { - throw new SignException(_("tradeSignEmpty"), e); + throw new SignException(tl("tradeSignEmpty"), e); } } @@ -277,7 +277,7 @@ public class SignTrade extends EssentialsSign } 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 @@ public class SignTrade extends EssentialsSign } 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 @@ public class SignTrade extends EssentialsSign 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 @@ public class SignTrade extends EssentialsSign 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 1d6960d14..2281ec650 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 @@ public class SignWarp extends EssentialsSign if (warpName.isEmpty()) { sign.setLine(1, "§c<Warp name>"); - 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 45f715826..910adeb32 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 @@ public class SignWeather extends EssentialsSign return true; } sign.setLine(1, "§c<sun|storm>"); - throw new SignException(_("onlySunStorm")); + throw new SignException(tl("onlySunStorm")); } @Override @@ -53,6 +53,6 @@ public class SignWeather extends EssentialsSign 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 aacd3a038..311f60863 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 class BookPager //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 c51b0cba8..1e74871d4 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 class HelpInput implements IText 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 class HelpInput implements IText { 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 class HelpInput implements IText 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 @@ public class HelpInput implements IText } 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<Object>)permissions).isEmpty()) { @@ -99,21 +99,21 @@ public class HelpInput implements IText } 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 @@ public class HelpInput implements IText } if (match.equalsIgnoreCase("")) { - lines.add(_("helpPlugin", pluginName, pluginNameLow)); + lines.add(tl("helpPlugin", pluginName, pluginNameLow)); } } } @@ -143,7 +143,7 @@ public class HelpInput implements IText { 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 22bf1778d..2f4b1f2a5 100644 --- a/Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java +++ b/Essentials/src/com/earth2me/essentials/textreader/KeywordReplacer.java @@ -2,7 +2,7 @@ package com.earth2me.essentials.textreader; 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 @@ public class KeywordReplacer implements IText 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 e3a259333..13b8aca00 100644 --- a/Essentials/src/com/earth2me/essentials/textreader/TextPager.java +++ b/Essentials/src/com/earth2me/essentials/textreader/TextPager.java @@ -2,7 +2,7 @@ package com.earth2me.essentials.textreader; 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 class TextPager { 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 class TextPager { 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 class TextPager } 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 class TextPager //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 class TextPager 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 class TextPager } 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 e416fbb0e..911e81705 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 class DateUtil } if (!found) { - throw new Exception(_("illegalDate")); + throw new Exception(tl("illegalDate")); } Calendar c = new GregorianCalendar(); if (years > 0) @@ -138,7 +138,7 @@ public class DateUtil boolean future = false; if (toDate.equals(fromDate)) { - return _("now"); + return tl("now"); } if (toDate.after(fromDate)) { @@ -151,7 +151,7 @@ public class DateUtil }; 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 b10412e60..f2087f914 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 final class DescParseTickFormat // ============================================ 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 1d2cbb6ae..d9871983c 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 class LocationUtil { 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 class LocationUtil 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 2655c111a..2c03d33da 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 class NumberUtil 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 89f27bbdd..210b07762 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 4ac45be5b..bdc78aad2 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 761a42da3..ed9cd8ca9 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 4423301b6..9be186a5a 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 bfa7eeb84..1071a9f6d 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<Player> 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 27ca5fe35..43fb60d2e 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 class EssentialsAntiBuildListener implements Listener { if (ess.getSettings().warnOnBuildDisallow()) { - user.sendMessage(_("antiBuildPlace", type.toString())); + user.sendMessage(tl("antiBuildPlace", type.toString())); } event.setCancelled(true); return; @@ -95,7 +95,7 @@ public class EssentialsAntiBuildListener implements Listener { if (ess.getSettings().warnOnBuildDisallow()) { - user.sendMessage(_("antiBuildPlace", type.toString())); + user.sendMessage(tl("antiBuildPlace", type.toString())); } event.setCancelled(true); return; @@ -104,7 +104,7 @@ public class EssentialsAntiBuildListener implements Listener 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 class EssentialsAntiBuildListener implements Listener { if (ess.getSettings().warnOnBuildDisallow()) { - user.sendMessage(_("antiBuildBreak", type.toString())); + user.sendMessage(tl("antiBuildBreak", type.toString())); } event.setCancelled(true); return; @@ -132,7 +132,7 @@ public class EssentialsAntiBuildListener implements Listener { if (ess.getSettings().warnOnBuildDisallow()) { - user.sendMessage(_("antiBuildBreak", type.toString())); + user.sendMessage(tl("antiBuildBreak", type.toString())); } event.setCancelled(true); return; @@ -141,7 +141,7 @@ public class EssentialsAntiBuildListener implements Listener 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 class EssentialsAntiBuildListener implements Listener { if (warn) { - user.sendMessage(_("antiBuildBreak", Material.PAINTING.toString())); + user.sendMessage(tl("antiBuildBreak", Material.PAINTING.toString())); } event.setCancelled(true); } @@ -168,7 +168,7 @@ public class EssentialsAntiBuildListener implements Listener { 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 class EssentialsAntiBuildListener implements Listener { 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 class EssentialsAntiBuildListener implements Listener && 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 class EssentialsAntiBuildListener implements Listener 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 class EssentialsAntiBuildListener implements Listener 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 class EssentialsAntiBuildListener implements Listener 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 class EssentialsAntiBuildListener implements Listener 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 6f568a109..2a7b4ecf7 100644 --- a/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsConnect.java +++ b/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsConnect.java @@ -2,7 +2,7 @@ package com.earth2me.essentials.antibuild; 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 class EssentialsConnect { 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 class EssentialsConnect 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 db1d0066c..3ce515f3b 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 class EssentialsChat extends JavaPlugin 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 284da0a9b..07e81d9d4 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 class EssentialsChatPlayerListenerNormal extends EssentialsChatPlayer 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 class EssentialsChatPlayerListenerNormal extends EssentialsChatPlayer } 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<Player> it = outList.iterator(); while (it.hasNext()) @@ -137,7 +137,7 @@ public class EssentialsChatPlayerListenerNormal extends EssentialsChatPlayer } 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 02e901b5b..aced4ccb8 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 class EssentialsGeoIP extends JavaPlugin 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 89debe9fe..a6cb28ddc 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 class EssentialsGeoIPPlayerListener implements Listener, IConf 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 class EssentialsGeoIPPlayerListener implements Listener, IConf } else { - logger.log(Level.SEVERE, _("cantFindGeoIpDB")); + logger.log(Level.SEVERE, tl("cantFindGeoIpDB")); return; } } @@ -133,7 +133,7 @@ public class EssentialsGeoIPPlayerListener implements Listener, IConf } catch (IOException ex) { - logger.log(Level.SEVERE, _("cantReadGeoIpDB"), ex); + logger.log(Level.SEVERE, tl("cantReadGeoIpDB"), ex); } } @@ -152,10 +152,10 @@ public class EssentialsGeoIPPlayerListener implements Listener, IConf } 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 @@ public class EssentialsGeoIPPlayerListener implements Listener, IConf } 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 2c87ce332..58290a8b8 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 class EssentialsConnect {
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 c6c89a20d..15d2ca2ab 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 class Commandsetspawn extends EssentialsCommand { 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 cccce4284..34a4eb6bd 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 class Commandspawn extends EssentialsCommand 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 @@ public class Commandspawn extends EssentialsCommand } 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 @@ public class Commandspawn extends EssentialsCommand { 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 a22615550..d07637303 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 class EssentialsSpawn extends JavaPlugin implements IEssentialsSpawn 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 b1732f578..e5611b494 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 class EssentialsSpawnPlayerListener implements Listener } 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 c2dece390..ab7cf986c 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 class EssentialsXMPP extends JavaPlugin implements IEssentialsXMPP 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()) { |