Future Java versions may not support _ as identifier.

This commit is contained in:
FearFree 2014-03-20 10:54:07 -05:00 committed by Chris Ward
parent 0b5718f7ff
commit 5724c0c8df
176 changed files with 1032 additions and 1028 deletions

View File

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

View File

@ -17,7 +17,7 @@
*/ */
package com.earth2me.essentials; 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.EssentialsCommand;
import com.earth2me.essentials.commands.IEssentialsCommand; import com.earth2me.essentials.commands.IEssentialsCommand;
import com.earth2me.essentials.commands.NoChargeException; import com.earth2me.essentials.commands.NoChargeException;
@ -58,9 +58,7 @@ import org.bukkit.command.BlockCommandSender;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.command.PluginCommand; import org.bukkit.command.PluginCommand;
import org.bukkit.command.SimpleCommandMap;
import org.bukkit.command.TabCompleter; import org.bukkit.command.TabCompleter;
import org.bukkit.command.defaults.VanillaCommand;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; 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 I18n i18n;
private transient Metrics metrics; private transient Metrics metrics;
private transient EssentialsTimer timer; private transient EssentialsTimer timer;
private transient List<String> vanishedPlayers = new ArrayList<String>(); private final transient List<String> vanishedPlayers = new ArrayList<String>();
public Essentials() public Essentials()
{ {
@ -131,7 +129,7 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials
} }
i18n = new I18n(this); i18n = new I18n(this);
i18n.onEnable(); i18n.onEnable();
LOGGER.log(Level.INFO, _("usingTempFolderForTesting")); LOGGER.log(Level.INFO, tl("usingTempFolderForTesting"));
LOGGER.log(Level.INFO, dataFolder.toString()); LOGGER.log(Level.INFO, dataFolder.toString());
this.initialize(null, server, new PluginDescriptionFile(new FileReader(new File("src" + File.separator + "plugin.yml"))), dataFolder, null, null); this.initialize(null, server, new PluginDescriptionFile(new FileReader(new File("src" + File.separator + "plugin.yml"))), dataFolder, null, null);
settings = new Settings(this); 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().getVersion().equals(this.getDescription().getVersion())
&& !plugin.getDescription().getName().equals("EssentialsAntiCheat")) && !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()); 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 else
{ {
LOGGER.log(Level.INFO, _("bukkitFormatChanged")); LOGGER.log(Level.INFO, tl("bukkitFormatChanged"));
LOGGER.log(Level.INFO, getServer().getVersion()); LOGGER.log(Level.INFO, getServer().getVersion());
LOGGER.log(Level.INFO, getServer().getBukkitVersion()); 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) if (pm.getPlugin("EssentialsUpdate") != null)
{ {
LOGGER.log(Level.SEVERE, _("essentialsHelp2")); LOGGER.log(Level.SEVERE, tl("essentialsHelp2"));
} }
else else
{ {
LOGGER.log(Level.SEVERE, _("essentialsHelp1")); LOGGER.log(Level.SEVERE, tl("essentialsHelp1"));
} }
handleCrash(exception); handleCrash(exception);
return; return;
@ -244,7 +242,7 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials
final String timeroutput = execTimer.end(); final String timeroutput = execTimer.end();
if (getSettings().isDebug()) if (getSettings().isDebug())
{ {
LOGGER.log(Level.INFO, "Essentials load " + timeroutput); LOGGER.log(Level.INFO, "Essentials load {0}", timeroutput);
} }
} }
catch (NumberFormatException ex) catch (NumberFormatException ex)
@ -312,7 +310,7 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials
if (user.isVanished()) if (user.isVanished())
{ {
user.setVanished(false); user.setVanished(false);
user.sendMessage(_("unvanishedReload")); user.sendMessage(tl("unvanishedReload"));
} }
} }
cleanupOpenInventories(); cleanupOpenInventories();
@ -441,7 +439,7 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials
final List<String> mail = user.getMails(); final List<String> mail = user.getMails();
if (mail != null && !mail.isEmpty()) 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) catch (Exception ex)
{ {
sender.sendMessage(_("commandNotLoaded", commandLabel)); sender.sendMessage(tl("commandNotLoaded", commandLabel));
LOGGER.log(Level.SEVERE, _("commandNotLoaded", commandLabel), ex); LOGGER.log(Level.SEVERE, tl("commandNotLoaded", commandLabel), ex);
return true; return true;
} }
// Check authorization // Check authorization
if (user != null && !user.isAuthorized(cmd, permissionPrefix)) if (user != null && !user.isAuthorized(cmd, permissionPrefix))
{ {
LOGGER.log(Level.INFO, _("deniedAccessCommand", user.getName())); LOGGER.log(Level.INFO, tl("deniedAccessCommand", user.getName()));
user.sendMessage(_("noAccessCommand")); user.sendMessage(tl("noAccessCommand"));
return true; return true;
} }
@ -484,11 +482,11 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials
{ {
if (user.getJailTimeout() > 0) if (user.getJailTimeout() > 0)
{ {
user.sendMessage(_("playerJailedFor", user.getName(), DateUtil.formatDateDiff(user.getJailTimeout()))); user.sendMessage(tl("playerJailedFor", user.getName(), DateUtil.formatDateDiff(user.getJailTimeout())));
} }
else else
{ {
user.sendMessage(_("jailMessage")); user.sendMessage(tl("jailMessage"));
} }
return true; return true;
} }
@ -532,7 +530,7 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials
} }
catch (Throwable ex) catch (Throwable ex)
{ {
LOGGER.log(Level.SEVERE, _("commandFailed", commandLabel), ex); LOGGER.log(Level.SEVERE, tl("commandFailed", commandLabel), ex);
return true; return true;
} }
} }
@ -560,18 +558,18 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials
@Override @Override
public void showError(final CommandSource sender, final Throwable exception, final String commandLabel) 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()) if (getSettings().isDebug())
{ {
LOGGER.log(Level.WARNING, _("errorCallingCommand", commandLabel), exception); LOGGER.log(Level.WARNING, tl("errorCallingCommand", commandLabel), exception);
} }
} }
public static void wrongVersion() public static void wrongVersion()
{ {
LOGGER.log(Level.SEVERE, " * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! *"); LOGGER.log(Level.SEVERE, " * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! *");
LOGGER.log(Level.SEVERE, _("notRecommendedBukkit")); LOGGER.log(Level.SEVERE, tl("notRecommendedBukkit"));
LOGGER.log(Level.SEVERE, _("requiredBukkit", Integer.toString(BUKKIT_VERSION))); LOGGER.log(Level.SEVERE, tl("requiredBukkit", Integer.toString(BUKKIT_VERSION)));
LOGGER.log(Level.SEVERE, " * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! *"); LOGGER.log(Level.SEVERE, " * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! * ! *");
} }
@ -672,7 +670,7 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials
{ {
if (getSettings().isDebug()) 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); user = new User(base, this);
} }

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials; package com.earth2me.essentials;
import static com.earth2me.essentials.I18n._; import static com.earth2me.essentials.I18n.tl;
import com.google.common.io.Files; import com.google.common.io.Files;
import java.io.*; import java.io.*;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -50,14 +50,14 @@ public class EssentialsConf extends YamlConfiguration
{ {
if (pendingDiskWrites.get() != 0) 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; return;
} }
if (!configFile.getParentFile().exists()) if (!configFile.getParentFile().exists())
{ {
if (!configFile.getParentFile().mkdirs()) 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. // 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) if (templateName != null)
{ {
LOGGER.log(Level.INFO, _("creatingConfigFromTemplate", configFile.toString())); LOGGER.log(Level.INFO, tl("creatingConfigFromTemplate", configFile.toString()));
createFromTemplate(); createFromTemplate();
} }
else else
@ -189,7 +189,7 @@ public class EssentialsConf extends YamlConfiguration
istr = resourceClass.getResourceAsStream(templateName); istr = resourceClass.getResourceAsStream(templateName);
if (istr == null) if (istr == null)
{ {
LOGGER.log(Level.SEVERE, _("couldNotFindTemplate", templateName)); LOGGER.log(Level.SEVERE, tl("couldNotFindTemplate", templateName));
return; return;
} }
ostr = new FileOutputStream(configFile); ostr = new FileOutputStream(configFile);
@ -204,7 +204,7 @@ public class EssentialsConf extends YamlConfiguration
} }
catch (IOException ex) catch (IOException ex)
{ {
LOGGER.log(Level.SEVERE, _("failedToWriteConfig", configFile.toString()), ex); LOGGER.log(Level.SEVERE, tl("failedToWriteConfig", configFile.toString()), ex);
} }
finally finally
{ {
@ -228,7 +228,7 @@ public class EssentialsConf extends YamlConfiguration
} }
catch (IOException ex) 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 try
{ {
LOGGER.log(Level.INFO, _("creatingEmptyConfig", configFile.toString())); LOGGER.log(Level.INFO, tl("creatingEmptyConfig", configFile.toString()));
if (!configFile.createNewFile()) if (!configFile.createNewFile())
{ {
LOGGER.log(Level.SEVERE, _("failedToCreateConfig", configFile.toString())); LOGGER.log(Level.SEVERE, tl("failedToCreateConfig", configFile.toString()));
return; return;
} }
} }
catch (IOException ex) catch (IOException ex)
{ {
LOGGER.log(Level.SEVERE, _("failedToCreateConfig", configFile.toString()), ex); LOGGER.log(Level.SEVERE, tl("failedToCreateConfig", configFile.toString()), ex);
return; return;
} }
} }

View File

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

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials; 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.IText;
import com.earth2me.essentials.textreader.KeywordReplacer; import com.earth2me.essentials.textreader.KeywordReplacer;
import com.earth2me.essentials.textreader.TextInput; import com.earth2me.essentials.textreader.TextInput;
@ -63,8 +63,8 @@ public class EssentialsPlayerListener implements Listener
if (user.isMuted()) if (user.isMuted())
{ {
event.setCancelled(true); event.setCancelled(true);
user.sendMessage(_("voiceSilenced")); user.sendMessage(tl("voiceSilenced"));
LOGGER.info(_("mutedUserSpeaks", user.getName())); LOGGER.info(tl("mutedUserSpeaks", user.getName()));
} }
try try
{ {
@ -295,11 +295,11 @@ public class EssentialsPlayerListener implements Listener
final List<String> mail = user.getMails(); final List<String> mail = user.getMails();
if (mail.isEmpty()) if (mail.isEmpty())
{ {
user.sendMessage(_("noNewMail")); user.sendMessage(tl("noNewMail"));
} }
else 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.setAllowFlight(true);
user.setFlying(true); user.setFlying(true);
user.sendMessage(_("flyMode", _("enabled"), user.getDisplayName())); user.sendMessage(tl("flyMode", tl("enabled"), user.getDisplayName()));
} }
} }
user.setFlySpeed(0.1f); user.setFlySpeed(0.1f);
@ -346,7 +346,7 @@ public class EssentialsPlayerListener implements Listener
return; return;
} }
final String banReason = _("banFormat", _("defaultBanReason"), "Console"); final String banReason = tl("banFormat", tl("defaultBanReason"), "Console");
event.disallow(Result.KICK_BANNED, banReason); 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")) if (event.getResult() == Result.KICK_FULL && !user.isAuthorized("essentials.joinfullserver"))
{ {
event.disallow(Result.KICK_FULL, _("serverFull")); event.disallow(Result.KICK_FULL, tl("serverFull"));
return; return;
} }
event.allow(); event.allow();
@ -510,12 +510,12 @@ public class EssentialsPlayerListener implements Listener
updateCompass(user); updateCompass(user);
if (ess.getSettings().getNoGodWorlds().contains(newWorld) && user.isGodModeEnabledRaw()) if (ess.getSettings().getNoGodWorlds().contains(newWorld) && user.isGodModeEnabledRaw())
{ {
user.sendMessage(_("noGodWorldWarning")); user.sendMessage(tl("noGodWorldWarning"));
} }
if (!user.getWorld().getName().equals(newWorld)) if (!user.getWorld().getName().equals(newWorld))
{ {
user.sendMessage(_("currentWorld", newWorld)); user.sendMessage(tl("currentWorld", newWorld));
} }
if (user.isVanished()) if (user.isVanished())
{ {
@ -535,7 +535,7 @@ public class EssentialsPlayerListener implements Listener
if (player.isAuthorized("essentials.sethome.bed")) if (player.isAuthorized("essentials.sethome.bed"))
{ {
player.setBedSpawnLocation(event.getClickedBlock().getLocation()); 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; break;

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials; 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.craftbukkit.FakeWorld;
import com.earth2me.essentials.settings.Spawns; import com.earth2me.essentials.settings.Spawns;
import com.earth2me.essentials.storage.YamlStorageWriter; import com.earth2me.essentials.storage.YamlStorageWriter;
@ -73,7 +73,7 @@ public class EssentialsUpgrade
} }
catch (Exception e) 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) 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")))) 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)) if (!tempFile.renameTo(file))
{ {
throw new Exception(_("configFileRenameError")); throw new Exception(tl("configFileRenameError"));
} }
} }
else else
@ -499,7 +499,7 @@ public class EssentialsUpgrade
ess.getWarps().setWarp(filename.substring(0, filename.length() - 4), loc); ess.getWarps().setWarp(filename.substring(0, filename.length() - 4), loc);
if (!listOfFiles[i].renameTo(new File(warpsFolder, filename + ".old"))) if (!listOfFiles[i].renameTo(new File(warpsFolder, filename + ".old")))
{ {
throw new Exception(_("fileRenameError", filename)); throw new Exception(tl("fileRenameError", filename));
} }
} }
catch (Exception ex) catch (Exception ex)
@ -547,7 +547,7 @@ public class EssentialsUpgrade
ess.getWarps().setWarp(name, loc); ess.getWarps().setWarp(name, loc);
if (!warpFile.renameTo(new File(ess.getDataFolder(), "warps.txt.old"))) 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); final File newFile = new File(listOfFile.getParentFile(), sanitizedFilename);
if (!listOfFile.renameTo(tmpFile)) if (!listOfFile.renameTo(tmpFile))
{ {
LOGGER.log(Level.WARNING, _("userdataMoveError", filename, sanitizedFilename)); LOGGER.log(Level.WARNING, tl("userdataMoveError", filename, sanitizedFilename));
continue; continue;
} }
if (newFile.exists()) if (newFile.exists())
{ {
LOGGER.log(Level.WARNING, _("duplicatedUserdata", filename, sanitizedFilename)); LOGGER.log(Level.WARNING, tl("duplicatedUserdata", filename, sanitizedFilename));
continue; continue;
} }
if (!tmpFile.renameTo(newFile)) if (!tmpFile.renameTo(newFile))
{ {
LOGGER.log(Level.WARNING, _("userdataMoveBackError", sanitizedFilename, sanitizedFilename)); LOGGER.log(Level.WARNING, tl("userdataMoveBackError", sanitizedFilename, sanitizedFilename));
} }
} }
doneFile.setProperty("sanitizeAllUserFilenames", true); doneFile.setProperty("sanitizeAllUserFilenames", true);
@ -711,7 +711,7 @@ public class EssentialsUpgrade
} }
if (!configFile.renameTo(new File(ess.getDataFolder(), "spawn.yml.old"))) 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); PrintWriter writer = new PrintWriter(configFile);
try try
@ -758,7 +758,7 @@ public class EssentialsUpgrade
} }
if (!configFile.renameTo(new File(ess.getDataFolder(), "jail.yml.old"))) 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); PrintWriter writer = new PrintWriter(configFile);
try try

View File

@ -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) if (instance == null)
{ {

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials; 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.NumberUtil;
import com.earth2me.essentials.utils.StringUtil; import com.earth2me.essentials.utils.StringUtil;
import java.util.*; import java.util.*;
@ -143,20 +143,20 @@ public class ItemDb implements IConf, net.ess3.api.IItemDb
} }
catch (Throwable throwable) catch (Throwable throwable)
{ {
throw new Exception(_("unknownItemName", itemname), throwable); throw new Exception(tl("unknownItemName", itemname), throwable);
} }
} }
} }
if (itemid < 1) if (itemid < 1)
{ {
throw new Exception(_("unknownItemName", itemname)); throw new Exception(tl("unknownItemName", itemname));
} }
final Material mat = Material.getMaterial(itemid); final Material mat = Material.getMaterial(itemid);
if (mat == null) if (mat == null)
{ {
throw new Exception(_("unknownItemId", itemid)); throw new Exception(tl("unknownItemId", itemid));
} }
final ItemStack retval = new ItemStack(mat); final ItemStack retval = new ItemStack(mat);
retval.setAmount(mat.getMaxStackSize()); 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) if (is.isEmpty() || is.get(0).getType() == Material.AIR)
{ {
throw new Exception(_("itemSellAir")); throw new Exception(tl("itemSellAir"));
} }
return is; return is;

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials; package com.earth2me.essentials;
import static com.earth2me.essentials.I18n._; import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.storage.AsyncStorageObjectHolder; import com.earth2me.essentials.storage.AsyncStorageObjectHolder;
import java.io.File; import java.io.File;
import java.util.*; import java.util.*;
@ -93,12 +93,12 @@ public class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.sett
if (getData().getJails() == null || jailName == null if (getData().getJails() == null || jailName == null
|| !getData().getJails().containsKey(jailName.toLowerCase(Locale.ENGLISH))) || !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)); Location loc = getData().getJails().get(jailName.toLowerCase(Locale.ENGLISH));
if (loc == null || loc.getWorld() == null) if (loc == null || loc.getWorld() == null)
{ {
throw new Exception(_("jailNotExist")); throw new Exception(tl("jailNotExist"));
} }
return loc; return loc;
} }
@ -272,11 +272,11 @@ public class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.sett
{ {
if (ess.getSettings().isDebug()) 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 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()) 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 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) @EventHandler(priority = EventPriority.HIGHEST)
@ -327,14 +327,14 @@ public class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.sett
{ {
if (ess.getSettings().isDebug()) 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 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"));
} }
} }
} }

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials; 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 static com.earth2me.essentials.I18n.capitalCase;
import com.earth2me.essentials.Trade.OverflowType; import com.earth2me.essentials.Trade.OverflowType;
import com.earth2me.essentials.commands.NoChargeException; 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); BigDecimal costPrice = new Trade("kit-" + kitItem.toLowerCase(Locale.ENGLISH), ess).getCommandCost(user);
if (costPrice.signum() > 0) 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); final Map<String, Object> kit = ess.getSettings().getKit(kitItem);
if (Kit.getNextUse(user, kitItem, kit) != 0) if (Kit.getNextUse(user, kitItem, kit) != 0)
{ {
name = _("kitDelay", name); name = tl("kitDelay", name);
} }
list.append(" ").append(name).append(cost); list.append(" ").append(name).append(cost);
@ -57,7 +57,7 @@ public class Kit
} }
catch (Exception ex) 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) else if (nextUse < 0L)
{ {
user.sendMessage(_("kitOnce")); user.sendMessage(tl("kitOnce"));
throw new NoChargeException(); throw new NoChargeException();
} }
else else
{ {
user.sendMessage(_("kitTimed", DateUtil.formatDateDiff(nextUse))); user.sendMessage(tl("kitTimed", DateUtil.formatDateDiff(nextUse)));
throw new NoChargeException(); throw new NoChargeException();
} }
} }
@ -100,7 +100,7 @@ public class Kit
} }
catch (Exception e) catch (Exception e)
{ {
throw new Exception(_("kitError2")); throw new Exception(tl("kitError2"));
} }
// When was the last kit used? // When was the last kit used?
@ -138,7 +138,7 @@ public class Kit
{ {
if (kit == null) if (kit == null)
{ {
throw new Exception(_("kitNotFound")); throw new Exception(tl("kitNotFound"));
} }
try try
{ {
@ -162,7 +162,7 @@ public class Kit
catch (Exception e) catch (Exception e)
{ {
ess.getLogger().log(Level.WARNING, "Error parsing kit " + kitName + ": " + e.getMessage()); 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(); user.updateInventory();
if (spew) if (spew)
{ {
user.sendMessage(_("kitInvFull")); user.sendMessage(tl("kitInvFull"));
} }
} }
catch (Exception e) catch (Exception e)
{ {
user.updateInventory(); user.updateInventory();
ess.getLogger().log(Level.WARNING, e.getMessage()); ess.getLogger().log(Level.WARNING, e.getMessage());
throw new Exception(_("kitError2"), e); throw new Exception(tl("kitError2"), e);
} }
} }
} }

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials; package com.earth2me.essentials;
import static com.earth2me.essentials.I18n._; import static com.earth2me.essentials.I18n.tl;
import java.io.*; import java.io.*;
import java.math.BigInteger; import java.math.BigInteger;
import java.security.DigestInputStream; import java.security.DigestInputStream;
@ -47,7 +47,7 @@ public class ManagedFile
} }
catch (IOException ex) catch (IOException ex)
{ {
Bukkit.getLogger().log(Level.SEVERE, _("itemsCsvNotLoaded"), ex); Bukkit.getLogger().log(Level.SEVERE, tl("itemsCsvNotLoaded"), ex);
} }
} }
} }

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials; 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.BookInput;
import com.earth2me.essentials.textreader.BookPager; import com.earth2me.essentials.textreader.BookPager;
import com.earth2me.essentials.textreader.IText; import com.earth2me.essentials.textreader.IText;
@ -105,7 +105,7 @@ public class MetaItemStack
} }
catch (NoSuchMethodError nsme) catch (NoSuchMethodError nsme)
{ {
throw new Exception(_("noMetaJson"), nsme); throw new Exception(tl("noMetaJson"), nsme);
} }
catch (Throwable throwable) catch (Throwable throwable)
{ {
@ -122,14 +122,14 @@ public class MetaItemStack
{ {
if (!hasMetaPermission(sender, "firework", true, true, ess)) if (!hasMetaPermission(sender, "firework", true, true, ess))
{ {
throw new Exception(_("noMetaFirework")); throw new Exception(tl("noMetaFirework"));
} }
FireworkEffect effect = builder.build(); FireworkEffect effect = builder.build();
FireworkMeta fmeta = (FireworkMeta)stack.getItemMeta(); FireworkMeta fmeta = (FireworkMeta)stack.getItemMeta();
fmeta.addEffect(effect); fmeta.addEffect(effect);
if (fmeta.getEffects().size() > 1 && !hasMetaPermission(sender, "firework-multiple", true, true, ess)) if (fmeta.getEffects().size() > 1 && !hasMetaPermission(sender, "firework-multiple", true, true, ess))
{ {
throw new Exception(_("multipleCharges")); throw new Exception(tl("multipleCharges"));
} }
stack.setItemMeta(fmeta); stack.setItemMeta(fmeta);
} }
@ -173,7 +173,7 @@ public class MetaItemStack
} }
else else
{ {
throw new Exception(_("onlyPlayerSkulls")); throw new Exception(tl("onlyPlayerSkulls"));
} }
} }
else if (split.length > 1 && split[0].equalsIgnoreCase("book") && stack.getType() == Material.WRITTEN_BOOK else if (split.length > 1 && split[0].equalsIgnoreCase("book") && stack.getType() == Material.WRITTEN_BOOK
@ -234,7 +234,7 @@ public class MetaItemStack
} }
else else
{ {
throw new Exception(_("leatherSyntax")); throw new Exception(tl("leatherSyntax"));
} }
} }
else else
@ -260,14 +260,14 @@ public class MetaItemStack
{ {
if (!hasMetaPermission(sender, "firework", true, true, ess)) if (!hasMetaPermission(sender, "firework", true, true, ess))
{ {
throw new Exception(_("noMetaFirework")); throw new Exception(tl("noMetaFirework"));
} }
FireworkEffect effect = builder.build(); FireworkEffect effect = builder.build();
FireworkMeta fmeta = (FireworkMeta)stack.getItemMeta(); FireworkMeta fmeta = (FireworkMeta)stack.getItemMeta();
fmeta.addEffect(effect); fmeta.addEffect(effect);
if (fmeta.getEffects().size() > 1 && !hasMetaPermission(sender, "firework-multiple", true, true, ess)) if (fmeta.getEffects().size() > 1 && !hasMetaPermission(sender, "firework-multiple", true, true, ess))
{ {
throw new Exception(_("multipleCharges")); throw new Exception(tl("multipleCharges"));
} }
stack.setItemMeta(fmeta); stack.setItemMeta(fmeta);
builder = FireworkEffect.builder(); builder = FireworkEffect.builder();
@ -284,7 +284,7 @@ public class MetaItemStack
} }
else else
{ {
throw new Exception(_("invalidFireworkFormat", split[1], split[0])); throw new Exception(tl("invalidFireworkFormat", split[1], split[0]));
} }
} }
builder.withColor(primaryColors); builder.withColor(primaryColors);
@ -299,7 +299,7 @@ public class MetaItemStack
} }
else else
{ {
throw new Exception(_("invalidFireworkFormat", split[1], split[0])); throw new Exception(tl("invalidFireworkFormat", split[1], split[0]));
} }
if (finalEffect != null) if (finalEffect != null)
{ {
@ -318,7 +318,7 @@ public class MetaItemStack
} }
else else
{ {
throw new Exception(_("invalidFireworkFormat", split[1], split[0])); throw new Exception(tl("invalidFireworkFormat", split[1], split[0]));
} }
} }
if (!fadeColors.isEmpty()) if (!fadeColors.isEmpty())
@ -341,7 +341,7 @@ public class MetaItemStack
} }
else 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 else
{ {
throw new Exception(_("noPotionEffectPerm", pEffectType.getName().toLowerCase(Locale.ENGLISH))); throw new Exception(tl("noPotionEffectPerm", pEffectType.getName().toLowerCase(Locale.ENGLISH)));
} }
} }
else 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"))) else if (split[0].equalsIgnoreCase("power") || (allowShortName && split[0].equalsIgnoreCase("p")))
@ -391,7 +391,7 @@ public class MetaItemStack
} }
else 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"))) else if (split[0].equalsIgnoreCase("duration") || (allowShortName && split[0].equalsIgnoreCase("d")))
@ -403,7 +403,7 @@ public class MetaItemStack
} }
else 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); pEffect = pEffectType.createEffect(duration, power);
if (pmeta.getCustomEffects().size() > 1 && !hasMetaPermission(sender, "potions.multiple", true, false, ess)) 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); pmeta.addCustomEffect(pEffect, true);
stack.setItemMeta(pmeta); stack.setItemMeta(pmeta);
@ -454,7 +454,7 @@ public class MetaItemStack
{ {
if (enchantment == null) if (enchantment == null)
{ {
throw new Exception(_("enchantmentNotFound")); throw new Exception(tl("enchantmentNotFound"));
} }
try try
{ {
@ -508,7 +508,7 @@ public class MetaItemStack
if (!hasMetaPermission(user, "enchantments." + enchantmentName, true, false)) if (!hasMetaPermission(user, "enchantments." + enchantmentName, true, false))
{ {
throw new Exception(_("enchantmentPerm", enchantmentName)); throw new Exception(tl("enchantmentPerm", enchantmentName));
} }
return enchantment; return enchantment;
} }
@ -533,7 +533,7 @@ public class MetaItemStack
} }
else else
{ {
throw new Exception(_("noMetaPerm", metaPerm)); throw new Exception(tl("noMetaPerm", metaPerm));
} }
} }
} }

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials; package com.earth2me.essentials;
import static com.earth2me.essentials.I18n._; import static com.earth2me.essentials.I18n.tl;
import java.util.*; import java.util.*;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
@ -95,7 +95,7 @@ public enum Mob
final Entity entity = world.spawn(loc, (Class<? extends Entity>)this.bukkitType.getEntityClass()); final Entity entity = world.spawn(loc, (Class<? extends Entity>)this.bukkitType.getEntityClass());
if (entity == null) if (entity == null)
{ {
logger.log(Level.WARNING, _("unableToSpawnMob")); logger.log(Level.WARNING, tl("unableToSpawnMob"));
throw new MobException(); throw new MobException();
} }
return entity; return entity;

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials; package com.earth2me.essentials;
import static com.earth2me.essentials.I18n._; import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.utils.StringUtil; import com.earth2me.essentials.utils.StringUtil;
import java.util.*; import java.util.*;
import java.util.logging.Logger; import java.util.logging.Logger;
@ -274,7 +274,7 @@ public enum MobData
} }
catch (Exception e) catch (Exception e)
{ {
throw new Exception(_("sheepMalformedColor"), e); throw new Exception(tl("sheepMalformedColor"), e);
} }
} }
else if (this.value.equals(Data.EXP)) else if (this.value.equals(Data.EXP))
@ -286,7 +286,7 @@ public enum MobData
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
throw new Exception(_("invalidNumber"), e); throw new Exception(tl("invalidNumber"), e);
} }
} }
else if (this.value.equals(Data.SIZE)) else if (this.value.equals(Data.SIZE))
@ -298,7 +298,7 @@ public enum MobData
} }
catch (NumberFormatException e) catch (NumberFormatException e)
{ {
throw new Exception(_("slimeMalformedSize"), e); throw new Exception(tl("slimeMalformedSize"), e);
} }
} }
else if (this.value instanceof Horse.Color) else if (this.value instanceof Horse.Color)

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials; package com.earth2me.essentials;
import static com.earth2me.essentials.I18n._; import static com.earth2me.essentials.I18n.tl;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.util.*; import java.util.*;
import lombok.Delegate; import lombok.Delegate;
@ -180,25 +180,25 @@ public class OfflinePlayer implements Player
@Override @Override
public int getRemainingAir() public int getRemainingAir()
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public void setRemainingAir(int i) public void setRemainingAir(int i)
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public int getMaximumAir() public int getMaximumAir()
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public void setMaximumAir(int i) public void setMaximumAir(int i)
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
@ -210,73 +210,73 @@ public class OfflinePlayer implements Player
@Override @Override
public void setSneaking(boolean bln) public void setSneaking(boolean bln)
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public void updateInventory() public void updateInventory()
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public void chat(String string) public void chat(String string)
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public double getEyeHeight() public double getEyeHeight()
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public double getEyeHeight(boolean bln) public double getEyeHeight(boolean bln)
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public List<Block> getLineOfSight(HashSet<Byte> hs, int i) public List<Block> getLineOfSight(HashSet<Byte> hs, int i)
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public Block getTargetBlock(HashSet<Byte> hs, int i) public Block getTargetBlock(HashSet<Byte> hs, int i)
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public List<Block> getLastTwoTargetBlocks(HashSet<Byte> hs, int i) public List<Block> getLastTwoTargetBlocks(HashSet<Byte> hs, int i)
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public int getFireTicks() public int getFireTicks()
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public int getMaxFireTicks() public int getMaxFireTicks()
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public void setFireTicks(int i) public void setFireTicks(int i)
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public void remove() public void remove()
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
@ -287,168 +287,168 @@ public class OfflinePlayer implements Player
public Vector getMomentum() public Vector getMomentum()
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
public void setMomentum(Vector vector) public void setMomentum(Vector vector)
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public void setVelocity(Vector vector) public void setVelocity(Vector vector)
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public Vector getVelocity() public Vector getVelocity()
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public void damage(double d) public void damage(double d)
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public void damage(double d, Entity entity) public void damage(double d, Entity entity)
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public Location getEyeLocation() public Location getEyeLocation()
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public void sendRawMessage(String string) public void sendRawMessage(String string)
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public Location getCompassTarget() public Location getCompassTarget()
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public int getMaximumNoDamageTicks() public int getMaximumNoDamageTicks()
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public void setMaximumNoDamageTicks(int i) public void setMaximumNoDamageTicks(int i)
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public double getLastDamage() public double getLastDamage()
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public void setLastDamage(double d) public void setLastDamage(double d)
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public int getNoDamageTicks() public int getNoDamageTicks()
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public void setNoDamageTicks(int i) public void setNoDamageTicks(int i)
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public boolean teleport(Location lctn) public boolean teleport(Location lctn)
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public boolean teleport(Entity entity) public boolean teleport(Entity entity)
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public Entity getPassenger() public Entity getPassenger()
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public boolean setPassenger(Entity entity) public boolean setPassenger(Entity entity)
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public boolean isEmpty() public boolean isEmpty()
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public boolean eject() public boolean eject()
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public void saveData() public void saveData()
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public void loadData() public void loadData()
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public boolean isSleeping() public boolean isSleeping()
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public int getSleepTicks() public int getSleepTicks()
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public List<Entity> getNearbyEntities(double d, double d1, double d2) public List<Entity> getNearbyEntities(double d, double d1, double d2)
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public boolean isDead() public boolean isDead()
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public float getFallDistance() public float getFallDistance()
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
@ -459,156 +459,175 @@ public class OfflinePlayer implements Player
@Override @Override
public void setSleepingIgnored(boolean bln) public void setSleepingIgnored(boolean bln)
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public boolean isSleepingIgnored() public boolean isSleepingIgnored()
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public void awardAchievement(Achievement a) public void awardAchievement(Achievement a)
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override
public void removeAchievement(Achievement achievement) public void removeAchievement(Achievement achievement)
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override
public boolean hasAchievement(Achievement achievement) public boolean hasAchievement(Achievement achievement)
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override
public void incrementStatistic(Statistic ststc) public void incrementStatistic(Statistic ststc)
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override
public void decrementStatistic(Statistic statistic) throws IllegalArgumentException public void decrementStatistic(Statistic statistic) throws IllegalArgumentException
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override
public void incrementStatistic(Statistic ststc, int i) 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 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 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 public int getStatistic(Statistic statistic) throws IllegalArgumentException
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public void incrementStatistic(Statistic ststc, Material mtrl) 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 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 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) 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 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 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 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 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 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 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) 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) public void setStatistic(Statistic statistic, EntityType entityType, int i)
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public void playNote(Location lctn, byte b, byte b1) public void playNote(Location lctn, byte b, byte b1)
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public void sendBlockChange(Location lctn, Material mtrl, byte b) public void sendBlockChange(Location lctn, Material mtrl, byte b)
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public void sendBlockChange(Location lctn, int i, byte b) public void sendBlockChange(Location lctn, int i, byte b)
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public void setLastDamageCause(EntityDamageEvent ede) public void setLastDamageCause(EntityDamageEvent ede)
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public EntityDamageEvent getLastDamageCause() public EntityDamageEvent getLastDamageCause()
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override
public void playEffect(Location lctn, Effect effect, int i) public void playEffect(Location lctn, Effect effect, int i)
{ {
throw new UnsupportedOperationException(_("notSupportedYet")); throw new UnsupportedOperationException(tl("notSupportedYet"));
} }
@Override @Override

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials; package com.earth2me.essentials;
import static com.earth2me.essentials.I18n._; import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.utils.FormatUtil; import com.earth2me.essentials.utils.FormatUtil;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
@ -30,11 +30,11 @@ public class PlayerList
needComma = true; needComma = true;
if (user.isAfk()) if (user.isAfk())
{ {
groupString.append(_("listAfkTag")); groupString.append(tl("listAfkTag"));
} }
if (user.isHidden()) if (user.isHidden())
{ {
groupString.append(_("listHiddenTag")); groupString.append(tl("listHiddenTag"));
} }
user.setDisplayNick(); user.setDisplayNick();
groupString.append(user.getDisplayName()); groupString.append(user.getDisplayName());
@ -58,11 +58,11 @@ public class PlayerList
String online; String online;
if (showHidden && playerHidden > 0) if (showHidden && playerHidden > 0)
{ {
online = _("listAmountHidden", server.getOnlinePlayers().length - playerHidden, playerHidden, server.getMaxPlayers()); online = tl("listAmountHidden", server.getOnlinePlayers().length - playerHidden, playerHidden, server.getMaxPlayers());
} }
else else
{ {
online = _("listAmount", server.getOnlinePlayers().length - playerHidden, server.getMaxPlayers()); online = tl("listAmount", server.getOnlinePlayers().length - playerHidden, server.getMaxPlayers());
} }
return online; return online;
} }
@ -132,7 +132,7 @@ public class PlayerList
} }
if (users == null || users.isEmpty()) if (users == null || users.isEmpty())
{ {
throw new Exception(_("groupDoesNotExist")); throw new Exception(tl("groupDoesNotExist"));
} }
final StringBuilder displayGroupName = new StringBuilder(); final StringBuilder displayGroupName = new StringBuilder();
displayGroupName.append(Character.toTitleCase(groupName.charAt(0))); displayGroupName.append(Character.toTitleCase(groupName.charAt(0)));
@ -144,7 +144,7 @@ public class PlayerList
public static String outputFormat(final String group, final String message) public static String outputFormat(final String group, final String message)
{ {
final StringBuilder outputString = new StringBuilder(); final StringBuilder outputString = new StringBuilder();
outputString.append(_("listGroupTag", FormatUtil.replaceFormat(group))); outputString.append(tl("listGroupTag", FormatUtil.replaceFormat(group)));
outputString.append(message); outputString.append(message);
return outputString.toString(); return outputString.toString();
} }

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials; 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.commands.IEssentialsCommand;
import com.earth2me.essentials.signs.EssentialsSign; import com.earth2me.essentials.signs.EssentialsSign;
import com.earth2me.essentials.signs.Signs; import com.earth2me.essentials.signs.Signs;
@ -570,7 +570,7 @@ public class Settings implements net.ess3.api.ISettings
} }
catch (Exception ex) catch (Exception ex)
{ {
logger.log(Level.SEVERE, _("unknownItemInList", itemName, "item-spawn-blacklist")); logger.log(Level.SEVERE, tl("unknownItemInList", itemName, "item-spawn-blacklist"));
} }
} }
return epItemSpwn; return epItemSpwn;
@ -606,7 +606,7 @@ public class Settings implements net.ess3.api.ISettings
} }
catch (Exception ex) catch (Exception ex)
{ {
logger.log(Level.SEVERE, _("unknownItemInList", signName, "enabledSigns")); logger.log(Level.SEVERE, tl("unknownItemInList", signName, "enabledSigns"));
continue; continue;
} }
signsEnabled = true; signsEnabled = true;
@ -710,7 +710,7 @@ public class Settings implements net.ess3.api.ISettings
} }
catch (Exception ex) catch (Exception ex)
{ {
logger.log(Level.SEVERE, _("unknownItemInList", itemName, configName)); logger.log(Level.SEVERE, tl("unknownItemInList", itemName, configName));
} }
} }
return list; return list;

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials; 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.Mob.MobException;
import com.earth2me.essentials.utils.LocationUtil; import com.earth2me.essentials.utils.LocationUtil;
import com.earth2me.essentials.utils.StringUtil; import com.earth2me.essentials.utils.StringUtil;
@ -34,7 +34,7 @@ public class SpawnMob
} }
if (availableList.isEmpty()) if (availableList.isEmpty())
{ {
availableList.add(_("none")); availableList.add(tl("none"));
} }
return StringUtil.joinList(availableList); return StringUtil.joinList(availableList);
} }
@ -88,7 +88,7 @@ public class SpawnMob
final Block block = LocationUtil.getTarget(user.getBase()).getBlock(); final Block block = LocationUtil.getTarget(user.getBase()).getBlock();
if (block == null) if (block == null)
{ {
throw new Exception(_("unableToSpawnMob")); throw new Exception(tl("unableToSpawnMob"));
} }
spawnmob(ess, server, user.getSource(), user, block.getLocation(), parts, data, mobCount); spawnmob(ess, server, user.getSource(), user, block.getLocation(), parts, data, mobCount);
} }
@ -125,7 +125,7 @@ public class SpawnMob
if (mobCount > effectiveLimit) if (mobCount > effectiveLimit)
{ {
mobCount = effectiveLimit; mobCount = effectiveLimit;
sender.sendMessage(_("mobSpawnLimit")); sender.sendMessage(tl("mobSpawnLimit"));
} }
Mob mob = Mob.fromName(parts.get(0)); // Get the first mob 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); 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) catch (MobException e1)
{ {
throw new Exception(_("unableToSpawnMob"), e1); throw new Exception(tl("unableToSpawnMob"), e1);
} }
catch (NumberFormatException e2) catch (NumberFormatException e2)
{ {
throw new Exception(_("numberRequired"), e2); throw new Exception(tl("numberRequired"), e2);
} }
catch (NullPointerException np) catch (NullPointerException np)
{ {
throw new Exception(_("soloMob"), np); throw new Exception(tl("soloMob"), np);
} }
} }
@ -194,17 +194,17 @@ public class SpawnMob
{ {
if (mob == null) if (mob == null)
{ {
throw new Exception(_("invalidMob")); throw new Exception(tl("invalidMob"));
} }
if (ess.getSettings().getProtectPreventSpawn(mob.getType().toString().toLowerCase(Locale.ENGLISH))) 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))) 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()) 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) if (spawned instanceof Zombie || type == EntityType.SKELETON)

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials; 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.DateUtil;
import com.earth2me.essentials.utils.LocationUtil; import com.earth2me.essentials.utils.LocationUtil;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -54,7 +54,7 @@ public class Teleport implements net.ess3.api.ITeleport
time.setTimeInMillis(lastTime); time.setTimeInMillis(lastTime);
time.add(Calendar.SECOND, (int)cooldown); time.add(Calendar.SECOND, (int)cooldown);
time.add(Calendar.MILLISECOND, (int)((cooldown * 1000.0) % 1000.0)); 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 // 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(); Calendar c = new GregorianCalendar();
c.add(Calendar.SECOND, (int)delay); c.add(Calendar.SECOND, (int)delay);
c.add(Calendar.MILLISECOND, (int)((delay * 1000.0) % 1000.0)); 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. //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); final ITarget target = new PlayerTarget(entity);
now(teleportOwner, target, cause); 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 protected void now(IUser teleportee, ITarget target, TeleportCause cause) throws Exception
@ -114,7 +114,7 @@ public class Teleport implements net.ess3.api.ITeleport
} }
else 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 else
@ -148,7 +148,7 @@ public class Teleport implements net.ess3.api.ITeleport
{ {
ITarget target = new PlayerTarget(entity); ITarget target = new PlayerTarget(entity);
teleport(teleportOwner, target, chargeFor, cause); 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 //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); ITarget target = new PlayerTarget(entity);
teleport(teleportee, target, chargeFor, cause); teleport(teleportee, target, chargeFor, cause);
teleportee.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(_("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 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 public void warp(IUser teleportee, String warp, Trade chargeFor, TeleportCause cause) throws Exception
{ {
Location loc = ess.getWarps().getWarp(warp); 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); 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 public void back(Trade chargeFor) throws Exception
{ {
final Location loc = teleportOwner.getLastLocation(); 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); teleport(teleportOwner, new LocationTarget(loc), chargeFor, TeleportCause.COMMAND);
} }

View File

@ -1,8 +1,6 @@
package com.earth2me.essentials; package com.earth2me.essentials;
import static com.earth2me.essentials.I18n._; import static com.earth2me.essentials.I18n.tl;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.ess3.api.IEssentials; import net.ess3.api.IEssentials;
import net.ess3.api.IUser; import net.ess3.api.IUser;
import org.bukkit.Location; import org.bukkit.Location;
@ -100,16 +98,16 @@ public class TimedTeleport implements Runnable
} }
catch (Exception ex) catch (Exception ex)
{ {
teleportOwner.sendMessage(_("cooldownWithMessage", ex.getMessage())); teleportOwner.sendMessage(tl("cooldownWithMessage", ex.getMessage()));
if (teleportOwner != teleportUser) if (teleportOwner != teleportUser)
{ {
teleportUser.sendMessage(_("cooldownWithMessage", ex.getMessage())); teleportUser.sendMessage(tl("cooldownWithMessage", ex.getMessage()));
} }
} }
try try
{ {
cancelTimer(false); cancelTimer(false);
teleportUser.sendMessage(_("teleportationCommencing")); teleportUser.sendMessage(tl("teleportationCommencing"));
timer_chargeFor.isAffordableFor(teleportOwner); timer_chargeFor.isAffordableFor(teleportOwner);
if (timer_respawn) if (timer_respawn)
{ {
@ -144,10 +142,10 @@ public class TimedTeleport implements Runnable
ess.getServer().getScheduler().cancelTask(timer_task); ess.getServer().getScheduler().cancelTask(timer_task);
if (notifyUser) if (notifyUser)
{ {
teleportOwner.sendMessage(_("pendingTeleportCancelled")); teleportOwner.sendMessage(tl("pendingTeleportCancelled"));
if (timer_teleportee != null && !timer_teleportee.equals(teleportOwner.getName())) if (timer_teleportee != null && !timer_teleportee.equals(teleportOwner.getName()))
{ {
ess.getUser(timer_teleportee).sendMessage(_("pendingTeleportCancelled")); ess.getUser(timer_teleportee).sendMessage(tl("pendingTeleportCancelled"));
} }
} }
} }

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials; 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.InventoryWorkaround;
import com.earth2me.essentials.craftbukkit.SetExpFix; import com.earth2me.essentials.craftbukkit.SetExpFix;
import java.io.File; import java.io.File;
@ -99,13 +99,13 @@ public class Trade
&& getMoney().signum() > 0 && getMoney().signum() > 0
&& !user.canAfford(getMoney())) && !user.canAfford(getMoney()))
{ {
throw new ChargeException(_("notEnoughMoney")); throw new ChargeException(tl("notEnoughMoney"));
} }
if (getItemStack() != null if (getItemStack() != null
&& !user.getBase().getInventory().containsAtLeast(itemStack, itemStack.getAmount())) && !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; BigDecimal money;
@ -113,13 +113,13 @@ public class Trade
&& (money = getCommandCost(user)).signum() > 0 && (money = getCommandCost(user)).signum() > 0
&& !user.canAfford(money)) && !user.canAfford(money))
{ {
throw new ChargeException(_("notEnoughMoney")); throw new ChargeException(tl("notEnoughMoney"));
} }
if (exp != null && exp > 0 if (exp != null && exp > 0
&& SetExpFix.getTotalExperience(user.getBase()) < exp) && 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) if (!user.canAfford(getMoney()) && getMoney().signum() > 0)
{ {
throw new ChargeException(_("notEnoughMoney")); throw new ChargeException(tl("notEnoughMoney"));
} }
user.takeMoney(getMoney()); user.takeMoney(getMoney());
} }
@ -235,7 +235,7 @@ public class Trade
} }
if (!user.getBase().getInventory().containsAtLeast(getItemStack(), getItemStack().getAmount())) 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().getInventory().removeItem(getItemStack());
user.getBase().updateInventory(); user.getBase().updateInventory();
@ -245,7 +245,7 @@ public class Trade
final BigDecimal cost = getCommandCost(user); final BigDecimal cost = getCommandCost(user);
if (!user.canAfford(cost) && cost.signum() > 0) if (!user.canAfford(cost) && cost.signum() > 0)
{ {
throw new ChargeException(_("notEnoughMoney")); throw new ChargeException(tl("notEnoughMoney"));
} }
user.takeMoney(cost); user.takeMoney(cost);
} }
@ -258,7 +258,7 @@ public class Trade
final int experience = SetExpFix.getTotalExperience(user.getBase()); final int experience = SetExpFix.getTotalExperience(user.getBase());
if (experience < getExperience() && getExperience() > 0) if (experience < getExperience() && getExperience() > 0)
{ {
throw new ChargeException(_("notEnoughExperience")); throw new ChargeException(tl("notEnoughExperience"));
} }
SetExpFix.setTotalExperience(user.getBase(), experience - getExperience()); SetExpFix.setTotalExperience(user.getBase(), experience - getExperience());
} }

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials; 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.commands.IEssentialsCommand;
import com.earth2me.essentials.register.payment.Method; import com.earth2me.essentials.register.payment.Method;
import com.earth2me.essentials.register.payment.Methods; import com.earth2me.essentials.register.payment.Methods;
@ -18,7 +18,6 @@ import net.ess3.api.events.AfkStatusChangeEvent;
import net.ess3.api.events.UserBalanceUpdateEvent; import net.ess3.api.events.UserBalanceUpdateEvent;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
import org.bukkit.potion.PotionEffect; 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)); cooldownTime.add(Calendar.MILLISECOND, (int)((cooldown * 1000.0) % 1000.0));
if (cooldownTime.after(now) && !isAuthorized("essentials.heal.cooldown.bypass")) 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()); setLastHealTimestamp(now.getTimeInMillis());
@ -149,10 +148,10 @@ public class User extends UserData implements Comparable<User>, IReplyTo, net.es
return; return;
} }
setMoney(getMoney().add(value)); setMoney(getMoney().add(value));
sendMessage(_("addedToAccount", NumberUtil.displayCurrency(value, ess))); sendMessage(tl("addedToAccount", NumberUtil.displayCurrency(value, ess)));
if (initiator != null) 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)); setMoney(getMoney().subtract(value));
reciever.setMoney(reciever.getMoney().add(value)); reciever.setMoney(reciever.getMoney().add(value));
sendMessage(_("moneySentTo", NumberUtil.displayCurrency(value, ess), reciever.getDisplayName())); sendMessage(tl("moneySentTo", NumberUtil.displayCurrency(value, ess), reciever.getDisplayName()));
reciever.sendMessage(_("moneyRecievedFrom", NumberUtil.displayCurrency(value, ess), getDisplayName())); reciever.sendMessage(tl("moneyRecievedFrom", NumberUtil.displayCurrency(value, ess), getDisplayName()));
} }
else 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 //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) 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); setJailTimeout(0);
setJailed(false); setJailed(false);
sendMessage(_("haveBeenReleased")); sendMessage(tl("haveBeenReleased"));
setJail(null); setJail(null);
try try
{ {
@ -563,7 +562,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, net.es
if (getMuteTimeout() > 0 && getMuteTimeout() < currentTime && isMuted()) if (getMuteTimeout() > 0 && getMuteTimeout() < currentTime && isMuted())
{ {
setMuteTimeout(0); setMuteTimeout(0);
sendMessage(_("canTalkAgain")); sendMessage(tl("canTalkAgain"));
setMuted(false); setMuted(false);
return true; return true;
} }
@ -590,7 +589,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, net.es
if (broadcast && !isHidden()) if (broadcast && !isHidden())
{ {
setDisplayNick(); setDisplayNick();
final String msg = _("userIsNotAway", getDisplayName()); final String msg = tl("userIsNotAway", getDisplayName());
if (!msg.isEmpty()) if (!msg.isEmpty())
{ {
ess.broadcastMessage(this, msg); 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() if (autoafkkick > 0 && lastActivity > 0 && (lastActivity + (autoafkkick * 1000)) < System.currentTimeMillis()
&& !isHidden() && !isAuthorized("essentials.kick.exempt") && !isAuthorized("essentials.afk.kickexempt")) && !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; lastActivity = 0;
this.getBase().kickPlayer(kickReason); 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); final User user = ess.getUser(player);
if (user.isAuthorized("essentials.kick.notify")) 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()) if (!isHidden())
{ {
setDisplayNick(); setDisplayNick();
final String msg = _("userIsAway", getDisplayName()); final String msg = tl("userIsAway", getDisplayName());
if (!msg.isEmpty()) if (!msg.isEmpty())
{ {
ess.broadcastMessage(this, msg); ess.broadcastMessage(this, msg);

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials; 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.NumberUtil;
import com.earth2me.essentials.utils.StringUtil; import com.earth2me.essentials.utils.StringUtil;
import java.io.File; import java.io.File;
@ -211,7 +211,7 @@ public abstract class UserData extends PlayerExtension implements IConf
} }
else else
{ {
throw new Exception(_("invalidHome", search)); throw new Exception(tl("invalidHome", search));
} }
} }

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials; 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.commands.WarpNotFoundException;
import com.earth2me.essentials.utils.StringUtil; import com.earth2me.essentials.utils.StringUtil;
import java.io.File; import java.io.File;
@ -71,7 +71,7 @@ public class Warps implements IConf, net.ess3.api.IWarps
File confFile = new File(warpsFolder, filename + ".yml"); File confFile = new File(warpsFolder, filename + ".yml");
if (confFile.exists()) if (confFile.exists())
{ {
throw new Exception(_("similarWarpExist")); throw new Exception(tl("similarWarpExist"));
} }
conf = new EssentialsConf(confFile); conf = new EssentialsConf(confFile);
warpPoints.put(new StringIgnoreCase(name), conf); warpPoints.put(new StringIgnoreCase(name), conf);
@ -84,7 +84,7 @@ public class Warps implements IConf, net.ess3.api.IWarps
} }
catch (IOException ex) 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)); EssentialsConf conf = warpPoints.get(new StringIgnoreCase(name));
if (conf == null) if (conf == null)
{ {
throw new Exception(_("warpNotExist")); throw new Exception(tl("warpNotExist"));
} }
if (!conf.getFile().delete()) if (!conf.getFile().delete())
{ {
throw new Exception(_("warpDeleteError")); throw new Exception(tl("warpDeleteError"));
} }
warpPoints.remove(new StringIgnoreCase(name)); warpPoints.remove(new StringIgnoreCase(name));
} }
@ -127,7 +127,7 @@ public class Warps implements IConf, net.ess3.api.IWarps
} }
catch (Exception ex) catch (Exception ex)
{ {
logger.log(Level.WARNING, _("loadWarpError", filename), ex); logger.log(Level.WARNING, tl("loadWarpError", filename), ex);
} }
} }
} }

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials; package com.earth2me.essentials;
import static com.earth2me.essentials.I18n._; import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.commands.NotEnoughArgumentsException; import com.earth2me.essentials.commands.NotEnoughArgumentsException;
import java.io.File; import java.io.File;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -85,7 +85,7 @@ public class Worth implements IConf
{ {
if (is == null || is.getType() == Material.AIR) if (is == null || is.getType() == Material.AIR)
{ {
throw new Exception(_("itemSellAir")); throw new Exception(tl("itemSellAir"));
} }
int id = is.getTypeId(); int id = is.getTypeId();
int amount = 0; int amount = 0;
@ -111,7 +111,7 @@ public class Worth implements IConf
if (requireStack && !stack) if (requireStack && !stack)
{ {
throw new Exception(_("itemMustBeStacked")); throw new Exception(tl("itemMustBeStacked"));
} }
int max = 0; int max = 0;
@ -141,9 +141,9 @@ public class Worth implements IConf
{ {
if (!isBulkSell) if (!isBulkSell)
{ {
user.sendMessage(_("itemNotEnough2")); user.sendMessage(tl("itemNotEnough2"));
user.sendMessage(_("itemNotEnough3")); user.sendMessage(tl("itemNotEnough3"));
throw new Exception(_("itemNotEnough1")); throw new Exception(tl("itemNotEnough1"));
} }
else else
{ {

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.api; package com.earth2me.essentials.api;
import com.earth2me.essentials.EssentialsConf; import com.earth2me.essentials.EssentialsConf;
import static com.earth2me.essentials.I18n._; import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import static com.earth2me.essentials.api.Economy.add; import static com.earth2me.essentials.api.Economy.add;
import static com.earth2me.essentials.api.Economy.divide; import static com.earth2me.essentials.api.Economy.divide;
@ -73,7 +73,7 @@ public class Economy
{ {
if (!config.delete()) if (!config.delete())
{ {
logger.log(Level.WARNING, _("deleteFileError", config)); logger.log(Level.WARNING, tl("deleteFileError", config));
} }
ess.getUserMap().removeUser(name); ess.getUserMap().removeUser(name);
} }

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials.api; package com.earth2me.essentials.api;
import static com.earth2me.essentials.I18n._; import static com.earth2me.essentials.I18n.tl;
public class InvalidWorldException extends Exception public class InvalidWorldException extends Exception
@ -9,7 +9,7 @@ public class InvalidWorldException extends Exception
public InvalidWorldException(final String world) public InvalidWorldException(final String world)
{ {
super(_("invalidWorld")); super(tl("invalidWorld"));
this.world = world; this.world = world;
} }

View File

@ -1,12 +1,12 @@
package com.earth2me.essentials.api; package com.earth2me.essentials.api;
import static com.earth2me.essentials.I18n._; import static com.earth2me.essentials.I18n.tl;
public class UserDoesNotExistException extends Exception public class UserDoesNotExistException extends Exception
{ {
public UserDoesNotExistException(String name) public UserDoesNotExistException(String name)
{ {
super(_("userDoesNotExist", name)); super(tl("userDoesNotExist", name));
} }
} }

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.User;
import org.bukkit.Server; import org.bukkit.Server;
@ -50,7 +50,7 @@ public class Commandafk extends EssentialsCommand
//user.sendMessage(_("markedAsNotAway")); //user.sendMessage(_("markedAsNotAway"));
if (!user.isHidden()) if (!user.isHidden())
{ {
msg = _("userIsNotAway", user.getDisplayName()); msg = tl("userIsNotAway", user.getDisplayName());
} }
user.updateActivity(false); user.updateActivity(false);
} }
@ -59,7 +59,7 @@ public class Commandafk extends EssentialsCommand
//user.sendMessage(_("markedAsAway")); //user.sendMessage(_("markedAsAway"));
if (!user.isHidden()) if (!user.isHidden())
{ {
msg = _("userIsAway", user.getDisplayName()); msg = tl("userIsAway", user.getDisplayName());
} }
} }
if (!msg.isEmpty()) if (!msg.isEmpty())

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials.commands; 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.Trade;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import org.bukkit.Server; import org.bukkit.Server;
@ -18,12 +18,12 @@ public class Commandback extends EssentialsCommand
{ {
if (user.getLastLocation() == null) if (user.getLastLocation() == null)
{ {
throw new Exception(_("noLocationFound")); throw new Exception(tl("noLocationFound"));
} }
if (user.getWorld() != user.getLastLocation().getWorld() && ess.getSettings().isWorldTeleportPermissions() if (user.getWorld() != user.getLastLocation().getWorld() && ess.getSettings().isWorldTeleportPermissions()
&& !user.isAuthorized("essentials.worlds." + user.getLastLocation().getWorld().getName())) && !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); final Trade charge = new Trade(this.getName(), ess);
charge.isAffordableFor(user); charge.isAffordableFor(user);

View File

@ -2,7 +2,7 @@ package com.earth2me.essentials.commands;
import com.earth2me.essentials.Backup; import com.earth2me.essentials.Backup;
import com.earth2me.essentials.CommandSource; import com.earth2me.essentials.CommandSource;
import static com.earth2me.essentials.I18n._; import static com.earth2me.essentials.I18n.tl;
import org.bukkit.Server; import org.bukkit.Server;
@ -19,14 +19,14 @@ public class Commandbackup extends EssentialsCommand
final Backup backup = ess.getBackup(); final Backup backup = ess.getBackup();
if (backup == null) if (backup == null)
{ {
throw new Exception(_("backupDisabled")); throw new Exception(tl("backupDisabled"));
} }
final String command = ess.getSettings().getBackupCommand(); final String command = ess.getSettings().getBackupCommand();
if (command == null || "".equals(command) || "save-all".equalsIgnoreCase(command)) if (command == null || "".equals(command) || "save-all".equalsIgnoreCase(command))
{ {
throw new Exception(_("backupDisabled")); throw new Exception(tl("backupDisabled"));
} }
backup.run(); backup.run();
sender.sendMessage(_("backupStarted")); sender.sendMessage(tl("backupStarted"));
} }
} }

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.User;
import com.earth2me.essentials.utils.NumberUtil; import com.earth2me.essentials.utils.NumberUtil;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -24,7 +24,7 @@ public class Commandbalance extends EssentialsCommand
} }
User target = getPlayer(server, args, 0, true, true); 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 @Override
@ -34,12 +34,12 @@ public class Commandbalance extends EssentialsCommand
{ {
final User target = getPlayer(server, args, 0, true, true); final User target = getPlayer(server, args, 0, true, true);
final BigDecimal bal = target.getMoney(); 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) else if (args.length < 2)
{ {
final BigDecimal bal = user.getMoney(); final BigDecimal bal = user.getMoney();
user.sendMessage(_("balance", NumberUtil.displayCurrency(bal, ess))); user.sendMessage(tl("balance", NumberUtil.displayCurrency(bal, ess)));
} }
else else
{ {

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.User;
import com.earth2me.essentials.textreader.SimpleTextInput; import com.earth2me.essentials.textreader.SimpleTextInput;
import com.earth2me.essentials.textreader.TextPager; import com.earth2me.essentials.textreader.TextPager;
@ -12,7 +12,6 @@ import java.util.*;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.concurrent.locks.ReentrantReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.entity.Player;
public class Commandbalancetop extends EssentialsCommand public class Commandbalancetop extends EssentialsCommand
@ -59,7 +58,7 @@ public class Commandbalancetop extends EssentialsCommand
} }
if (ess.getUserMap().getUniqueUsers() > MINUSERS) if (ess.getUserMap().getUniqueUsers() > MINUSERS)
{ {
sender.sendMessage(_("orderBalances", ess.getUserMap().getUniqueUsers())); sender.sendMessage(tl("orderBalances", ess.getUserMap().getUniqueUsers()));
} }
} }
finally finally
@ -72,7 +71,7 @@ public class Commandbalancetop extends EssentialsCommand
{ {
if (ess.getUserMap().getUniqueUsers() > MINUSERS) 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)); ess.runTaskAsynchronously(new Viewer(sender, page, force));
} }
@ -84,7 +83,7 @@ public class Commandbalancetop extends EssentialsCommand
final Calendar cal = Calendar.getInstance(); final Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(cacheage); cal.setTimeInMillis(cacheage);
final DateFormat format = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT); 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); 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; int pos = 1;
for (Map.Entry<String, BigDecimal> entry : sortedEntries) for (Map.Entry<String, BigDecimal> entry : sortedEntries)
{ {

View File

@ -2,7 +2,7 @@ package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; import com.earth2me.essentials.CommandSource;
import com.earth2me.essentials.Console; 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.OfflinePlayer;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import com.earth2me.essentials.utils.FormatUtil; 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")) if (sender.isPlayer() && !ess.getUser(sender.getPlayer()).isAuthorized("essentials.ban.offline"))
{ {
throw new Exception(_("banExemptOffline")); throw new Exception(tl("banExemptOffline"));
} }
} }
else else
{ {
if (user.isAuthorized("essentials.ban.exempt") && sender.isPlayer()) 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 else
{ {
banReason = _("defaultBanReason"); banReason = tl("defaultBanReason");
} }
user.setBanReason(_("banFormat", banReason, senderName)); user.setBanReason(tl("banFormat", banReason, senderName));
user.setBanned(true); user.setBanned(true);
user.setBanTimeout(0); 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) 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));
} }
} }

View File

@ -2,7 +2,7 @@ package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; import com.earth2me.essentials.CommandSource;
import com.earth2me.essentials.Console; 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.User;
import com.earth2me.essentials.utils.FormatUtil; import com.earth2me.essentials.utils.FormatUtil;
import java.util.logging.Level; import java.util.logging.Level;
@ -50,8 +50,8 @@ public class Commandbanip extends EssentialsCommand
} }
ess.getServer().banIP(ipAddress); 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));
} }
} }

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials.commands; 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.User;
import com.earth2me.essentials.utils.LocationUtil; import com.earth2me.essentials.utils.LocationUtil;
import org.bukkit.Location; import org.bukkit.Location;
@ -41,11 +41,11 @@ public class Commandbigtree extends EssentialsCommand
final boolean success = user.getWorld().generateTree(safeLocation, tree); final boolean success = user.getWorld().generateTree(safeLocation, tree);
if (success) if (success)
{ {
user.sendMessage(_("bigTreeSuccess")); user.sendMessage(tl("bigTreeSuccess"));
} }
else else
{ {
throw new Exception(_("bigTreeFailure")); throw new Exception(tl("bigTreeFailure"));
} }
} }
} }

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials.commands; 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.User;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Server; import org.bukkit.Server;
@ -31,11 +31,11 @@ public class Commandbook extends EssentialsCommand
{ {
bmeta.setAuthor(args[1]); bmeta.setAuthor(args[1]);
item.setItemMeta(bmeta); item.setItemMeta(bmeta);
user.sendMessage(_("bookAuthorSet", getFinalArg(args, 1))); user.sendMessage(tl("bookAuthorSet", getFinalArg(args, 1)));
} }
else else
{ {
throw new Exception(_("denyChangeAuthor")); throw new Exception(tl("denyChangeAuthor"));
} }
} }
else if (args.length > 1 && args[0].equalsIgnoreCase("title")) else if (args.length > 1 && args[0].equalsIgnoreCase("title"))
@ -44,11 +44,11 @@ public class Commandbook extends EssentialsCommand
{ {
bmeta.setTitle(args[1]); bmeta.setTitle(args[1]);
item.setItemMeta(bmeta); item.setItemMeta(bmeta);
user.sendMessage(_("bookTitleSet", getFinalArg(args, 1))); user.sendMessage(tl("bookTitleSet", getFinalArg(args, 1)));
} }
else else
{ {
throw new Exception(_("denyChangeTitle")); throw new Exception(tl("denyChangeTitle"));
} }
} }
else else
@ -58,11 +58,11 @@ public class Commandbook extends EssentialsCommand
ItemStack newItem = new ItemStack(Material.BOOK_AND_QUILL, item.getAmount()); ItemStack newItem = new ItemStack(Material.BOOK_AND_QUILL, item.getAmount());
newItem.setItemMeta(bmeta); newItem.setItemMeta(bmeta);
user.setItemInHand(newItem); user.setItemInHand(newItem);
user.sendMessage(_("editBookContents")); user.sendMessage(tl("editBookContents"));
} }
else 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()); ItemStack newItem = new ItemStack(Material.WRITTEN_BOOK, item.getAmount());
newItem.setItemMeta(bmeta); newItem.setItemMeta(bmeta);
user.setItemInHand(newItem); user.setItemInHand(newItem);
user.sendMessage(_("bookLocked")); user.sendMessage(tl("bookLocked"));
} }
else else
{ {
throw new Exception(_("holdBook")); throw new Exception(tl("holdBook"));
} }
} }

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials.commands; 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.User;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Server; import org.bukkit.Server;
@ -30,7 +30,7 @@ public class Commandbreak extends EssentialsCommand
} }
if (block.getType() == Material.BEDROCK && !user.isAuthorized("essentials.break.bedrock")) 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 List<ItemStack> list = (List<ItemStack>)block.getDrops();
//final BlockBreakEvent event = new BlockBreakEvent(block, user.getBase(), list); //final BlockBreakEvent event = new BlockBreakEvent(block, user.getBase(), list);

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.User;
import com.earth2me.essentials.utils.FormatUtil; import com.earth2me.essentials.utils.FormatUtil;
import org.bukkit.Server; import org.bukkit.Server;
@ -33,6 +33,6 @@ public class Commandbroadcast extends EssentialsCommand
throw new NotEnoughArgumentsException(); 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));
} }
} }

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.User;
import org.bukkit.Server; import org.bukkit.Server;
@ -28,6 +28,6 @@ public class Commandburn extends EssentialsCommand
User user = getPlayer(server, sender, args, 0); User user = getPlayer(server, sender, args, 0);
user.setFireTicks(Integer.parseInt(args[1]) * 20); 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])));
} }
} }

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.User;
import com.earth2me.essentials.utils.NumberUtil; import com.earth2me.essentials.utils.NumberUtil;
import java.util.ArrayList; import java.util.ArrayList;
@ -46,7 +46,7 @@ public class Commandclearinventory extends EssentialsCommand
if (allowAll && args.length > 0 && args[0].contentEquals("*")) if (allowAll && args.length > 0 && args[0].contentEquals("*"))
{ {
sender.sendMessage(_("inventoryClearingFromAll")); sender.sendMessage(tl("inventoryClearingFromAll"));
offset = 1; offset = 1;
players = Arrays.asList(server.getOnlinePlayers()); players = Arrays.asList(server.getOnlinePlayers());
} }
@ -103,7 +103,7 @@ public class Commandclearinventory extends EssentialsCommand
{ {
if (showExtended) if (showExtended)
{ {
sender.sendMessage(_("inventoryClearingAllItems", player.getDisplayName())); sender.sendMessage(tl("inventoryClearingAllItems", player.getDisplayName()));
} }
player.getInventory().clear(); player.getInventory().clear();
} }
@ -111,7 +111,7 @@ public class Commandclearinventory extends EssentialsCommand
{ {
if (showExtended) if (showExtended)
{ {
sender.sendMessage(_("inventoryClearingAllArmor", player.getDisplayName())); sender.sendMessage(tl("inventoryClearingAllArmor", player.getDisplayName()));
} }
player.getInventory().clear(); player.getInventory().clear();
player.getInventory().setArmorContents(null); player.getInventory().setArmorContents(null);
@ -123,7 +123,7 @@ public class Commandclearinventory extends EssentialsCommand
ItemStack stack = new ItemStack(type); ItemStack stack = new ItemStack(type);
if (showExtended) 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); player.getInventory().clear(type, data);
} }
@ -134,7 +134,7 @@ public class Commandclearinventory extends EssentialsCommand
final int removedAmount = (BASE_AMOUNT - removedStack.getAmount()); final int removedAmount = (BASE_AMOUNT - removedStack.getAmount());
if (removedAmount > 0 || showExtended) 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 else
@ -146,14 +146,14 @@ public class Commandclearinventory extends EssentialsCommand
ItemStack stack = new ItemStack(type, amount, data); ItemStack stack = new ItemStack(type, amount, data);
if (player.getInventory().containsAtLeast(stack, amount)) 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); player.getInventory().removeItem(stack);
} }
else else
{ {
if (showExtended) 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)));
} }
} }
} }

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials.commands; 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.User;
import org.bukkit.Server; import org.bukkit.Server;
@ -53,6 +53,6 @@ public class Commandcompass extends EssentialsCommand
{ {
dir = "N"; dir = "N";
} }
user.sendMessage(_("compassBearing", dir, bearing)); user.sendMessage(tl("compassBearing", dir, bearing));
} }
} }

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.User;
import java.util.Locale; import java.util.Locale;
import org.bukkit.Server; import org.bukkit.Server;
@ -53,10 +53,10 @@ public class Commanddelhome extends EssentialsCommand
if (name.equalsIgnoreCase("bed")) if (name.equalsIgnoreCase("bed"))
{ {
throw new Exception(_("invalidHomeName")); throw new Exception(tl("invalidHomeName"));
} }
user.delHome(name.toLowerCase(Locale.ENGLISH)); user.delHome(name.toLowerCase(Locale.ENGLISH));
sender.sendMessage(_("deleteHome", name)); sender.sendMessage(tl("deleteHome", name));
} }
} }

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; import com.earth2me.essentials.CommandSource;
import static com.earth2me.essentials.I18n._; import static com.earth2me.essentials.I18n.tl;
import org.bukkit.Server; import org.bukkit.Server;
@ -21,6 +21,6 @@ public class Commanddeljail extends EssentialsCommand
} }
ess.getJails().removeJail(args[0]); ess.getJails().removeJail(args[0]);
sender.sendMessage(_("deleteJail", args[0])); sender.sendMessage(tl("deleteJail", args[0]));
} }
} }

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; import com.earth2me.essentials.CommandSource;
import static com.earth2me.essentials.I18n._; import static com.earth2me.essentials.I18n.tl;
import org.bukkit.Server; import org.bukkit.Server;
@ -21,6 +21,6 @@ public class Commanddelwarp extends EssentialsCommand
} }
ess.getWarps().removeWarp(args[0]); ess.getWarps().removeWarp(args[0]);
sender.sendMessage(_("deleteWarp", args[0])); sender.sendMessage(tl("deleteWarp", args[0]));
} }
} }

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials.commands; 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.User;
import org.bukkit.Server; import org.bukkit.Server;
@ -18,15 +18,15 @@ public class Commanddepth extends EssentialsCommand
final int depth = user.getLocation().getBlockY() - 63; final int depth = user.getLocation().getBlockY() - 63;
if (depth > 0) if (depth > 0)
{ {
user.sendMessage(_("depthAboveSea", depth)); user.sendMessage(tl("depthAboveSea", depth));
} }
else if (depth < 0) else if (depth < 0)
{ {
user.sendMessage(_("depthBelowSea", (-depth))); user.sendMessage(tl("depthBelowSea", (-depth)));
} }
else else
{ {
user.sendMessage(_("depth")); user.sendMessage(tl("depth"));
} }
} }
} }

View File

@ -2,13 +2,11 @@ package com.earth2me.essentials.commands;
import com.earth2me.essentials.ChargeException; import com.earth2me.essentials.ChargeException;
import com.earth2me.essentials.CommandSource; 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.User;
import com.earth2me.essentials.utils.NumberUtil; import com.earth2me.essentials.utils.NumberUtil;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Locale; import java.util.Locale;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.ess3.api.MaxMoneyException; import net.ess3.api.MaxMoneyException;
import org.bukkit.Server; import org.bukkit.Server;
@ -49,11 +47,11 @@ public class Commandeco extends EssentialsLoopCommand
{ {
if (args[1].contentEquals("**")) if (args[1].contentEquals("**"))
{ {
server.broadcastMessage(_("resetBalAll", NumberUtil.displayCurrency(amount, ess))); server.broadcastMessage(tl("resetBalAll", NumberUtil.displayCurrency(amount, ess)));
} }
else if (args[1].contentEquals("*")) 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 // 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 else
{ {
throw new ChargeException(_("insufficientFunds")); throw new ChargeException(tl("insufficientFunds"));
} }
} }
@ -109,10 +107,10 @@ public class Commandeco extends EssentialsLoopCommand
BigDecimal minBalance = ess.getSettings().getMinMoney(); BigDecimal minBalance = ess.getSettings().getMinMoney();
boolean underMinimum = (amount.compareTo(minBalance) < 0); boolean underMinimum = (amount.compareTo(minBalance) < 0);
player.setMoney(underMinimum ? minBalance : amount); 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) if (sender != null)
{ {
sender.sendMessage(_("setBalOthers", player.getDisplayName(), NumberUtil.displayCurrency(player.getMoney(), ess))); sender.sendMessage(tl("setBalOthers", player.getDisplayName(), NumberUtil.displayCurrency(player.getMoney(), ess)));
} }
} }

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.Enchantments; 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.MetaItemStack;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import com.earth2me.essentials.utils.StringUtil; import com.earth2me.essentials.utils.StringUtil;
@ -29,7 +29,7 @@ public class Commandenchant extends EssentialsCommand
final ItemStack stack = user.getItemInHand(); final ItemStack stack = user.getItemInHand();
if (stack == null || stack.getType() == Material.AIR) if (stack == null || stack.getType() == Material.AIR)
{ {
throw new Exception(_("nothingInHand")); throw new Exception(tl("nothingInHand"));
} }
if (args.length == 0) if (args.length == 0)
{ {
@ -43,7 +43,7 @@ public class Commandenchant extends EssentialsCommand
//enchantmentslist.add(enchantmentName); //enchantmentslist.add(enchantmentName);
} }
} }
throw new NotEnoughArgumentsException(_("enchantments", StringUtil.joinList(enchantmentslist.toArray()))); throw new NotEnoughArgumentsException(tl("enchantments", StringUtil.joinList(enchantmentslist.toArray())));
} }
int level = -1; int level = -1;
@ -70,11 +70,11 @@ public class Commandenchant extends EssentialsCommand
final String enchantmentName = enchantment.getName().toLowerCase(Locale.ENGLISH); final String enchantmentName = enchantment.getName().toLowerCase(Locale.ENGLISH);
if (level == 0) if (level == 0)
{ {
user.sendMessage(_("enchantmentRemoved", enchantmentName.replace('_', ' '))); user.sendMessage(tl("enchantmentRemoved", enchantmentName.replace('_', ' ')));
} }
else else
{ {
user.sendMessage(_("enchantmentApplied", enchantmentName.replace('_', ' '))); user.sendMessage(tl("enchantmentApplied", enchantmentName.replace('_', ' ')));
} }
} }
} }

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.User;
import com.earth2me.essentials.UserMap; import com.earth2me.essentials.UserMap;
import com.earth2me.essentials.metrics.Metrics; import com.earth2me.essentials.metrics.Metrics;
@ -79,7 +79,7 @@ public class Commandessentials extends EssentialsCommand
} }
if (disabledCommands.length() > 0) if (disabledCommands.length() > 0)
{ {
sender.sendMessage(_("blockList")); sender.sendMessage(tl("blockList"));
sender.sendMessage(disabledCommands.toString()); 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 private void run_reload(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception
{ {
ess.reload(); 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 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."); 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]"); 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 long daysArg = Long.parseLong(args[1]);
final double moneyArg = args.length >= 3 ? Double.parseDouble(args[2].replaceAll("[^0-9\\.]", "")) : 0; 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(); user.reset();
} }
sender.sendMessage(_("cleaned")); sender.sendMessage(tl("cleaned"));
} }
}); });

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.User;
import com.earth2me.essentials.craftbukkit.SetExpFix; import com.earth2me.essentials.craftbukkit.SetExpFix;
import com.earth2me.essentials.utils.NumberUtil; import com.earth2me.essentials.utils.NumberUtil;
@ -159,7 +159,7 @@ public class Commandexp extends EssentialsCommand
private void showExp(final CommandSource sender, final User target) 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? //TODO: Limit who can give negative exp?
@ -200,6 +200,6 @@ public class Commandexp extends EssentialsCommand
amount = 0l; amount = 0l;
} }
SetExpFix.setTotalExperience(target.getBase(), (int)amount); SetExpFix.setTotalExperience(target.getBase(), (int)amount);
sender.sendMessage(_("expSet", target.getDisplayName(), amount)); sender.sendMessage(tl("expSet", target.getDisplayName(), amount));
} }
} }

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.User;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -31,7 +31,7 @@ public class Commandext extends EssentialsLoopCommand
if (args.length < 1) if (args.length < 1)
{ {
extPlayer(user.getBase()); extPlayer(user.getBase());
user.sendMessage(_("extinguish")); user.sendMessage(tl("extinguish"));
return; 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) protected void updatePlayer(final Server server, final CommandSource sender, final User player, final String[] args)
{ {
extPlayer(player.getBase()); extPlayer(player.getBase());
sender.sendMessage(_("extinguishOthers", player.getDisplayName())); sender.sendMessage(tl("extinguishOthers", player.getDisplayName()));
} }
private void extPlayer(final Player player) private void extPlayer(final Player player)

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.User;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -30,7 +30,7 @@ public class Commandfeed extends EssentialsLoopCommand
} }
feedPlayer(user.getBase()); feedPlayer(user.getBase());
user.sendMessage(_("feed")); user.sendMessage(tl("feed"));
} }
@Override @Override
@ -50,7 +50,7 @@ public class Commandfeed extends EssentialsLoopCommand
try try
{ {
feedPlayer(player.getBase()); feedPlayer(player.getBase());
sender.sendMessage(_("feedOther", player.getDisplayName())); sender.sendMessage(tl("feedOther", player.getDisplayName()));
} }
catch (QuietAbortException e) catch (QuietAbortException e)
{ {

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials.commands; 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.MetaItemStack;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import com.earth2me.essentials.utils.NumberUtil; import com.earth2me.essentials.utils.NumberUtil;
@ -52,7 +52,7 @@ public class Commandfirework extends EssentialsCommand
FireworkMeta fmeta = (FireworkMeta)stack.getItemMeta(); FireworkMeta fmeta = (FireworkMeta)stack.getItemMeta();
fmeta.clearEffects(); fmeta.clearEffects();
stack.setItemMeta(fmeta); stack.setItemMeta(fmeta);
user.sendMessage(_("fireworkEffectsCleared")); user.sendMessage(tl("fireworkEffectsCleared"));
} }
else if (args.length > 1 && (args[0].equalsIgnoreCase("power") || (args[0].equalsIgnoreCase("p")))) 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) catch (NumberFormatException e)
{ {
throw new Exception(_("invalidFireworkFormat", args[1], args[0])); throw new Exception(tl("invalidFireworkFormat", args[1], args[0]));
} }
stack.setItemMeta(fmeta); stack.setItemMeta(fmeta);
} }
@ -82,7 +82,7 @@ public class Commandfirework extends EssentialsCommand
if (amount > serverLimit) if (amount > serverLimit)
{ {
amount = serverLimit; amount = serverLimit;
user.sendMessage(_("mobSpawnLimit")); user.sendMessage(tl("mobSpawnLimit"));
} }
} }
else else
@ -117,7 +117,7 @@ public class Commandfirework extends EssentialsCommand
} }
catch (Exception e) catch (Exception e)
{ {
user.sendMessage(_("fireworkSyntax")); user.sendMessage(tl("fireworkSyntax"));
throw e; throw e;
} }
} }
@ -128,15 +128,15 @@ public class Commandfirework extends EssentialsCommand
FireworkEffect effect = mStack.getFireworkBuilder().build(); FireworkEffect effect = mStack.getFireworkBuilder().build();
if (fmeta.getEffects().size() > 0 && !user.isAuthorized("essentials.firework.multiple")) if (fmeta.getEffects().size() > 0 && !user.isAuthorized("essentials.firework.multiple"))
{ {
throw new Exception(_("multipleCharges")); throw new Exception(tl("multipleCharges"));
} }
fmeta.addEffect(effect); fmeta.addEffect(effect);
stack.setItemMeta(fmeta); stack.setItemMeta(fmeta);
} }
else else
{ {
user.sendMessage(_("fireworkSyntax")); user.sendMessage(tl("fireworkSyntax"));
throw new Exception(_("fireworkColor")); throw new Exception(tl("fireworkColor"));
} }
} }
} }
@ -147,7 +147,7 @@ public class Commandfirework extends EssentialsCommand
} }
else else
{ {
throw new Exception(_("holdFirework")); throw new Exception(tl("holdFirework"));
} }
} }
} }

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.User;
import org.bukkit.Server; import org.bukkit.Server;
@ -60,10 +60,10 @@ public class Commandfly extends EssentialsToggleCommand
user.setFlying(false); 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())) 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()));
} }
} }
} }

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.User;
import java.util.List; import java.util.List;
import java.util.Locale; 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; gameMode = user.getGameMode() == GameMode.SURVIVAL ? GameMode.CREATIVE : user.getGameMode() == GameMode.CREATIVE ? GameMode.ADVENTURE : GameMode.SURVIVAL;
} }
user.setGameMode(gameMode); 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 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) 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"); boolean skipHidden = sender.isPlayer() && !ess.getUser(sender.getPlayer()).isAuthorized("essentials.vanish.interact");
@ -96,7 +96,7 @@ public class Commandgamemode extends EssentialsCommand
} }
foundUser = true; foundUser = true;
player.setGameMode(gameMode); 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) if (!foundUser)
{ {

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.DateUtil;
import com.earth2me.essentials.utils.NumberUtil; import com.earth2me.essentials.utils.NumberUtil;
import java.lang.management.ManagementFactory; import java.lang.management.ManagementFactory;
@ -37,11 +37,11 @@ public class Commandgc extends EssentialsCommand
color = ChatColor.RED; color = ChatColor.RED;
} }
sender.sendMessage(_("uptime", DateUtil.formatDateDiff(ManagementFactory.getRuntimeMXBean().getStartTime()))); sender.sendMessage(tl("uptime", DateUtil.formatDateDiff(ManagementFactory.getRuntimeMXBean().getStartTime())));
sender.sendMessage(_("tps", "" + color + NumberUtil.formatDouble(tps))); sender.sendMessage(tl("tps", "" + color + NumberUtil.formatDouble(tps)));
sender.sendMessage(_("gcmax", (Runtime.getRuntime().maxMemory() / 1024 / 1024))); sender.sendMessage(tl("gcmax", (Runtime.getRuntime().maxMemory() / 1024 / 1024)));
sender.sendMessage(_("gctotal", (Runtime.getRuntime().totalMemory() / 1024 / 1024))); sender.sendMessage(tl("gctotal", (Runtime.getRuntime().totalMemory() / 1024 / 1024)));
sender.sendMessage(_("gcfree", (Runtime.getRuntime().freeMemory() / 1024 / 1024))); sender.sendMessage(tl("gcfree", (Runtime.getRuntime().freeMemory() / 1024 / 1024)));
List<World> worlds = server.getWorlds(); List<World> worlds = server.getWorlds();
for (World w : worlds) for (World w : worlds)
@ -63,7 +63,7 @@ public class Commandgc extends EssentialsCommand
tileEntities += chunk.getTileEntities().length; 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));
} }
} }
} }

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.User;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Server; 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) private void outputPosition(final CommandSource sender, final Location coords, final Location distance)
{ {
sender.sendMessage(_("currentWorld", coords.getWorld().getName())); sender.sendMessage(tl("currentWorld", coords.getWorld().getName()));
sender.sendMessage(_("posX", coords.getBlockX())); sender.sendMessage(tl("posX", coords.getBlockX()));
sender.sendMessage(_("posY", coords.getBlockY())); sender.sendMessage(tl("posY", coords.getBlockY()));
sender.sendMessage(_("posZ", coords.getBlockZ())); sender.sendMessage(tl("posZ", coords.getBlockZ()));
sender.sendMessage(_("posYaw", (coords.getYaw() + 180 + 360) % 360)); sender.sendMessage(tl("posYaw", (coords.getYaw() + 180 + 360) % 360));
sender.sendMessage(_("posPitch", coords.getPitch())); sender.sendMessage(tl("posPitch", coords.getPitch()));
if (distance != null && coords.getWorld().equals(distance.getWorld())) if (distance != null && coords.getWorld().equals(distance.getWorld()))
{ {
sender.sendMessage(_("distance", coords.distance(distance))); sender.sendMessage(tl("distance", coords.distance(distance)));
} }
} }
} }

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.MetaItemStack;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import com.earth2me.essentials.craftbukkit.InventoryWorkaround; 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()).isAuthorized("essentials.itemspawn.exempt")
&& !ess.getUser(sender.getPlayer()).canSpawnItem(stack.getTypeId())))) && !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); final User giveTo = getPlayer(server, sender, args, 0);
@ -90,11 +90,11 @@ public class Commandgive extends EssentialsCommand
if (stack.getType() == Material.AIR) 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('_', ' '); 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; Map<Integer, ItemStack> leftovers;
@ -109,7 +109,7 @@ public class Commandgive extends EssentialsCommand
for (ItemStack item : leftovers.values()) for (ItemStack item : leftovers.values())
{ {
sender.sendMessage(_("giveSpawnFailure", item.getAmount(), itemName, giveTo.getDisplayName())); sender.sendMessage(tl("giveSpawnFailure", item.getAmount(), itemName, giveTo.getDisplayName()));
} }
giveTo.updateInventory(); giveTo.updateInventory();

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.User;
import net.ess3.api.events.GodStatusChangeEvent; import net.ess3.api.events.GodStatusChangeEvent;
import org.bukkit.Server; import org.bukkit.Server;
@ -66,10 +66,10 @@ public class Commandgod extends EssentialsToggleCommand
user.setFoodLevel(20); 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())) 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())));
} }
} }
} }

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials.commands; 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.User;
import com.earth2me.essentials.craftbukkit.InventoryWorkaround; import com.earth2me.essentials.craftbukkit.InventoryWorkaround;
import org.bukkit.Material; import org.bukkit.Material;
@ -25,14 +25,14 @@ public class Commandhat extends EssentialsCommand
final ItemStack head = inv.getHelmet(); final ItemStack head = inv.getHelmet();
if (head == null || head.getType() == Material.AIR) if (head == null || head.getType() == Material.AIR)
{ {
user.sendMessage(_("hatEmpty")); user.sendMessage(tl("hatEmpty"));
} }
else else
{ {
final ItemStack air = new ItemStack(Material.AIR); final ItemStack air = new ItemStack(Material.AIR);
inv.setHelmet(air); inv.setHelmet(air);
InventoryWorkaround.addItems(user.getInventory(), head); InventoryWorkaround.addItems(user.getInventory(), head);
user.sendMessage(_("hatRemoved")); user.sendMessage(tl("hatRemoved"));
} }
} }
else else
@ -46,16 +46,16 @@ public class Commandhat extends EssentialsCommand
final ItemStack head = inv.getHelmet(); final ItemStack head = inv.getHelmet();
inv.setHelmet(hand); inv.setHelmet(hand);
inv.setItemInHand(head); inv.setItemInHand(head);
user.sendMessage(_("hatPlaced")); user.sendMessage(tl("hatPlaced"));
} }
else else
{ {
user.sendMessage(_("hatArmor")); user.sendMessage(tl("hatArmor"));
} }
} }
else else
{ {
user.sendMessage(_("hatFail")); user.sendMessage(tl("hatFail"));
} }
} }
} }

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.User;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -51,7 +51,7 @@ public class Commandheal extends EssentialsLoopCommand
try try
{ {
healPlayer(player); healPlayer(player);
sender.sendMessage(_("healOther", player.getDisplayName())); sender.sendMessage(tl("healOther", player.getDisplayName()));
} }
catch (QuietAbortException e) catch (QuietAbortException e)
{ {
@ -65,7 +65,7 @@ public class Commandheal extends EssentialsLoopCommand
if (player.getHealth() == 0) if (player.getHealth() == 0)
{ {
throw new PlayerExemptException(_("healDead")); throw new PlayerExemptException(tl("healDead"));
} }
final double amount = player.getMaxHealth() - player.getHealth(); final double amount = player.getMaxHealth() - player.getHealth();
@ -85,7 +85,7 @@ public class Commandheal extends EssentialsLoopCommand
player.setHealth(newAmount); player.setHealth(newAmount);
player.setFoodLevel(20); player.setFoodLevel(20);
player.setFireTicks(0); player.setFireTicks(0);
user.sendMessage(_("heal")); user.sendMessage(tl("heal"));
for (PotionEffect effect : player.getActivePotionEffects()) for (PotionEffect effect : player.getActivePotionEffects())
{ {
player.removePotionEffect(effect.getType()); player.removePotionEffect(effect.getType());

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.User;
import com.earth2me.essentials.textreader.*; import com.earth2me.essentials.textreader.*;
import com.earth2me.essentials.utils.NumberUtil; import com.earth2me.essentials.utils.NumberUtil;
@ -54,6 +54,6 @@ public class Commandhelp extends EssentialsCommand
@Override @Override
protected void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception protected void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception
{ {
sender.sendMessage(_("helpConsole")); sender.sendMessage(tl("helpConsole"));
} }
} }

View File

@ -2,7 +2,7 @@ package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; import com.earth2me.essentials.CommandSource;
import com.earth2me.essentials.Console; 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.User;
import com.earth2me.essentials.utils.FormatUtil; import com.earth2me.essentials.utils.FormatUtil;
import org.bukkit.Server; import org.bukkit.Server;
@ -36,7 +36,7 @@ public class Commandhelpop extends EssentialsCommand
{ {
throw new NotEnoughArgumentsException(); 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); CommandSender cs = Console.getCommandSender(server);
cs.sendMessage(message); cs.sendMessage(message);
for (Player onlinePlayer : server.getOnlinePlayers()) for (Player onlinePlayer : server.getOnlinePlayers())

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials.commands; 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.Trade;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import com.earth2me.essentials.utils.StringUtil; import com.earth2me.essentials.utils.StringUtil;
@ -54,7 +54,7 @@ public class Commandhome extends EssentialsCommand
} }
else else
{ {
throw new Exception(_("bedMissing")); throw new Exception(tl("bedMissing"));
} }
} }
goHome(user, player, homeName.toLowerCase(Locale.ENGLISH), charge); goHome(user, player, homeName.toLowerCase(Locale.ENGLISH), charge);
@ -69,7 +69,7 @@ public class Commandhome extends EssentialsCommand
} }
else if (homes.isEmpty()) else if (homes.isEmpty())
{ {
throw new Exception(_("noHomeSetPlayer")); throw new Exception(tl("noHomeSetPlayer"));
} }
else if (homes.size() == 1 && player.equals(user)) else if (homes.size() == 1 && player.equals(user))
{ {
@ -82,14 +82,14 @@ public class Commandhome extends EssentialsCommand
{ {
if (bed != null) if (bed != null)
{ {
homes.add(_("bed")); homes.add(tl("bed"));
} }
else 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(); throw new NoChargeException();
@ -122,7 +122,7 @@ public class Commandhome extends EssentialsCommand
if (user.getWorld() != loc.getWorld() && ess.getSettings().isWorldHomePermissions() if (user.getWorld() != loc.getWorld() && ess.getSettings().isWorldHomePermissions()
&& !user.isAuthorized("essentials.worlds." + loc.getWorld().getName())) && !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); user.getTeleport().teleport(loc, charge, TeleportCause.COMMAND);
} }

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials.commands; 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.User;
import org.bukkit.Server; import org.bukkit.Server;
@ -23,7 +23,7 @@ public class Commandignore extends EssentialsCommand
sb.append(s).append(" "); sb.append(s).append(" ");
} }
String ignoredList = sb.toString().trim(); String ignoredList = sb.toString().trim();
user.sendMessage(ignoredList.length() > 0 ? _("ignoredList", ignoredList) : _("noIgnored")); user.sendMessage(ignoredList.length() > 0 ? tl("ignoredList", ignoredList) : tl("noIgnored"));
} }
else else
{ {
@ -41,17 +41,17 @@ public class Commandignore extends EssentialsCommand
throw new PlayerNotFoundException(); throw new PlayerNotFoundException();
} }
if (player.isIgnoreExempt()) { if (player.isIgnoreExempt()) {
user.sendMessage(_("ignoreExempt")); user.sendMessage(tl("ignoreExempt"));
} }
else if (user.isIgnoredPlayer(player)) else if (user.isIgnoredPlayer(player))
{ {
user.setIgnoredPlayer(player, false); user.setIgnoredPlayer(player, false);
user.sendMessage(_("unignorePlayer", player.getName())); user.sendMessage(tl("unignorePlayer", player.getName()));
} }
else else
{ {
user.setIgnoredPlayer(player, true); user.setIgnoredPlayer(player, true);
user.sendMessage(_("ignorePlayer", player.getName())); user.sendMessage(tl("ignorePlayer", player.getName()));
} }
} }
} }

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials.commands; 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.MetaItemStack;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import com.earth2me.essentials.craftbukkit.InventoryWorkaround; import com.earth2me.essentials.craftbukkit.InventoryWorkaround;
@ -34,7 +34,7 @@ public class Commanditem extends EssentialsCommand
: (!user.isAuthorized("essentials.itemspawn.exempt") : (!user.isAuthorized("essentials.itemspawn.exempt")
&& !user.canSpawnItem(stack.getTypeId()))) && !user.canSpawnItem(stack.getTypeId())))
{ {
throw new Exception(_("cantSpawnItem", itemname)); throw new Exception(tl("cantSpawnItem", itemname));
} }
try try
{ {
@ -68,11 +68,11 @@ public class Commanditem extends EssentialsCommand
if (stack.getType() == Material.AIR) 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('_', ' '); 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")) if (user.isAuthorized("essentials.oversizedstacks"))
{ {
InventoryWorkaround.addOversizedItems(user.getInventory(), ess.getSettings().getOversizedStackSize(), stack); InventoryWorkaround.addOversizedItems(user.getInventory(), ess.getSettings().getOversizedStackSize(), stack);

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.Material;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
@ -35,7 +35,7 @@ public class Commanditemdb extends EssentialsCommand
{ {
itemStack = ess.getItemDb().get(args[0]); 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) if (itemHeld && itemStack.getType() != Material.AIR)
{ {
@ -43,13 +43,13 @@ public class Commanditemdb extends EssentialsCommand
int durability = ((maxuses + 1) - itemStack.getDurability()); int durability = ((maxuses + 1) - itemStack.getDurability());
if (maxuses != 0) if (maxuses != 0)
{ {
sender.sendMessage(_("durability", Integer.toString(durability))); sender.sendMessage(tl("durability", Integer.toString(durability)));
} }
} }
final String itemNameList = ess.getItemDb().names(itemStack); final String itemNameList = ess.getItemDb().names(itemStack);
if (itemNameList != null) if (itemNameList != null)
{ {
sender.sendMessage(_("itemNames", ess.getItemDb().names(itemStack))); sender.sendMessage(tl("itemNames", ess.getItemDb().names(itemStack)));
} }
} }
} }

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials.commands; 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.Trade;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import com.earth2me.essentials.utils.LocationUtil; import com.earth2me.essentials.utils.LocationUtil;
@ -46,7 +46,7 @@ public class Commandjump extends EssentialsCommand
} }
catch (NullPointerException ex) catch (NullPointerException ex)
{ {
throw new Exception(_("jumpError"), ex); throw new Exception(tl("jumpError"), ex);
} }
final Trade charge = new Trade(this.getName(), ess); final Trade charge = new Trade(this.getName(), ess);

View File

@ -2,7 +2,7 @@ package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; import com.earth2me.essentials.CommandSource;
import com.earth2me.essentials.Console; 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.User;
import com.earth2me.essentials.utils.FormatUtil; import com.earth2me.essentials.utils.FormatUtil;
import java.util.logging.Level; import java.util.logging.Level;
@ -35,17 +35,17 @@ public class Commandkick extends EssentialsCommand
if (target.isAuthorized("essentials.kick.exempt")) 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")); kickReason = FormatUtil.replaceFormat(kickReason.replace("\\n", "\n").replace("|", "\n"));
target.kickPlayer(kickReason); target.kickPlayer(kickReason);
final String senderName = sender.isPlayer() ? sender.getPlayer().getDisplayName() : Console.NAME; final String senderName = sender.isPlayer() ? sender.getPlayer().getDisplayName() : Console.NAME;
server.getLogger().log(Level.INFO, _("playerKicked", senderName, target.getName(), kickReason)); server.getLogger().log(Level.INFO, tl("playerKicked", senderName, target.getName(), kickReason));
ess.broadcastMessage("essentials.kick.notify", _("playerKicked", senderName, target.getName(), kickReason)); ess.broadcastMessage("essentials.kick.notify", tl("playerKicked", senderName, target.getName(), kickReason));
} }
} }

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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 com.earth2me.essentials.utils.FormatUtil;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -17,7 +17,7 @@ public class Commandkickall extends EssentialsCommand
@Override @Override
public void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception 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")); kickReason = FormatUtil.replaceFormat(kickReason.replace("\\n", "\n").replace("|", "\n"));
for (Player onlinePlayer : server.getOnlinePlayers()) for (Player onlinePlayer : server.getOnlinePlayers())
@ -27,6 +27,6 @@ public class Commandkickall extends EssentialsCommand
onlinePlayer.kickPlayer(kickReason); onlinePlayer.kickPlayer(kickReason);
} }
} }
sender.sendMessage(_("kickedAll")); sender.sendMessage(tl("kickedAll"));
} }
} }

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.User;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -32,7 +32,7 @@ public class Commandkill extends EssentialsLoopCommand
final Player matchPlayer = user.getBase(); final Player matchPlayer = user.getBase();
if (sender.isPlayer() && user.isAuthorized("essentials.kill.exempt") && !ess.getUser(sender.getPlayer()).isAuthorized("essentials.kill.force")) 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); 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); server.getPluginManager().callEvent(ede);
@ -47,6 +47,6 @@ public class Commandkill extends EssentialsLoopCommand
matchPlayer.setHealth(0); matchPlayer.setHealth(0);
} }
sender.sendMessage(_("kill", matchPlayer.getDisplayName())); sender.sendMessage(tl("kill", matchPlayer.getDisplayName()));
} }
} }

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.Kit;
import com.earth2me.essentials.Trade; import com.earth2me.essentials.Trade;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
@ -25,7 +25,7 @@ public class Commandkit extends EssentialsCommand
if (args.length < 1) if (args.length < 1)
{ {
final String kitList = Kit.listKits(ess, user); 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(); throw new NoChargeException();
} }
else if (args.length > 1 && user.isAuthorized("essentials.kit.others")) else if (args.length > 1 && user.isAuthorized("essentials.kit.others"))
@ -47,7 +47,7 @@ public class Commandkit extends EssentialsCommand
if (args.length < 2) if (args.length < 2)
{ {
final String kitList = Kit.listKits(ess, null); 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(); throw new NoChargeException();
} }
else else
@ -59,8 +59,8 @@ public class Commandkit extends EssentialsCommand
final List<String> items = Kit.getItems(ess, userTo, kitName, kit); final List<String> items = Kit.getItems(ess, userTo, kitName, kit);
Kit.expandItems(ess, userTo, items); Kit.expandItems(ess, userTo, items);
sender.sendMessage(_("kitGiveTo", kitName, userTo.getDisplayName())); sender.sendMessage(tl("kitGiveTo", kitName, userTo.getDisplayName()));
userTo.sendMessage(_("kitReceive", kitName)); userTo.sendMessage(tl("kitReceive", kitName));
} }
} }
@ -68,14 +68,14 @@ public class Commandkit extends EssentialsCommand
{ {
if (kitName.isEmpty()) if (kitName.isEmpty())
{ {
throw new Exception(_("kitError2")); throw new Exception(tl("kitError2"));
} }
final Map<String, Object> kit = ess.getSettings().getKit(kitName); final Map<String, Object> kit = ess.getSettings().getKit(kitName);
if (!userFrom.isAuthorized("essentials.kits." + 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); final List<String> items = Kit.getItems(ess, userTo, kitName, kit);
@ -87,7 +87,7 @@ public class Commandkit extends EssentialsCommand
Kit.expandItems(ess, userTo, items); Kit.expandItems(ess, userTo, items);
charge.charge(userFrom); charge.charge(userFrom);
userFrom.sendMessage(_("kitGiveTo", kitName, userTo.getDisplayName())); userFrom.sendMessage(tl("kitGiveTo", kitName, userTo.getDisplayName()));
userTo.sendMessage(_("kitReceive", kitName)); userTo.sendMessage(tl("kitReceive", kitName));
} }
} }

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.User;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.entity.LightningStrike; import org.bukkit.entity.LightningStrike;
@ -46,7 +46,7 @@ public class Commandlightning extends EssentialsLoopCommand
@Override @Override
protected void updatePlayer(final Server server, final CommandSource sender, final User matchUser, final String[] args) 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()); final LightningStrike strike = matchUser.getBase().getWorld().strikeLightningEffect(matchUser.getBase().getLocation());
if (!matchUser.isGodModeEnabled()) if (!matchUser.isGodModeEnabled())
@ -55,7 +55,7 @@ public class Commandlightning extends EssentialsLoopCommand
} }
if (ess.getSettings().warnOnSmite()) if (ess.getSettings().warnOnSmite())
{ {
matchUser.sendMessage(_("lightningSmited")); matchUser.sendMessage(tl("lightningSmited"));
} }
} }
} }

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.PlayerList;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import com.earth2me.essentials.utils.FormatUtil; import com.earth2me.essentials.utils.FormatUtil;
@ -77,7 +77,7 @@ public class Commandlist extends EssentialsCommand
int limit = Integer.parseInt(groupValue); int limit = Integer.parseInt(groupValue);
if (matchedList.size() > limit) 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 else
{ {
@ -124,7 +124,7 @@ public class Commandlist extends EssentialsCommand
if (ess.getPermissionsHandler().getName().equals("ConfigPermissions")) if (ess.getPermissionsHandler().getName().equals("ConfigPermissions"))
{ {
groupName = _("connectedPlayers"); groupName = tl("connectedPlayers");
} }
if (users == null || users.isEmpty()) if (users == null || users.isEmpty())
{ {

View File

@ -8,7 +8,7 @@ import org.bukkit.Server;
import java.util.List; import java.util.List;
import static com.earth2me.essentials.I18n._; import static com.earth2me.essentials.I18n.tl;
public class Commandmail extends EssentialsCommand public class Commandmail extends EssentialsCommand
@ -30,39 +30,39 @@ public class Commandmail extends EssentialsCommand
final List<String> mail = user.getMails(); final List<String> mail = user.getMails();
if (mail.isEmpty()) if (mail.isEmpty())
{ {
user.sendMessage(_("noMail")); user.sendMessage(tl("noMail"));
throw new NoChargeException(); throw new NoChargeException();
} }
for (String messages : mail) for (String messages : mail)
{ {
user.sendMessage(messages); user.sendMessage(messages);
} }
user.sendMessage(_("mailClear")); user.sendMessage(tl("mailClear"));
return; return;
} }
if (args.length >= 3 && "send".equalsIgnoreCase(args[0])) if (args.length >= 3 && "send".equalsIgnoreCase(args[0]))
{ {
if (!user.isAuthorized("essentials.mail.send")) if (!user.isAuthorized("essentials.mail.send"))
{ {
throw new Exception(_("noPerm", "essentials.mail.send")); throw new Exception(tl("noPerm", "essentials.mail.send"));
} }
if (user.isMuted()) if (user.isMuted())
{ {
throw new Exception(_("voiceSilenced")); throw new Exception(tl("voiceSilenced"));
} }
User u = ess.getUser(args[1]); User u = ess.getUser(args[1]);
if (u == null) if (u == null)
{ {
throw new Exception(_("playerNeverOnServer", args[1])); throw new Exception(tl("playerNeverOnServer", args[1]));
} }
if (!u.isIgnoredPlayer(user)) if (!u.isIgnoredPlayer(user))
{ {
final String mail = user.getName() + ": " + StringUtil.sanitizeString(FormatUtil.stripFormat(getFinalArg(args, 2))); final String mail = user.getName() + ": " + StringUtil.sanitizeString(FormatUtil.stripFormat(getFinalArg(args, 2)));
if (mail.length() > 1000) if (mail.length() > 1000)
{ {
throw new Exception(_("mailTooLong")); throw new Exception(tl("mailTooLong"));
} }
if (Math.abs(System.currentTimeMillis() - timestamp) > 60000) if (Math.abs(System.currentTimeMillis() - timestamp) > 60000)
{ {
@ -72,27 +72,27 @@ public class Commandmail extends EssentialsCommand
mailsPerMinute++; mailsPerMinute++;
if (mailsPerMinute > ess.getSettings().getMailsPerMinute()) if (mailsPerMinute > ess.getSettings().getMailsPerMinute())
{ {
throw new Exception(_("mailDelay", ess.getSettings().getMailsPerMinute())); throw new Exception(tl("mailDelay", ess.getSettings().getMailsPerMinute()));
} }
u.addMail(mail); u.addMail(mail);
} }
user.sendMessage(_("mailSent")); user.sendMessage(tl("mailSent"));
return; return;
} }
if (args.length > 1 && "sendall".equalsIgnoreCase(args[0])) if (args.length > 1 && "sendall".equalsIgnoreCase(args[0]))
{ {
if (!user.isAuthorized("essentials.mail.sendall")) 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)))); ess.runTaskAsynchronously(new SendAll(user.getName() + ": " + FormatUtil.stripFormat(getFinalArg(args, 1))));
user.sendMessage(_("mailSent")); user.sendMessage(tl("mailSent"));
return; return;
} }
if (args.length >= 1 && "clear".equalsIgnoreCase(args[0])) if (args.length >= 1 && "clear".equalsIgnoreCase(args[0]))
{ {
user.setMails(null); user.setMails(null);
user.sendMessage(_("mailCleared")); user.sendMessage(tl("mailCleared"));
return; return;
} }
throw new NotEnoughArgumentsException(); throw new NotEnoughArgumentsException();
@ -103,27 +103,27 @@ public class Commandmail extends EssentialsCommand
{ {
if (args.length >= 1 && "read".equalsIgnoreCase(args[0])) 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])) 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])) else if (args.length >= 3 && "send".equalsIgnoreCase(args[0]))
{ {
User u = ess.getUser(args[1]); User u = ess.getUser(args[1]);
if (u == null) if (u == null)
{ {
throw new Exception(_("playerNeverOnServer", args[1])); throw new Exception(tl("playerNeverOnServer", args[1]));
} }
u.addMail("Server: " + getFinalArg(args, 2)); u.addMail("Server: " + getFinalArg(args, 2));
sender.sendMessage(_("mailSent")); sender.sendMessage(tl("mailSent"));
return; return;
} }
else if (args.length >= 2 && "sendall".equalsIgnoreCase(args[0])) else if (args.length >= 2 && "sendall".equalsIgnoreCase(args[0]))
{ {
ess.runTaskAsynchronously(new SendAll("Server: " + getFinalArg(args, 1))); ess.runTaskAsynchronously(new SendAll("Server: " + getFinalArg(args, 1)));
sender.sendMessage(_("mailSent")); sender.sendMessage(tl("mailSent"));
return; return;
} }
else if (args.length >= 2) else if (args.length >= 2)
@ -132,10 +132,10 @@ public class Commandmail extends EssentialsCommand
User u = ess.getUser(args[0]); User u = ess.getUser(args[0]);
if (u == null) if (u == null)
{ {
throw new Exception(_("playerNeverOnServer", args[0])); throw new Exception(tl("playerNeverOnServer", args[0]));
} }
u.addMail("Server: " + getFinalArg(args, 1)); u.addMail("Server: " + getFinalArg(args, 1));
sender.sendMessage(_("mailSent")); sender.sendMessage(tl("mailSent"));
return; return;
} }
throw new NotEnoughArgumentsException(); throw new NotEnoughArgumentsException();

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.User;
import com.earth2me.essentials.utils.FormatUtil; import com.earth2me.essentials.utils.FormatUtil;
import org.bukkit.Server; import org.bukkit.Server;
@ -19,7 +19,7 @@ public class Commandme extends EssentialsCommand
{ {
if (user.isMuted()) if (user.isMuted())
{ {
throw new Exception(_("voiceSilenced")); throw new Exception(tl("voiceSilenced"));
} }
if (args.length < 1) if (args.length < 1)
@ -31,7 +31,7 @@ public class Commandme extends EssentialsCommand
message = FormatUtil.formatMessage(user, "essentials.chat", message); message = FormatUtil.formatMessage(user, "essentials.chat", message);
user.setDisplayNick(); user.setDisplayNick();
ess.broadcastMessage(user, _("action", user.getDisplayName(), message)); ess.broadcastMessage(user, tl("action", user.getDisplayName(), message));
} }
@Override @Override
@ -45,6 +45,6 @@ public class Commandme extends EssentialsCommand
String message = getFinalArg(args, 0); String message = getFinalArg(args, 0);
message = FormatUtil.replaceFormat(message); message = FormatUtil.replaceFormat(message);
ess.getServer().broadcastMessage(_("action", "@", message)); ess.getServer().broadcastMessage(tl("action", "@", message));
} }
} }

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials.commands; 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.User;
import java.util.Locale; import java.util.Locale;
import org.bukkit.Server; import org.bukkit.Server;
@ -20,12 +20,12 @@ public class Commandmore extends EssentialsCommand
final ItemStack stack = user.getItemInHand(); final ItemStack stack = user.getItemInHand();
if (stack == null) if (stack == null)
{ {
throw new Exception(_("cantSpawnItem", "Air")); throw new Exception(tl("cantSpawnItem", "Air"));
} }
if (stack.getAmount() >= ((user.isAuthorized("essentials.oversizedstacks")) if (stack.getAmount() >= ((user.isAuthorized("essentials.oversizedstacks"))
? ess.getSettings().getOversizedStackSize() : stack.getMaxStackSize())) ? ess.getSettings().getOversizedStackSize() : stack.getMaxStackSize()))
{ {
throw new Exception(_("fullStack")); throw new Exception(tl("fullStack"));
} }
final String itemname = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", ""); final String itemname = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", "");
if (ess.getSettings().permissionBasedItemSpawn() if (ess.getSettings().permissionBasedItemSpawn()
@ -35,7 +35,7 @@ public class Commandmore extends EssentialsCommand
: (!user.isAuthorized("essentials.itemspawn.exempt") : (!user.isAuthorized("essentials.itemspawn.exempt")
&& !user.canSpawnItem(stack.getTypeId()))) && !user.canSpawnItem(stack.getTypeId())))
{ {
throw new Exception(_("cantSpawnItem", itemname)); throw new Exception(tl("cantSpawnItem", itemname));
} }
if (user.isAuthorized("essentials.oversizedstacks")) if (user.isAuthorized("essentials.oversizedstacks"))
{ {

View File

@ -2,7 +2,7 @@ package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; import com.earth2me.essentials.CommandSource;
import com.earth2me.essentials.Console; 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.IReplyTo;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import static com.earth2me.essentials.commands.EssentialsCommand.getFinalArg; import static com.earth2me.essentials.commands.EssentialsCommand.getFinalArg;
@ -13,7 +13,7 @@ import org.bukkit.command.CommandSender;
public class Commandmsg extends EssentialsLoopCommand public class Commandmsg extends EssentialsLoopCommand
{ {
final String translatedMe = _("me"); final String translatedMe = tl("me");
public Commandmsg() public Commandmsg()
{ {
@ -35,7 +35,7 @@ public class Commandmsg extends EssentialsLoopCommand
User user = ess.getUser(sender.getPlayer()); User user = ess.getUser(sender.getPlayer());
if (user.isMuted()) if (user.isMuted())
{ {
throw new Exception(_("voiceSilenced")); throw new Exception(tl("voiceSilenced"));
} }
message = FormatUtil.formatMessage(user, "essentials.msg", message); message = FormatUtil.formatMessage(user, "essentials.msg", message);
canWildcard = user.isAuthorized("essentials.msg.multiple"); 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 IReplyTo replyTo = sender.isPlayer() ? ess.getUser(sender.getPlayer()) : Console.getConsoleReplyTo();
final String senderName = sender.isPlayer() ? sender.getPlayer().getDisplayName() : Console.NAME; 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); CommandSender cs = Console.getCommandSender(server);
cs.sendMessage(_("msgFormat", senderName, translatedMe, message)); cs.sendMessage(tl("msgFormat", senderName, translatedMe, message));
replyTo.setReplyTo(new CommandSource(cs)); replyTo.setReplyTo(new CommandSource(cs));
Console.getConsoleReplyTo().setReplyTo(sender); Console.getConsoleReplyTo().setReplyTo(sender);
return; return;
@ -70,16 +70,16 @@ public class Commandmsg extends EssentialsLoopCommand
if (matchedUser.isAfk()) 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()))) if (sender.isPlayer() && matchedUser.isIgnoredPlayer(ess.getUser(sender.getPlayer())))
{ {
return; return;
} }
matchedUser.sendMessage(_("msgFormat", senderName, translatedMe, args[0])); matchedUser.sendMessage(tl("msgFormat", senderName, translatedMe, args[0]));
replyTo.setReplyTo(matchedUser.getSource()); replyTo.setReplyTo(matchedUser.getSource());
matchedUser.setReplyTo(sender); matchedUser.setReplyTo(sender);
} }

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.OfflinePlayer;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import com.earth2me.essentials.utils.DateUtil; 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")) if (sender.isPlayer() && !ess.getUser(sender.getPlayer()).isAuthorized("essentials.mute.offline"))
{ {
throw new Exception(_("muteExemptOffline")); throw new Exception(tl("muteExemptOffline"));
} }
} }
else else
{ {
if (user.isAuthorized("essentials.mute.exempt") && sender.isPlayer()) 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) if (nomatch)
{ {
sender.sendMessage(_("userUnknown", user.getName())); sender.sendMessage(tl("userUnknown", user.getName()));
} }
if (muted) if (muted)
{ {
if (muteTimestamp > 0) if (muteTimestamp > 0)
{ {
sender.sendMessage(_("mutedPlayerFor", user.getDisplayName(), muteTime)); sender.sendMessage(tl("mutedPlayerFor", user.getDisplayName(), muteTime));
user.sendMessage(_("playerMutedFor", muteTime)); user.sendMessage(tl("playerMutedFor", muteTime));
} }
else else
{ {
sender.sendMessage(_("mutedPlayer", user.getDisplayName())); sender.sendMessage(tl("mutedPlayer", user.getDisplayName()));
user.sendMessage(_("playerMuted")); 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 else
{ {
sender.sendMessage(_("unmutedPlayer", user.getDisplayName())); sender.sendMessage(tl("unmutedPlayer", user.getDisplayName()));
user.sendMessage(_("playerUnmuted")); user.sendMessage(tl("playerUnmuted"));
} }
} }
} }

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.User;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Server; import org.bukkit.Server;
@ -62,7 +62,7 @@ public class Commandnear extends EssentialsCommand
if (radius > maxRadius && !user.isAuthorized("essentials.near.maxexempt")) if (radius > maxRadius && !user.isAuthorized("essentials.near.maxexempt"))
{ {
user.sendMessage(_("radiusTooBig", maxRadius)); user.sendMessage(tl("radiusTooBig", maxRadius));
radius = maxRadius; radius = maxRadius;
} }
@ -70,7 +70,7 @@ public class Commandnear extends EssentialsCommand
{ {
otherUser = user; otherUser = user;
} }
user.sendMessage(_("nearbyPlayers", getLocal(server, otherUser, radius))); user.sendMessage(tl("nearbyPlayers", getLocal(server, otherUser, radius)));
} }
@Override @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) 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");
} }
} }

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.User;
import com.earth2me.essentials.utils.FormatUtil; import com.earth2me.essentials.utils.FormatUtil;
import java.util.Locale; import java.util.Locale;
@ -26,14 +26,14 @@ public class Commandnick extends EssentialsLoopCommand
} }
if (!ess.getSettings().changeDisplayName()) if (!ess.getSettings().changeDisplayName())
{ {
throw new Exception(_("nickDisplayName")); throw new Exception(tl("nickDisplayName"));
} }
if (args.length > 1 && user.isAuthorized("essentials.nick.others")) if (args.length > 1 && user.isAuthorized("essentials.nick.others"))
{ {
final String[] nickname = formatNickname(user, args[1]).split(" "); final String[] nickname = formatNickname(user, args[1]).split(" ");
loopOfflinePlayers(server, user.getSource(), false, true, args[0], nickname); loopOfflinePlayers(server, user.getSource(), false, true, args[0], nickname);
user.sendMessage(_("nickChanged")); user.sendMessage(tl("nickChanged"));
} }
else else
{ {
@ -51,11 +51,11 @@ public class Commandnick extends EssentialsLoopCommand
} }
if (!ess.getSettings().changeDisplayName()) if (!ess.getSettings().changeDisplayName())
{ {
throw new Exception(_("nickDisplayName")); throw new Exception(tl("nickDisplayName"));
} }
final String[] nickname = formatNickname(null, args[1]).split(" "); final String[] nickname = formatNickname(null, args[1]).split(" ");
loopOfflinePlayers(server, sender, false, true, args[0], nickname); loopOfflinePlayers(server, sender, false, true, args[0], nickname);
sender.sendMessage(_("nickChanged")); sender.sendMessage(tl("nickChanged"));
} }
@Override @Override
@ -65,21 +65,21 @@ public class Commandnick extends EssentialsLoopCommand
if (target.getName().equalsIgnoreCase(nick)) if (target.getName().equalsIgnoreCase(nick))
{ {
setNickname(server, sender, target, nick); setNickname(server, sender, target, nick);
target.sendMessage(_("nickNoMore")); target.sendMessage(tl("nickNoMore"));
} }
else if ("off".equalsIgnoreCase(nick)) else if ("off".equalsIgnoreCase(nick))
{ {
setNickname(server, sender, target, null); setNickname(server, sender, target, null);
target.sendMessage(_("nickNoMore")); target.sendMessage(tl("nickNoMore"));
} }
else if (nickInUse(server, target, nick)) else if (nickInUse(server, target, nick))
{ {
throw new NotEnoughArgumentsException(_("nickInUse")); throw new NotEnoughArgumentsException(tl("nickInUse"));
} }
else else
{ {
setNickname(server, sender, target, nick); 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); String newNick = user == null ? FormatUtil.replaceFormat(nick) : FormatUtil.formatString(user, "essentials.nick", nick);
if (!newNick.matches("^[a-zA-Z_0-9\u00a7]+$")) 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()) else if (newNick.length() > ess.getSettings().getMaxNickLength())
{ {
throw new Exception(_("nickTooLong")); throw new Exception(tl("nickTooLong"));
} }
else if (FormatUtil.stripFormat(newNick).length() < 1) else if (FormatUtil.stripFormat(newNick).length() < 1)
{ {
throw new Exception(_("nickNamesAlpha")); throw new Exception(tl("nickNamesAlpha"));
} }
return newNick; return newNick;
} }

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
@ -44,7 +44,7 @@ public class Commandnuke extends EssentialsCommand
{ {
continue; continue;
} }
player.sendMessage(_("nuke")); player.sendMessage(tl("nuke"));
final Location loc = player.getLocation(); final Location loc = player.getLocation();
final World world = loc.getWorld(); final World world = loc.getWorld();
for (int x = -10; x <= 10; x += 5) for (int x = -10; x <= 10; x += 5)

View File

@ -2,7 +2,7 @@ package com.earth2me.essentials.commands;
import com.earth2me.essentials.ChargeException; import com.earth2me.essentials.ChargeException;
import com.earth2me.essentials.CommandSource; 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.Trade;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -42,7 +42,7 @@ public class Commandpay extends EssentialsLoopCommand
} }
catch (MaxMoneyException ex) catch (MaxMoneyException ex)
{ {
sender.sendMessage(_("maxMoney")); sender.sendMessage(tl("maxMoney"));
} }
} }
} }

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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 com.earth2me.essentials.utils.FormatUtil;
import org.bukkit.Server; import org.bukkit.Server;
@ -19,7 +19,7 @@ public class Commandping extends EssentialsCommand
if (args.length < 1) if (args.length < 1)
{ {
sender.sendMessage(_("pong")); sender.sendMessage(tl("pong"));
} }
else else
{ {

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials.commands; 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.MetaItemStack;
import com.earth2me.essentials.Potions; import com.earth2me.essentials.Potions;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
@ -40,7 +40,7 @@ public class Commandpotion extends EssentialsCommand
potionslist.add(entry.getKey()); 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) if (stack.getType() == Material.POTION)
@ -78,7 +78,7 @@ public class Commandpotion extends EssentialsCommand
} }
else else
{ {
user.sendMessage(_("invalidPotion")); user.sendMessage(tl("invalidPotion"));
throw new NotEnoughArgumentsException(); throw new NotEnoughArgumentsException();
} }
} }
@ -87,7 +87,7 @@ public class Commandpotion extends EssentialsCommand
} }
else else
{ {
throw new Exception(_("holdPotion")); throw new Exception(tl("holdPotion"));
} }
} }
} }

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.User;
import com.earth2me.essentials.utils.StringUtil; import com.earth2me.essentials.utils.StringUtil;
import java.util.ArrayList; import java.util.ArrayList;
@ -47,13 +47,13 @@ public class Commandpowertool extends EssentialsCommand
if (command != null && command.equalsIgnoreCase("d:")) if (command != null && command.equalsIgnoreCase("d:"))
{ {
user.clearAllPowertools(); user.clearAllPowertools();
sender.sendMessage(_("powerToolClearAll")); sender.sendMessage(tl("powerToolClearAll"));
return; return;
} }
if (itemStack == null || itemStack.getType() == Material.AIR) 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("_", " "); final String itemName = itemStack.getType().toString().toLowerCase(Locale.ENGLISH).replaceAll("_", " ");
@ -64,11 +64,11 @@ public class Commandpowertool extends EssentialsCommand
{ {
if (powertools == null || powertools.isEmpty()) if (powertools == null || powertools.isEmpty())
{ {
throw new Exception(_("powerToolListEmpty", itemName)); throw new Exception(tl("powerToolListEmpty", itemName));
} }
else else
{ {
sender.sendMessage(_("powerToolList", StringUtil.joinList(powertools), itemName)); sender.sendMessage(tl("powerToolList", StringUtil.joinList(powertools), itemName));
} }
throw new NoChargeException(); throw new NoChargeException();
} }
@ -77,11 +77,11 @@ public class Commandpowertool extends EssentialsCommand
command = command.substring(2); command = command.substring(2);
if (!powertools.contains(command)) if (!powertools.contains(command))
{ {
throw new Exception(_("powerToolNoSuchCommandAssigned", command, itemName)); throw new Exception(tl("powerToolNoSuchCommandAssigned", command, itemName));
} }
powertools.remove(command); powertools.remove(command);
sender.sendMessage(_("powerToolRemove", command, itemName)); sender.sendMessage(tl("powerToolRemove", command, itemName));
} }
else else
{ {
@ -89,12 +89,12 @@ public class Commandpowertool extends EssentialsCommand
{ {
if (sender.isPlayer() && !ess.getUser(sender.getPlayer()).isAuthorized("essentials.powertool.append")) 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); command = command.substring(2);
if (powertools.contains(command)) if (powertools.contains(command))
{ {
throw new Exception(_("powerToolAlreadySet", command, itemName)); throw new Exception(tl("powerToolAlreadySet", command, itemName));
} }
} }
else if (powertools != null && !powertools.isEmpty()) else if (powertools != null && !powertools.isEmpty())
@ -108,7 +108,7 @@ public class Commandpowertool extends EssentialsCommand
} }
powertools.add(command); powertools.add(command);
sender.sendMessage(_("powerToolAttach", StringUtil.joinList(powertools), itemName)); sender.sendMessage(tl("powerToolAttach", StringUtil.joinList(powertools), itemName));
} }
} }
else else
@ -117,13 +117,13 @@ public class Commandpowertool extends EssentialsCommand
{ {
powertools.clear(); powertools.clear();
} }
sender.sendMessage(_("powerToolRemoveAll", itemName)); sender.sendMessage(tl("powerToolRemoveAll", itemName));
} }
if (!user.arePowerToolsEnabled()) if (!user.arePowerToolsEnabled())
{ {
user.setPowerToolsEnabled(true); user.setPowerToolsEnabled(true);
user.sendMessage(_("powerToolsEnabled")); user.sendMessage(tl("powerToolsEnabled"));
} }
user.setPowertool(itemStack, powertools); user.setPowertool(itemStack, powertools);
} }

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials.commands; 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.User;
import org.bukkit.Server; import org.bukkit.Server;
@ -17,11 +17,11 @@ public class Commandpowertooltoggle extends EssentialsCommand
{ {
if (!user.hasPowerTools()) if (!user.hasPowerTools())
{ {
user.sendMessage(_("noPowerTools")); user.sendMessage(tl("noPowerTools"));
return; return;
} }
user.sendMessage(user.togglePowerToolsEnabled() user.sendMessage(user.togglePowerToolsEnabled()
? _("powerToolsEnabled") ? tl("powerToolsEnabled")
: _("powerToolsDisabled")); : tl("powerToolsDisabled"));
} }
} }

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.User;
import com.earth2me.essentials.utils.DescParseTickFormat; import com.earth2me.essentials.utils.DescParseTickFormat;
import java.util.*; import java.util.*;
@ -50,7 +50,7 @@ public class Commandptime extends EssentialsCommand
User user = ess.getUser(sender.getPlayer()); User user = ess.getUser(sender.getPlayer());
if (user != null && (!users.contains(user) || users.size() > 1) && !user.isAuthorized("essentials.ptime.others")) if (user != null && (!users.contains(user) || users.size() > 1) && !user.isAuthorized("essentials.ptime.others"))
{ {
user.sendMessage(_("pTimeOthersPermission")); user.sendMessage(tl("pTimeOthersPermission"));
return; return;
} }
} }
@ -96,25 +96,25 @@ public class Commandptime extends EssentialsCommand
{ {
if (users.size() > 1) if (users.size() > 1)
{ {
sender.sendMessage(_("pTimePlayers")); sender.sendMessage(tl("pTimePlayers"));
} }
for (User user : users) for (User user : users)
{ {
if (user.getPlayerTimeOffset() == 0) if (user.getPlayerTimeOffset() == 0)
{ {
sender.sendMessage(_("pTimeNormal", user.getName())); sender.sendMessage(tl("pTimeNormal", user.getName()));
} }
else else
{ {
String time = DescParseTickFormat.format(user.getPlayerTime()); String time = DescParseTickFormat.format(user.getPlayerTime());
if (!user.isPlayerTimeRelative()) if (!user.isPlayerTimeRelative())
{ {
sender.sendMessage(_("pTimeCurrentFixed", user.getName(), time)); sender.sendMessage(tl("pTimeCurrentFixed", user.getName(), time));
} }
else 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 // Inform the sender of the change
if (ticks == null) if (ticks == null)
{ {
sender.sendMessage(_("pTimeReset", msg.toString())); sender.sendMessage(tl("pTimeReset", msg.toString()));
} }
else else
{ {
String time = DescParseTickFormat.format(ticks); String time = DescParseTickFormat.format(ticks);
if (!relative) if (!relative)
{ {
sender.sendMessage(_("pTimeSetFixed", time, msg.toString())); sender.sendMessage(tl("pTimeSetFixed", time, msg.toString()));
} }
else else
{ {
sender.sendMessage(_("pTimeSet", time, msg.toString())); sender.sendMessage(tl("pTimeSet", time, msg.toString()));
} }
} }
} }

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.User;
import java.util.*; import java.util.*;
import org.bukkit.Server; import org.bukkit.Server;
@ -59,7 +59,7 @@ public class Commandpweather extends EssentialsCommand
User user = ess.getUser(sender.getPlayer()); User user = ess.getUser(sender.getPlayer());
if (user != null && (!users.contains(user) || users.size() > 1) && !user.isAuthorized("essentials.pweather.others")) if (user != null && (!users.contains(user) || users.size() > 1) && !user.isAuthorized("essentials.pweather.others"))
{ {
user.sendMessage(_("pWeatherOthersPermission")); user.sendMessage(tl("pWeatherOthersPermission"));
return; return;
} }
} }
@ -74,18 +74,18 @@ public class Commandpweather extends EssentialsCommand
{ {
if (users.size() > 1) if (users.size() > 1)
{ {
sender.sendMessage(_("pWeatherPlayers")); sender.sendMessage(tl("pWeatherPlayers"));
} }
for (User user : users) for (User user : users)
{ {
if (user.getPlayerWeather() == null) if (user.getPlayerWeather() == null)
{ {
sender.sendMessage(_("pWeatherNormal", user.getName())); sender.sendMessage(tl("pWeatherNormal", user.getName()));
} }
else 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(); user.resetPlayerWeather();
} }
sender.sendMessage(_("pWeatherReset", msg)); sender.sendMessage(tl("pWeatherReset", msg));
} }
else else
{ {
if (!weatherAliases.containsKey(weatherType)) if (!weatherAliases.containsKey(weatherType))
{ {
throw new NotEnoughArgumentsException(_("pWeatherInvalidAlias")); throw new NotEnoughArgumentsException(tl("pWeatherInvalidAlias"));
} }
for (User user : users) for (User user : users)
{ {
user.setPlayerWeather(weatherAliases.get(weatherType)); user.setPlayerWeather(weatherAliases.get(weatherType));
} }
sender.sendMessage(_("pWeatherSet", weatherType, msg.toString())); sender.sendMessage(tl("pWeatherSet", weatherType, msg.toString()));
} }
} }

View File

@ -2,7 +2,7 @@ package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; import com.earth2me.essentials.CommandSource;
import com.earth2me.essentials.Console; 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.IReplyTo;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import com.earth2me.essentials.utils.FormatUtil; import com.earth2me.essentials.utils.FormatUtil;
@ -46,12 +46,12 @@ public class Commandr extends EssentialsCommand
if (target == null || (target.isPlayer() && !target.getPlayer().isOnline())) 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; 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()) if (target.isPlayer())
{ {
User player = ess.getUser(target.getPlayer()); User player = ess.getUser(target.getPlayer());
@ -60,7 +60,7 @@ public class Commandr extends EssentialsCommand
return; return;
} }
} }
target.sendMessage(_("msgFormat", senderName, _("me"), message)); target.sendMessage(tl("msgFormat", senderName, tl("me"), message));
replyTo.setReplyTo(target); replyTo.setReplyTo(target);
if (target != sender) if (target != sender)
{ {

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.User;
import com.earth2me.essentials.utils.FormatUtil; import com.earth2me.essentials.utils.FormatUtil;
import java.util.Locale; import java.util.Locale;
@ -38,7 +38,7 @@ public class Commandrealname extends EssentialsCommand
if (displayName.contains(whois)) if (displayName.contains(whois))
{ {
foundUser = true; foundUser = true;
sender.sendMessage(u.getDisplayName() + " " + _("is") + " " + u.getName()); sender.sendMessage(u.getDisplayName() + " " + tl("is") + " " + u.getName());
} }
} }
if (!foundUser) if (!foundUser)

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.User;
import com.earth2me.essentials.utils.NumberUtil; import com.earth2me.essentials.utils.NumberUtil;
import java.util.HashMap; import java.util.HashMap;
@ -39,23 +39,23 @@ public class Commandrecipe extends EssentialsCommand
} }
else else
{ {
throw new Exception(_("invalidNumber")); throw new Exception(tl("invalidNumber"));
} }
} }
final List<Recipe> recipesOfType = ess.getServer().getRecipesFor(itemType); final List<Recipe> recipesOfType = ess.getServer().getRecipesFor(itemType);
if (recipesOfType.size() < 1) if (recipesOfType.size() < 1)
{ {
throw new Exception(_("recipeNone", getMaterialName(itemType))); throw new Exception(tl("recipeNone", getMaterialName(itemType)));
} }
if (recipeNo < 0 || recipeNo >= recipesOfType.size()) if (recipeNo < 0 || recipeNo >= recipesOfType.size())
{ {
throw new Exception(_("recipeBadIndex")); throw new Exception(tl("recipeBadIndex"));
} }
final Recipe selectedRecipe = recipesOfType.get(recipeNo); 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) if (selectedRecipe instanceof FurnaceRecipe)
{ {
@ -72,13 +72,13 @@ public class Commandrecipe extends EssentialsCommand
if (recipesOfType.size() > 1 && args.length == 1) 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) 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) 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(); 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(tl("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(tl("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[2][0]), colorMap.get(materials[2][1]), colorMap.get(materials[2][2])));
StringBuilder s = new StringBuilder(); StringBuilder s = new StringBuilder();
for (Material items : colorMap.keySet().toArray(new Material[colorMap.size()])) 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(" "); 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) if (stack == null)
{ {
return _("recipeNothing"); return tl("recipeNothing");
} }
return getMaterialName(stack.getType()); return getMaterialName(stack.getType());
} }
@ -184,7 +184,7 @@ public class Commandrecipe extends EssentialsCommand
{ {
if (type == null) if (type == null)
{ {
return _("recipeNothing"); return tl("recipeNothing");
} }
return type.toString().replace("_", " ").toLowerCase(Locale.ENGLISH); return type.toString().replace("_", " ").toLowerCase(Locale.ENGLISH);
} }

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.Mob;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import java.util.ArrayList; import java.util.ArrayList;
@ -69,7 +69,7 @@ public class Commandremove extends EssentialsCommand
if (world == null) if (world == null)
{ {
throw new Exception(_("invalidWorld")); throw new Exception(tl("invalidWorld"));
} }
if (args[0].contentEquals("*") || args[0].contentEquals("all")) if (args[0].contentEquals("*") || args[0].contentEquals("all"))
@ -136,7 +136,7 @@ public class Commandremove extends EssentialsCommand
if (warnUser) if (warnUser)
{ {
sender.sendMessage(_("invalidMob")); sender.sendMessage(tl("invalidMob"));
} }
for (Chunk chunk : world.getLoadedChunks()) for (Chunk chunk : world.getLoadedChunks())
@ -283,7 +283,7 @@ public class Commandremove extends EssentialsCommand
} }
} }
} }
sender.sendMessage(_("removed", removed)); sender.sendMessage(tl("removed", removed));
} }

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.*; import com.earth2me.essentials.*;
import static com.earth2me.essentials.I18n._; import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.utils.StringUtil; import com.earth2me.essentials.utils.StringUtil;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -44,14 +44,14 @@ public class Commandrepair extends EssentialsCommand
final ItemStack item = user.getItemInHand(); final ItemStack item = user.getItemInHand();
if (item == null || item.getType().isBlock() || item.getDurability() == 0) if (item == null || item.getType().isBlock() || item.getDurability() == 0)
{ {
throw new Exception(_("repairInvalidType")); throw new Exception(tl("repairInvalidType"));
} }
if (!item.getEnchantments().isEmpty() if (!item.getEnchantments().isEmpty()
&& !ess.getSettings().getRepairEnchanted() && !ess.getSettings().getRepairEnchanted()
&& !user.isAuthorized("essentials.repair.enchanted")) && !user.isAuthorized("essentials.repair.enchanted"))
{ {
throw new Exception(_("repairEnchanted")); throw new Exception(tl("repairEnchanted"));
} }
final String itemName = item.getType().toString().toLowerCase(Locale.ENGLISH); final String itemName = item.getType().toString().toLowerCase(Locale.ENGLISH);
@ -63,7 +63,7 @@ public class Commandrepair extends EssentialsCommand
charge.charge(user); charge.charge(user);
user.updateInventory(); user.updateInventory();
user.sendMessage(_("repair", itemName.replace('_', ' '))); user.sendMessage(tl("repair", itemName.replace('_', ' ')));
} }
public void repairAll(User user) throws Exception public void repairAll(User user) throws Exception
@ -79,11 +79,11 @@ public class Commandrepair extends EssentialsCommand
user.updateInventory(); user.updateInventory();
if (repaired.isEmpty()) if (repaired.isEmpty())
{ {
throw new Exception(_("repairNone")); throw new Exception(tl("repairNone"));
} }
else 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()); final Material material = Material.getMaterial(item.getTypeId());
if (material.isBlock() || material.getMaxDurability() < 1) if (material.isBlock() || material.getMaxDurability() < 1)
{ {
throw new Exception(_("repairInvalidType")); throw new Exception(tl("repairInvalidType"));
} }
if (item.getDurability() == 0) if (item.getDurability() == 0)
{ {
throw new Exception(_("repairAlreadyFixed")); throw new Exception(tl("repairAlreadyFixed"));
} }
item.setDurability((short)0); item.setDurability((short)0);

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.User;
import com.earth2me.essentials.UserMap; import com.earth2me.essentials.UserMap;
import com.earth2me.essentials.utils.DateUtil; import com.earth2me.essentials.utils.DateUtil;
@ -54,7 +54,7 @@ public class Commandseen extends EssentialsCommand
return; return;
} }
else if (FormatUtil.validIP(args[0]) && (server.getIPBans().contains(args[0]))) { else if (FormatUtil.validIP(args[0]) && (server.getIPBans().contains(args[0]))) {
sender.sendMessage(_("isIpBanned", args[0])); sender.sendMessage(tl("isIpBanned", args[0]));
return; return;
} }
else else
@ -70,31 +70,31 @@ public class Commandseen extends EssentialsCommand
{ {
user.setDisplayNick(); user.setDisplayNick();
sender.sendMessage(_("seenOnline", user.getDisplayName(), DateUtil.formatDateDiff(user.getLastLogin()))); sender.sendMessage(tl("seenOnline", user.getDisplayName(), DateUtil.formatDateDiff(user.getLastLogin())));
if (user.isAfk()) if (user.isAfk())
{ {
sender.sendMessage(_("whoisAFK", _("true"))); sender.sendMessage(tl("whoisAFK", tl("true")));
} }
if (user.isJailed()) if (user.isJailed())
{ {
sender.sendMessage(_("whoisJail", (user.getJailTimeout() > 0 sender.sendMessage(tl("whoisJail", (user.getJailTimeout() > 0
? DateUtil.formatDateDiff(user.getJailTimeout()) ? DateUtil.formatDateDiff(user.getJailTimeout())
: _("true")))); : tl("true"))));
} }
if (user.isMuted()) if (user.isMuted())
{ {
sender.sendMessage(_("whoisMuted", (user.getMuteTimeout() > 0 sender.sendMessage(tl("whoisMuted", (user.getMuteTimeout() > 0
? DateUtil.formatDateDiff(user.getMuteTimeout()) ? DateUtil.formatDateDiff(user.getMuteTimeout())
: _("true")))); : tl("true"))));
} }
final String location = user.getGeoLocation(); final String location = user.getGeoLocation();
if (location != null && (!(sender.isPlayer()) || ess.getUser(sender.getPlayer()).isAuthorized("essentials.geoip.show"))) 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 (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(); user.setDisplayNick();
if (user.getLastLogout() > 0) if (user.getLastLogout() > 0)
{ {
sender.sendMessage(_("seenOffline", user.getName(), DateUtil.formatDateDiff(user.getLastLogout()))); sender.sendMessage(tl("seenOffline", user.getName(), DateUtil.formatDateDiff(user.getLastLogout())));
} }
else else
{ {
sender.sendMessage(_("userUnknown", user.getName())); sender.sendMessage(tl("userUnknown", user.getName()));
} }
if (user.isBanned()) if (user.isBanned())
{ {
sender.sendMessage(_("whoisBanned", showBan ? user.getBanReason() : _("true"))); sender.sendMessage(tl("whoisBanned", showBan ? user.getBanReason() : tl("true")));
} }
final String location = user.getGeoLocation(); final String location = user.getGeoLocation();
if (location != null && (!(sender.isPlayer()) || ess.getUser(sender.getPlayer()).isAuthorized("essentials.geoip.show"))) 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 (extra)
{ {
if (!user.getLastLoginAddress().isEmpty()) if (!user.getLastLoginAddress().isEmpty())
{ {
sender.sendMessage(_("whoisIPAddress", user.getLastLoginAddress())); sender.sendMessage(tl("whoisIPAddress", user.getLastLoginAddress()));
} }
final Location loc = user.getLogoutLocation(); final Location loc = user.getLogoutLocation();
if (loc != null) 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)) 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() ess.runTaskAsynchronously(new Runnable()
{ {
@ -167,12 +167,12 @@ public class Commandseen extends EssentialsCommand
if (matches.size() > 0) if (matches.size() > 0)
{ {
sender.sendMessage(_("matchingIPAddress")); sender.sendMessage(tl("matchingIPAddress"));
sender.sendMessage(StringUtil.joinList(matches)); sender.sendMessage(StringUtil.joinList(matches));
} }
else else
{ {
sender.sendMessage(_("noMatchingPlayers")); sender.sendMessage(tl("noMatchingPlayers"));
} }
} }

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials.commands; 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.Trade;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import com.earth2me.essentials.utils.NumberUtil; import com.earth2me.essentials.utils.NumberUtil;
@ -63,11 +63,11 @@ public class Commandsell extends EssentialsCommand
{ {
if (args[0].equalsIgnoreCase("blocks")) if (args[0].equalsIgnoreCase("blocks"))
{ {
user.sendMessage(_("totalWorthBlocks", type, NumberUtil.displayCurrency(totalWorth, ess))); user.sendMessage(tl("totalWorthBlocks", type, NumberUtil.displayCurrency(totalWorth, ess)));
} }
else 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) if (worth == null)
{ {
throw new Exception(_("itemCannotBeSold")); throw new Exception(tl("itemCannotBeSold"));
} }
if (amount <= 0) if (amount <= 0)
{ {
if (!isBulkSell) { 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; return BigDecimal.ZERO;
} }
@ -104,8 +104,8 @@ public class Commandsell extends EssentialsCommand
user.updateInventory(); user.updateInventory();
Trade.log("Command", "Sell", "Item", user.getName(), new Trade(ris, ess), user.getName(), new Trade(result, ess), user.getLocation(), ess); Trade.log("Command", "Sell", "Item", user.getName(), new Trade(ris, ess), user.getName(), new Trade(result, ess), user.getLocation(), ess);
user.giveMoney(result); user.giveMoney(result);
user.sendMessage(_("itemSold", NumberUtil.displayCurrency(result, ess), amount, is.getType().toString().toLowerCase(Locale.ENGLISH), 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, _("itemSoldConsole", user.getDisplayName(), is.getType().toString().toLowerCase(Locale.ENGLISH), NumberUtil.displayCurrency(result, ess), amount, 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; return result;
} }
} }

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials.commands; 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.User;
import com.earth2me.essentials.utils.NumberUtil; import com.earth2me.essentials.utils.NumberUtil;
import java.util.Locale; import java.util.Locale;
@ -54,10 +54,10 @@ public class Commandsethome extends EssentialsCommand
} }
if ("bed".equals(name) || NumberUtil.isInt(name)) if ("bed".equals(name) || NumberUtil.isInt(name))
{ {
throw new NoSuchFieldException(_("invalidHomeName")); throw new NoSuchFieldException(tl("invalidHomeName"));
} }
usersHome.setHome(name, location); 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) 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) if (limit == 1)
{ {

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials.commands; 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.User;
import com.earth2me.essentials.utils.StringUtil; import com.earth2me.essentials.utils.StringUtil;
import org.bukkit.Server; import org.bukkit.Server;
@ -21,7 +21,7 @@ public class Commandsetjail extends EssentialsCommand
throw new NotEnoughArgumentsException(); throw new NotEnoughArgumentsException();
} }
ess.getJails().setJail(args[0], user.getLocation()); ess.getJails().setJail(args[0], user.getLocation());
user.sendMessage(_("jailSet", StringUtil.sanitizeString(args[0]))); user.sendMessage(tl("jailSet", StringUtil.sanitizeString(args[0])));
} }
} }

View File

@ -1,6 +1,6 @@
package com.earth2me.essentials.commands; 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.User;
import com.earth2me.essentials.api.IWarps; import com.earth2me.essentials.api.IWarps;
import com.earth2me.essentials.utils.NumberUtil; import com.earth2me.essentials.utils.NumberUtil;
@ -27,7 +27,7 @@ public class Commandsetwarp extends EssentialsCommand
if (NumberUtil.isInt(args[0]) || args[0].isEmpty()) if (NumberUtil.isInt(args[0]) || args[0].isEmpty())
{ {
throw new NoSuchFieldException(_("invalidWarpName")); throw new NoSuchFieldException(tl("invalidWarpName"));
} }
final Location loc = user.getLocation(); final Location loc = user.getLocation();
@ -51,8 +51,8 @@ public class Commandsetwarp extends EssentialsCommand
} }
else else
{ {
throw new Exception(_("warpOverwrite")); throw new Exception(tl("warpOverwrite"));
} }
user.sendMessage(_("warpSet", args[0])); user.sendMessage(tl("warpSet", args[0]));
} }
} }

View File

@ -1,7 +1,7 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; 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.User;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
@ -37,7 +37,7 @@ public class Commandsetworth extends EssentialsCommand
} }
ess.getWorth().setPrice(stack, Double.parseDouble(price)); ess.getWorth().setPrice(stack, Double.parseDouble(price));
user.sendMessage(_("worthSet")); user.sendMessage(tl("worthSet"));
} }
@Override @Override
@ -50,6 +50,6 @@ public class Commandsetworth extends EssentialsCommand
ItemStack stack = ess.getItemDb().get(args[0]); ItemStack stack = ess.getItemDb().get(args[0]);
ess.getWorth().setPrice(stack, Double.parseDouble(args[1])); ess.getWorth().setPrice(stack, Double.parseDouble(args[1]));
sender.sendMessage(_("worthSet")); sender.sendMessage(tl("worthSet"));
} }
} }

Some files were not shown because too many files have changed in this diff Show More