mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-11 09:05:01 +02:00
Moving all default messages back to the code, where they should be
Also tweaking I18n class and YamlStorageWriter a bit
This commit is contained in:
3744
Essentials/po/en.po
3744
Essentials/po/en.po
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -109,7 +109,7 @@
|
||||
<configuration>
|
||||
<poDirectory>${basedir}/po/</poDirectory>
|
||||
<targetBundle>messages2</targetBundle>
|
||||
<keywords>-k_ -k -s --package-name=Essentials --package-version=${project.version} --copyright-holder="Essentials Team"</keywords>
|
||||
<keywords>-k_ -kComment -k -s --package-name=Essentials --package-version=${project.version} --copyright-holder="Essentials Team"</keywords>
|
||||
<outputFormat>properties</outputFormat>
|
||||
<sourceDirectory>${basedir}/../</sourceDirectory>
|
||||
</configuration>
|
||||
|
@@ -119,7 +119,7 @@ public class Essentials implements IEssentials
|
||||
throw new IOException();
|
||||
}
|
||||
|
||||
logger.log(Level.INFO, _("usingTempFolderForTesting"));
|
||||
logger.log(Level.INFO, _("Using temp folder for testing:"));
|
||||
logger.log(Level.INFO, dataFolder.toString());
|
||||
storageQueue.setEnabled(true);
|
||||
settings = new SettingsHolder(this);
|
||||
@@ -193,7 +193,7 @@ public class Essentials implements IEssentials
|
||||
if (user.isVanished())
|
||||
{
|
||||
user.toggleVanished();
|
||||
p.sendMessage(_("unvanishedReload"));
|
||||
p.sendMessage(_("A reload has forced you to become visible."));
|
||||
}
|
||||
}
|
||||
i18n.onDisable();
|
||||
|
@@ -66,7 +66,7 @@ public class EssentialsTimer implements Runnable
|
||||
final List<String> mail = user.getMails();
|
||||
if (mail != null && !mail.isEmpty())
|
||||
{
|
||||
user.sendMessage(I18n._("youHaveNewMail", mail.size()));
|
||||
user.sendMessage(I18n._("You have {0} messages! Type /mail read to view your mail.", mail.size()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -23,7 +23,6 @@ public class I18n implements II18n
|
||||
private Locale currentLocale = defaultLocale;
|
||||
private ResourceBundle customBundle;
|
||||
private ResourceBundle localeBundle;
|
||||
private final ResourceBundle defaultBundle;
|
||||
private final Map<String, MessageFormat> messageFormatCache = new HashMap<String, MessageFormat>();
|
||||
private final IEssentials ess;
|
||||
|
||||
@@ -32,7 +31,6 @@ public class I18n implements II18n
|
||||
this.ess = ess;
|
||||
customBundle = ResourceBundle.getBundle(MESSAGES, defaultLocale, new FileResClassLoader(I18n.class.getClassLoader(), ess));
|
||||
localeBundle = ResourceBundle.getBundle(MESSAGES, defaultLocale);
|
||||
defaultBundle = ResourceBundle.getBundle(MESSAGES, Locale.ENGLISH);
|
||||
}
|
||||
|
||||
public void onEnable()
|
||||
@@ -66,10 +64,7 @@ public class I18n implements II18n
|
||||
}
|
||||
catch (MissingResourceException ex)
|
||||
{
|
||||
Logger.getLogger("Minecraft").log(
|
||||
Level.WARNING, String.format(
|
||||
"Missing translation key \"%s\" in translation file %s", ex.getKey(), localeBundle.getLocale().toString()), ex);
|
||||
return defaultBundle.getString(string);
|
||||
return string;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +90,7 @@ public class I18n implements II18n
|
||||
MessageFormat messageFormat = messageFormatCache.get(format);
|
||||
if (messageFormat == null)
|
||||
{
|
||||
messageFormat = new MessageFormat(format);
|
||||
messageFormat = new MessageFormat(format.replace("'","''"));
|
||||
messageFormatCache.put(format, messageFormat);
|
||||
}
|
||||
return messageFormat.format(objects);
|
||||
|
@@ -145,14 +145,14 @@ public class ItemDb implements IItemDb
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception(_("unknownItemName", id));
|
||||
throw new Exception(_("Unknown item name: {0}", id));
|
||||
}
|
||||
}
|
||||
|
||||
final Material mat = Material.getMaterial(itemid);
|
||||
if (mat == null)
|
||||
{
|
||||
throw new Exception(_("unknownItemId", itemid));
|
||||
throw new Exception(_("Unknown item id: {0}", itemid));
|
||||
}
|
||||
final ItemStack retval = new ItemStack(mat, mat.getMaxStackSize(), metaData);
|
||||
return retval;
|
||||
|
@@ -53,12 +53,12 @@ public class Jails extends AsyncStorageObjectHolder<net.ess3.settings.Jails> imp
|
||||
{
|
||||
if (getData().getJails() == null || jailName == null || !getData().getJails().containsKey(jailName.toLowerCase(Locale.ENGLISH)))
|
||||
{
|
||||
throw new Exception(_("jailNotExist"));
|
||||
throw new Exception(_("That jail does not exist."));
|
||||
}
|
||||
Location loc = getData().getJails().get(jailName.toLowerCase(Locale.ENGLISH)).getStoredLocation();
|
||||
if (loc == null || loc.getWorld() == null)
|
||||
{
|
||||
throw new Exception(_("jailNotExist"));
|
||||
throw new Exception(_("That jail does not exist."));
|
||||
}
|
||||
return loc;
|
||||
}
|
||||
@@ -174,11 +174,11 @@ public class Jails extends AsyncStorageObjectHolder<net.ess3.settings.Jails> imp
|
||||
{
|
||||
if (ess.getSettings().isDebug())
|
||||
{
|
||||
LOGGER.log(Level.INFO, _("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage()), ex);
|
||||
LOGGER.log(Level.INFO, _("Error occurred when trying to return player {0} to jail: {1}.", user.getName(), ex.getLocalizedMessage()), ex);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.log(Level.INFO, _("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage()));
|
||||
LOGGER.log(Level.INFO, _("Error occurred when trying to return player {0} to jail: {1}.", user.getName(), ex.getLocalizedMessage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -200,14 +200,14 @@ public class Jails extends AsyncStorageObjectHolder<net.ess3.settings.Jails> imp
|
||||
{
|
||||
if (ess.getSettings().isDebug())
|
||||
{
|
||||
LOGGER.log(Level.INFO, _("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage()), ex);
|
||||
LOGGER.log(Level.INFO, _("Error occurred when trying to return player {0} to jail: {1}.", user.getName(), ex.getLocalizedMessage()), ex);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.log(Level.INFO, _("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage()));
|
||||
LOGGER.log(Level.INFO, _("Error occurred when trying to return player {0} to jail: {1}.", user.getName(), ex.getLocalizedMessage()));
|
||||
}
|
||||
}
|
||||
user.sendMessage(_("jailMessage"));
|
||||
user.sendMessage(_("You do the crime, you do the time."));
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
@@ -227,14 +227,14 @@ public class Jails extends AsyncStorageObjectHolder<net.ess3.settings.Jails> imp
|
||||
{
|
||||
if (ess.getSettings().isDebug())
|
||||
{
|
||||
LOGGER.log(Level.INFO, _("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage()), ex);
|
||||
LOGGER.log(Level.INFO, _("Error occurred when trying to return player {0} to jail: {1}.", user.getName(), ex.getLocalizedMessage()), ex);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.log(Level.INFO, _("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage()));
|
||||
LOGGER.log(Level.INFO, _("Error occurred when trying to return player {0} to jail: {1}.", user.getName(), ex.getLocalizedMessage()));
|
||||
}
|
||||
}
|
||||
user.sendMessage(_("jailMessage"));
|
||||
user.sendMessage(_("You do the crime, you do the time."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -27,12 +27,12 @@ public class Kits extends AsyncStorageObjectHolder<net.ess3.settings.Kits> imple
|
||||
{
|
||||
if (getData().getKits() == null || kitName == null || !getData().getKits().containsKey(kitName.toLowerCase(Locale.ENGLISH)))
|
||||
{
|
||||
throw new Exception(_("kitError2"));
|
||||
throw new Exception(_("That kit does not exist or is improperly defined."));
|
||||
}
|
||||
final Kit kit = getData().getKits().get(kitName.toLowerCase(Locale.ENGLISH));
|
||||
if (kit == null)
|
||||
{
|
||||
throw new Exception(_("kitError2"));
|
||||
throw new Exception(_("That kit does not exist or is improperly defined."));
|
||||
}
|
||||
return kit;
|
||||
}
|
||||
@@ -98,7 +98,7 @@ public class Kits extends AsyncStorageObjectHolder<net.ess3.settings.Kits> imple
|
||||
time.setTimeInMillis(lastTime);
|
||||
time.add(Calendar.SECOND, (int)delay);
|
||||
time.add(Calendar.MILLISECOND, (int)((delay * 1000.0) % 1000.0));
|
||||
user.sendMessage(_("kitTimed", DateUtil.formatDateDiff(time.getTimeInMillis())));
|
||||
user.sendMessage(_("You can't use that kit again for another {0}.", DateUtil.formatDateDiff(time.getTimeInMillis())));
|
||||
throw new NoChargeException();
|
||||
}
|
||||
}
|
||||
|
@@ -499,7 +499,7 @@ public class MetaItemStack
|
||||
|
||||
if (!hasMetaPermission(user, "enchantments." + enchantmentName, true, false))
|
||||
{
|
||||
throw new Exception(_("enchantmentPerm", enchantmentName));
|
||||
throw new Exception(_(" You do not have the permission for {0}.", enchantmentName));
|
||||
}
|
||||
return enchantment;
|
||||
}
|
||||
|
@@ -90,7 +90,7 @@ public class SpawnMob
|
||||
final Block block = LocationUtil.getTarget(user.getPlayer()).getBlock();
|
||||
if (block == null)
|
||||
{
|
||||
throw new Exception(_("unableToSpawnMob"));
|
||||
throw new Exception(_("Unable to spawn mob."));
|
||||
}
|
||||
spawnmob(ess, server, user, user, block.getLocation(), parts, data, mobCount);
|
||||
}
|
||||
@@ -124,7 +124,7 @@ public class SpawnMob
|
||||
if (mobCount > serverLimit)
|
||||
{
|
||||
mobCount = serverLimit;
|
||||
sender.sendMessage(_("mobSpawnLimit"));
|
||||
sender.sendMessage(_("Mob quantity limited to server limit."));
|
||||
}
|
||||
|
||||
EntityType mob = LivingEntities.fromName(parts.get(0));
|
||||
@@ -138,15 +138,15 @@ public class SpawnMob
|
||||
}
|
||||
catch (MobException e1)
|
||||
{
|
||||
throw new Exception(_("unableToSpawnMob"), e1);
|
||||
throw new Exception(_("Unable to spawn mob."), e1);
|
||||
}
|
||||
catch (NumberFormatException e2)
|
||||
{
|
||||
throw new Exception(_("numberRequired"), e2);
|
||||
throw new Exception(_("A number goes there, silly."), e2);
|
||||
}
|
||||
catch (NullPointerException np)
|
||||
{
|
||||
throw new Exception(_("soloMob"), np);
|
||||
throw new Exception(_("That mob likes to be alone."), np);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -192,12 +192,12 @@ public class SpawnMob
|
||||
{
|
||||
if (mob == null)
|
||||
{
|
||||
throw new Exception(_("invalidMob"));
|
||||
throw new Exception(_("Invalid mob type."));
|
||||
}
|
||||
|
||||
if (!Permissions.SPAWNMOB.isAuthorized((User) sender, mob.getName()))
|
||||
{
|
||||
throw new Exception(_("noPermToSpawnMob"));
|
||||
throw new Exception(_("You don't have permission to spawn this mob."));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ public class SpawnMob
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new Exception(_("slimeMalformedSize"), e);
|
||||
throw new Exception(_("Malformed size."), e);
|
||||
}
|
||||
}
|
||||
if (spawned instanceof Ageable && data.contains("baby"))
|
||||
@@ -238,7 +238,7 @@ public class SpawnMob
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new Exception(_("sheepMalformedColor"), e);
|
||||
throw new Exception(_("Malformed color."), e);
|
||||
}
|
||||
}
|
||||
if (spawned instanceof Tameable && data.contains("tamed") && target != null)
|
||||
|
@@ -91,7 +91,7 @@ public class Teleport implements Runnable, ITeleport
|
||||
try
|
||||
{
|
||||
cooldown(false);
|
||||
teleportUser.sendMessage(_("teleportationCommencing"));
|
||||
teleportUser.sendMessage(_("Teleportation commencing..."));
|
||||
try
|
||||
{
|
||||
|
||||
@@ -108,10 +108,10 @@ public class Teleport implements Runnable, ITeleport
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
user.sendMessage(_("cooldownWithMessage", ex.getMessage()));
|
||||
user.sendMessage(_("Cooldown: {0}", ex.getMessage()));
|
||||
if (user != teleportUser)
|
||||
{
|
||||
teleportUser.sendMessage(_("cooldownWithMessage", ex.getMessage()));
|
||||
teleportUser.sendMessage(_("Cooldown: {0}", ex.getMessage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -132,7 +132,7 @@ public class Teleport implements Runnable, ITeleport
|
||||
}
|
||||
catch (CooldownException ex)
|
||||
{
|
||||
throw new Exception(_("timeBeforeTeleport", ex.getMessage()));
|
||||
throw new Exception(_("Time before next teleport: {0}", ex.getMessage()));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -149,10 +149,10 @@ public class Teleport implements Runnable, ITeleport
|
||||
ess.getPlugin().cancelTask(teleTimer);
|
||||
if (notifyUser)
|
||||
{
|
||||
user.sendMessage(_("pendingTeleportCancelled"));
|
||||
user.sendMessage(_("Pending teleportation request cancelled."));
|
||||
if (teleportUser != user)
|
||||
{
|
||||
teleportUser.sendMessage(_("pendingTeleportCancelled"));
|
||||
teleportUser.sendMessage(_("Pending teleportation request cancelled."));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -288,7 +288,7 @@ public class Teleport implements Runnable, ITeleport
|
||||
final Calendar c = new GregorianCalendar();
|
||||
c.add(Calendar.SECOND, (int)delay);
|
||||
c.add(Calendar.MILLISECOND, (int)((delay * 1000.0) % 1000.0));
|
||||
user.sendMessage(_("dontMoveMessage", DateUtil.formatDateDiff(c.getTimeInMillis())));
|
||||
user.sendMessage(_("Teleportation will commence in {0}. Don't move.", DateUtil.formatDateDiff(c.getTimeInMillis())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -304,7 +304,7 @@ public class Teleport implements Runnable, ITeleport
|
||||
public void warp(String warp, Trade chargeFor, TeleportCause cause) throws Exception
|
||||
{
|
||||
final Location loc = ess.getWarps().getWarp(warp);
|
||||
user.sendMessage(_("warpingTo", warp));
|
||||
user.sendMessage(_("Warping to {0}.", warp));
|
||||
teleport(new Target(loc), chargeFor, cause);
|
||||
}
|
||||
|
||||
|
@@ -49,7 +49,7 @@ public class Warps extends StorageObjectMap<IWarp> implements IWarps
|
||||
final IWarp warp = getObject(name);
|
||||
if (warp == null)
|
||||
{
|
||||
throw new WarpNotFoundException(_("warpNotExist"));
|
||||
throw new WarpNotFoundException(_("That warp does not exist."));
|
||||
}
|
||||
return warp.getData().getLocation().getStoredLocation();
|
||||
}
|
||||
|
@@ -12,6 +12,6 @@ public class NoLoanPermittedException extends Exception
|
||||
|
||||
public NoLoanPermittedException()
|
||||
{
|
||||
super(_("negativeBalanceError"));
|
||||
super(_("User is not allowed to have a negative balance."));
|
||||
}
|
||||
}
|
||||
|
@@ -12,6 +12,6 @@ public class UserDoesNotExistException extends Exception
|
||||
|
||||
public UserDoesNotExistException(String name)
|
||||
{
|
||||
super(_("userDoesNotExist", name));
|
||||
super(_("The user {0} does not exist.", name));
|
||||
}
|
||||
}
|
||||
|
@@ -65,7 +65,7 @@ public class Backup implements Runnable, IBackup
|
||||
return;
|
||||
}*/
|
||||
|
||||
ess.getLogger().log(Level.INFO, _("backupStarted"));
|
||||
ess.getLogger().log(Level.INFO, _("Backup started."));
|
||||
|
||||
if (!backupSettings.getCommandsBeforeBackup().isEmpty())
|
||||
{
|
||||
@@ -153,7 +153,7 @@ public class Backup implements Runnable, IBackup
|
||||
}
|
||||
|
||||
active.set(false);
|
||||
ess.getLogger().log(Level.INFO, _("backupFinished"));
|
||||
ess.getLogger().log(Level.INFO, _("Backup finished."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -55,11 +55,11 @@ public class BukkitPlugin extends JavaPlugin implements IPlugin
|
||||
{
|
||||
if (pm.getPlugin("EssentialsUpdate") == null)
|
||||
{
|
||||
getLogger().log(Level.SEVERE, _("essentialsHelp1"));
|
||||
getLogger().log(Level.SEVERE, _("The file is broken and Essentials can't open it. Essentials is now disabled. If you can't fix the file yourself, go to http://tiny.cc/EssentialsChat"));
|
||||
}
|
||||
else
|
||||
{
|
||||
getLogger().log(Level.SEVERE, _("essentialsHelp2"));
|
||||
getLogger().log(Level.SEVERE, _("The file is broken and Essentials can't open it. Essentials is now disabled. If you can't fix the file yourself, either type /essentialshelp in game or go to http://tiny.cc/EssentialsChat"));
|
||||
}
|
||||
getLogger().log(Level.SEVERE, ex.toString());
|
||||
pm.registerEvents(
|
||||
|
@@ -23,7 +23,7 @@ public class VersionCheck
|
||||
{
|
||||
if (p.getDescription().getName().startsWith("Essentials") && !p.getDescription().getVersion().equals(pluginVersion))
|
||||
{
|
||||
p.getLogger().log(Level.WARNING, _("versionMismatch", p.getDescription().getName()));
|
||||
p.getLogger().log(Level.WARNING, _("Version mismatch! Please update {0} to the same version.", p.getDescription().getName()));
|
||||
}
|
||||
}
|
||||
final Matcher versionMatch = bukkitVersionPattern.matcher(plugin.getServer().getVersion());
|
||||
@@ -32,14 +32,14 @@ public class VersionCheck
|
||||
final int versionNumber = Integer.parseInt(versionMatch.group(1));
|
||||
if (versionNumber < BUKKIT_VERSION && versionNumber > 100)
|
||||
{
|
||||
log.log(Level.SEVERE, _("notRecommendedBukkit"));
|
||||
log.log(Level.SEVERE, _("requiredBukkit", Integer.toString(BUKKIT_VERSION)));
|
||||
log.log(Level.SEVERE, _(" * ! * Bukkit version is not the recommended build for Essentials."));
|
||||
log.log(Level.SEVERE, _(" * ! * You need atleast build {0} of CraftBukkit, download it from http://dl.bukkit.org/downloads/craftbukkit/", Integer.toString(BUKKIT_VERSION)));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
log.log(Level.INFO, _("bukkitFormatChanged"));
|
||||
log.log(Level.INFO, _("Bukkit version format changed. Version not checked."));
|
||||
log.log(Level.INFO, plugin.getServer().getVersion());
|
||||
log.log(Level.INFO, plugin.getServer().getBukkitVersion());
|
||||
}
|
||||
|
@@ -28,14 +28,14 @@ public class Commandafk extends EssentialsCommand
|
||||
{
|
||||
if (!user.toggleAfk())
|
||||
{
|
||||
//user.sendMessage(_("markedAsNotAway"));
|
||||
ess.broadcastMessage(user, _("userIsNotAway", user.getPlayer().getDisplayName()));
|
||||
//user.sendMessage(_("You are no longer marked as away."));
|
||||
ess.broadcastMessage(user, _("{0} is no longer AFK.", user.getPlayer().getDisplayName()));
|
||||
user.updateActivity(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
//user.sendMessage(_("markedAsAway"));
|
||||
ess.broadcastMessage(user, _("userIsAway", user.getPlayer().getDisplayName()));
|
||||
//user.sendMessage(_("You are now marked as away."));
|
||||
ess.broadcastMessage(user, _("{0} is now AFK.", user.getPlayer().getDisplayName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@ public class Commandback extends EssentialsCommand
|
||||
{
|
||||
final Trade charge = new Trade(commandName, ess);
|
||||
charge.isAffordableFor(user);
|
||||
user.sendMessage(_("backUsageMsg"));
|
||||
user.sendMessage(_("Returning to previous location."));
|
||||
user.getTeleport().back(charge);
|
||||
throw new NoChargeException();
|
||||
}
|
||||
|
@@ -12,6 +12,6 @@ public class Commandbackup extends EssentialsCommand
|
||||
{
|
||||
final IBackup backup = ess.getBackup();
|
||||
backup.run();
|
||||
sender.sendMessage(_("backupStarted"));
|
||||
sender.sendMessage(_("Backup started."));
|
||||
}
|
||||
}
|
||||
|
@@ -16,13 +16,13 @@ public class Commandbalance extends EssentialsCommand
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
sender.sendMessage(_("balance", FormatUtil.displayCurrency(ess.getUserMap().matchUser(args[0], true).getMoney(), ess)));
|
||||
sender.sendMessage(_("Balance: {0}", FormatUtil.displayCurrency(ess.getUserMap().matchUser(args[0], true).getMoney(), ess)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
{
|
||||
final double bal = (args.length < 1 || !Permissions.BALANCE_OTHERS.isAuthorized(user) ? user : ess.getUserMap().matchUser(args[0], true)).getMoney();
|
||||
user.sendMessage(_("balance", FormatUtil.displayCurrency(bal, ess)));
|
||||
user.sendMessage(_("Balance: {0}", FormatUtil.displayCurrency(bal, ess)));
|
||||
}
|
||||
}
|
||||
|
@@ -77,7 +77,7 @@ public class Commandbalancetop extends EssentialsCommand
|
||||
}
|
||||
if (ess.getUserMap().getUniqueUsers() > MINUSERS)
|
||||
{
|
||||
sender.sendMessage(_("orderBalances", ess.getUserMap().getUniqueUsers()));
|
||||
sender.sendMessage(_("Ordering balances of {0} users, please wait ...", ess.getUserMap().getUniqueUsers()));
|
||||
}
|
||||
}
|
||||
finally
|
||||
@@ -90,7 +90,7 @@ public class Commandbalancetop extends EssentialsCommand
|
||||
{
|
||||
if (ess.getUserMap().getUniqueUsers() > MINUSERS)
|
||||
{
|
||||
sender.sendMessage(_("orderBalances", ess.getUserMap().getUniqueUsers()));
|
||||
sender.sendMessage(_("Ordering balances of {0} users, please wait ...", ess.getUserMap().getUniqueUsers()));
|
||||
}
|
||||
ess.getPlugin().runTaskAsynchronously(new Viewer(sender, page, force));
|
||||
}
|
||||
@@ -102,7 +102,7 @@ public class Commandbalancetop extends EssentialsCommand
|
||||
final Calendar cal = Calendar.getInstance();
|
||||
cal.setTimeInMillis(cacheage);
|
||||
final DateFormat format = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
|
||||
sender.sendMessage(_("balanceTop", format.format(cal.getTime())));
|
||||
sender.sendMessage(_("Top balances ({0})", format.format(cal.getTime())));
|
||||
new TextPager(cache).showPage(Integer.toString(page), "", "balancetop", sender);
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ public class Commandbalancetop extends EssentialsCommand
|
||||
}
|
||||
});
|
||||
|
||||
cache.getLines().add(_("serverTotal", FormatUtil.displayCurrency(totalMoney, ess)));
|
||||
cache.getLines().add(_("Server Total: {0}", FormatUtil.displayCurrency(totalMoney, ess)));
|
||||
int pos = 1;
|
||||
for (Map.Entry<String, Double> entry : sortedEntries)
|
||||
{
|
||||
|
@@ -25,7 +25,7 @@ public class Commandban extends EssentialsCommand
|
||||
{
|
||||
if (isUser(sender) && Permissions.BAN_OFFLINE.isAuthorized(sender))
|
||||
{
|
||||
sender.sendMessage(_("banExempt"));
|
||||
sender.sendMessage(_("You can not ban that player."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,7 @@ public class Commandban extends EssentialsCommand
|
||||
{
|
||||
if (isUser(sender) && Permissions.BAN_EXEMPT.isAuthorized(user))
|
||||
{
|
||||
sender.sendMessage(_("banExempt"));
|
||||
sender.sendMessage(_("You can not ban that player."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -45,12 +45,12 @@ public class Commandban extends EssentialsCommand
|
||||
if (args.length > 1)
|
||||
{
|
||||
|
||||
banReason = _("banFormat", FormatUtil.replaceFormat(getFinalArg(args, 1).replace("\\n", "\n").replace("|", "\n")), senderName);
|
||||
banReason = _("Banned: {0}", FormatUtil.replaceFormat(getFinalArg(args, 1).replace("\\n", "\n").replace("|", "\n")), senderName);
|
||||
userData.getBan().setReason(banReason);
|
||||
}
|
||||
else
|
||||
{
|
||||
banReason = _("banFormat", _("defaultBanReason"), senderName);
|
||||
banReason = _("Banned: {0}", _("The Ban Hammer has spoken!"), senderName);
|
||||
userData.getBan().setReason("");
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public class Commandban extends EssentialsCommand
|
||||
{
|
||||
if (Permissions.BAN_NOTIFY.isAuthorized(player))
|
||||
{
|
||||
player.sendMessage(_("playerBanned", senderName, user.getName(), banReason));
|
||||
player.sendMessage(_("Player {0} banned {1} for {2}.", senderName, user.getName(), banReason));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -22,7 +22,7 @@ public class Commandbanip extends EssentialsCommand
|
||||
if(args[0].matches("\\b(?:\\d{1,3}\\.){3}\\d{1,3}\\b"))
|
||||
{
|
||||
ess.getServer().banIP(args[0]);
|
||||
sender.sendMessage(_("banIpAddress"));
|
||||
sender.sendMessage(_("Banned IP address"));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -34,10 +34,10 @@ public class Commandbanip extends EssentialsCommand
|
||||
final String ipAddress = player.getData().getIpAddress();
|
||||
if (ipAddress.length() == 0)
|
||||
{
|
||||
throw new Exception(_("playerNotFound"));
|
||||
throw new Exception(_("Player not found."));
|
||||
}
|
||||
ess.getServer().banIP(ipAddress);
|
||||
sender.sendMessage(_("banIpAddress"));
|
||||
sender.sendMessage(_("Banned IP address"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -41,11 +41,11 @@ public class Commandbigtree extends EssentialsCommand
|
||||
final boolean success = user.getPlayer().getWorld().generateTree(safeLocation, bukkitTree);
|
||||
if (success)
|
||||
{
|
||||
user.sendMessage(_("bigTreeSuccess"));
|
||||
user.sendMessage(_(" Big tree spawned."));
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception(_("bigTreeFailure"));
|
||||
throw new Exception(_("Big tree generation failure. Try again on grass or dirt."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -25,7 +25,7 @@ public class Commandbreak extends EssentialsCommand
|
||||
}
|
||||
if (block.getType() == Material.BEDROCK && !Permissions.BREAK_BEDROCK.isAuthorized(user))
|
||||
{
|
||||
throw new Exception(_("noBreakBedrock"));
|
||||
throw new Exception(_("You are not allowed to destroy bedrock."));
|
||||
}
|
||||
//final List<ItemStack> list = (List<ItemStack>)block.getDrops();
|
||||
//final BlockBreakEvent event = new BlockBreakEvent(block, user.getBase(), list);
|
||||
|
@@ -14,6 +14,6 @@ public class Commandbroadcast extends EssentialsCommand
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
ess.broadcastMessage(null, _("broadcast", FormatUtil.replaceFormat(getFinalArg(args, 0))));
|
||||
ess.broadcastMessage(null, _("[Broadcast] {0}", FormatUtil.replaceFormat(getFinalArg(args, 0))));
|
||||
}
|
||||
}
|
||||
|
@@ -20,7 +20,7 @@ public class Commandburn extends EssentialsCommand
|
||||
{
|
||||
final Player player = p.getPlayer();
|
||||
player.setFireTicks(Integer.parseInt(args[1]) * 20);
|
||||
sender.sendMessage(_("burnMsg", player.getDisplayName(), Integer.parseInt(args[1])));
|
||||
sender.sendMessage(_("You set {0} on fire for {1} seconds.", player.getDisplayName(), Integer.parseInt(args[1])));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -20,17 +20,17 @@ public class Commandclearinventory extends EssentialsCommand
|
||||
{
|
||||
final Player player = p.getPlayer();
|
||||
player.getInventory().clear();
|
||||
user.sendMessage(_("inventoryClearedOthers", player.getDisplayName()));
|
||||
user.sendMessage(_("Inventory of {0} cleared.", player.getDisplayName()));
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception(_("playerNotFound"));
|
||||
throw new Exception(_("Player not found."));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
user.getPlayer().getInventory().clear();
|
||||
user.sendMessage(_("inventoryCleared"));
|
||||
user.sendMessage(_("Inventory Cleared."));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,11 +51,11 @@ public class Commandclearinventory extends EssentialsCommand
|
||||
for (Player p : online)
|
||||
{
|
||||
p.getInventory().clear();
|
||||
sender.sendMessage(_("inventoryClearedOthers", p.getDisplayName()));
|
||||
sender.sendMessage(_("Inventory of {0} cleared.", p.getDisplayName()));
|
||||
}
|
||||
return;
|
||||
}
|
||||
throw new Exception(_("playerNotFound"));
|
||||
throw new Exception(_("Player not found."));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -63,11 +63,11 @@ public class Commandclearinventory extends EssentialsCommand
|
||||
if (u != null)
|
||||
{
|
||||
u.getInventory().clear();
|
||||
sender.sendMessage(_("inventoryClearedOthers", u.getDisplayName()));
|
||||
sender.sendMessage(_("Inventory of {0} cleared.", u.getDisplayName()));
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception(_("playerNotFound"));
|
||||
throw new Exception(_("Player not found."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -47,6 +47,6 @@ public class Commandcompass extends EssentialsCommand
|
||||
{
|
||||
dir = "N";
|
||||
}
|
||||
user.sendMessage(_("compassBearing", dir, bearing));
|
||||
user.sendMessage(_("Bearing: {0} ({1} degrees).", dir, bearing));
|
||||
}
|
||||
}
|
||||
|
@@ -54,6 +54,6 @@ public class Commanddelhome extends EssentialsCommand
|
||||
}
|
||||
user.getData().removeHome(name.toLowerCase(Locale.ENGLISH));
|
||||
user.queueSave();
|
||||
sender.sendMessage(_("deleteHome", name));
|
||||
sender.sendMessage(_("Home {0} has been removed.", name));
|
||||
}
|
||||
}
|
||||
|
@@ -14,6 +14,6 @@ public class Commanddeljail extends EssentialsCommand
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
ess.getJails().removeJail(args[0]);
|
||||
sender.sendMessage(_("deleteJail", args[0]));
|
||||
sender.sendMessage(_("Jail {0} has been removed.", args[0]));
|
||||
}
|
||||
}
|
||||
|
@@ -14,6 +14,6 @@ public class Commanddelwarp extends EssentialsCommand
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
ess.getWarps().removeWarp(args[0]);
|
||||
sender.sendMessage(_("deleteWarp", args[0]));
|
||||
sender.sendMessage(_("Warp {0} has been removed.", args[0]));
|
||||
}
|
||||
}
|
||||
|
@@ -12,15 +12,15 @@ public class Commanddepth extends EssentialsCommand
|
||||
final int depth = user.getPlayer().getLocation().getBlockY() - 63;
|
||||
if (depth > 0)
|
||||
{
|
||||
user.sendMessage(_("depthAboveSea", depth));
|
||||
user.sendMessage(_("You are {0} block(s) above sea level.", depth));
|
||||
}
|
||||
else if (depth < 0)
|
||||
{
|
||||
user.sendMessage(_("depthBelowSea", (-depth)));
|
||||
user.sendMessage(_("You are {0} block(s) below sea level.", (-depth)));
|
||||
}
|
||||
else
|
||||
{
|
||||
user.sendMessage(_("depth"));
|
||||
user.sendMessage(_("You are at sea level."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -78,7 +78,7 @@ public class Commandeco extends EssentialsCommand
|
||||
case TAKE:
|
||||
if (!player.canAfford(amount, false))
|
||||
{
|
||||
throw new Exception(_("notEnoughMoney"));
|
||||
throw new Exception(_("You do not have sufficient funds."));
|
||||
}
|
||||
player.takeMoney(amount);
|
||||
break;
|
||||
@@ -106,7 +106,7 @@ public class Commandeco extends EssentialsCommand
|
||||
case TAKE:
|
||||
if (!player.canAfford(amount, false))
|
||||
{
|
||||
throw new Exception(_("notEnoughMoney"));
|
||||
throw new Exception(_("You do not have sufficient funds."));
|
||||
}
|
||||
player.takeMoney(amount, sender);
|
||||
break;
|
||||
|
@@ -23,7 +23,7 @@ public class Commandenchant extends EssentialsCommand
|
||||
final ItemStack stack = user.getPlayer().getItemInHand();
|
||||
if (stack == null)
|
||||
{
|
||||
throw new Exception(_("nothingInHand"));
|
||||
throw new Exception(_("You have nothing in your hand."));
|
||||
}
|
||||
if (args.length == 0)
|
||||
{
|
||||
@@ -37,7 +37,7 @@ public class Commandenchant extends EssentialsCommand
|
||||
//enchantmentslist.add(enchantmentName);
|
||||
}
|
||||
}
|
||||
throw new NotEnoughArgumentsException(_("enchantments", Util.joinList(enchantmentslist.toArray())));
|
||||
throw new NotEnoughArgumentsException(_(" Enchantments: {0}", Util.joinList(enchantmentslist.toArray())));
|
||||
}
|
||||
int level = -1;
|
||||
if (args.length > 1)
|
||||
@@ -78,11 +78,11 @@ public class Commandenchant extends EssentialsCommand
|
||||
final String enchantmentName = enchantment.getName().toLowerCase(Locale.ENGLISH);
|
||||
if (level == 0)
|
||||
{
|
||||
user.sendMessage(_("enchantmentRemoved", enchantmentName.replace('_', ' ')));
|
||||
user.sendMessage(_(" The enchantment {0} has been removed from your item in hand.", enchantmentName.replace('_', ' ')));
|
||||
}
|
||||
else
|
||||
{
|
||||
user.sendMessage(_("enchantmentApplied", enchantmentName.replace('_', ' ')));
|
||||
user.sendMessage(_(" The enchantment {0} has been applied to your item in hand.", enchantmentName.replace('_', ' ')));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,12 +92,12 @@ public class Commandenchant extends EssentialsCommand
|
||||
final Enchantment enchantment = Enchantments.getByName(name);
|
||||
if (enchantment == null)
|
||||
{
|
||||
throw new Exception(_("enchantmentNotFound"));
|
||||
throw new Exception(_(" Enchantment not found"));
|
||||
}
|
||||
final String enchantmentName = enchantment.getName().toLowerCase(Locale.ENGLISH);
|
||||
if (user != null && !Permissions.ENCHANT.isAuthorized(user, enchantmentName))
|
||||
{
|
||||
throw new Exception(_("enchantmentPerm", enchantmentName));
|
||||
throw new Exception(_(" You do not have the permission for {0}.", enchantmentName));
|
||||
}
|
||||
return enchantment;
|
||||
}
|
||||
|
@@ -30,7 +30,7 @@ public class Commandessentials extends EssentialsCommand
|
||||
{
|
||||
sender.sendMessage("Essentials " + ess.getPlugin().getVersion());
|
||||
sender.sendMessage("/<command> <reload/debug>");
|
||||
sender.sendMessage(_("blockList"));
|
||||
sender.sendMessage(_("Essentials relayed the following commands to another plugin:"));
|
||||
final StringBuilder disabledCommands = new StringBuilder();
|
||||
for (Map.Entry<String, String> entry : ess.getCommandHandler().disabledCommands().entrySet())
|
||||
{
|
||||
@@ -52,6 +52,6 @@ public class Commandessentials extends EssentialsCommand
|
||||
private void run_reload(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
ess.onReload();
|
||||
sender.sendMessage(_("essentialsReload", ess.getPlugin().getVersion()));
|
||||
sender.sendMessage(_("Essentials Reloaded {0}", ess.getPlugin().getVersion()));
|
||||
}
|
||||
}
|
||||
|
@@ -94,7 +94,7 @@ public class Commandexp extends EssentialsCommand
|
||||
}
|
||||
if (!foundUser)
|
||||
{
|
||||
throw new NotEnoughArgumentsException(_("playerNotFound"));
|
||||
throw new NotEnoughArgumentsException(_("Player not found."));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ public class Commandexp extends EssentialsCommand
|
||||
}
|
||||
if (!foundUser)
|
||||
{
|
||||
throw new NotEnoughArgumentsException(_("playerNotFound"));
|
||||
throw new NotEnoughArgumentsException(_("Player not found."));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ public class Commandexp extends EssentialsCommand
|
||||
final int expLeft = (int)Util.roundDouble(
|
||||
((((3.5 * target.getPlayer().getLevel()) + 6.7) - (totalExp - ((1.75 * (target.getPlayer().getLevel() * target.getPlayer().getLevel())) + (5.00 * target.getPlayer().getLevel())))) + 1));
|
||||
sender.sendMessage(
|
||||
_("exp", target.getPlayer().getDisplayName(), SetExpFix.getTotalExperience(target.getPlayer()), target.getPlayer().getLevel(), expLeft));
|
||||
_("{0} has {1} exp (level {2}) and needs {3} more exp to level up.", target.getPlayer().getDisplayName(), SetExpFix.getTotalExperience(target.getPlayer()), target.getPlayer().getLevel(), expLeft));
|
||||
}
|
||||
|
||||
private void setExp(final CommandSender sender, final IUser target, final String strAmount, final boolean give)
|
||||
@@ -133,6 +133,6 @@ public class Commandexp extends EssentialsCommand
|
||||
amount = (long)Integer.MAX_VALUE;
|
||||
}
|
||||
SetExpFix.setTotalExperience(target.getPlayer(), amount.intValue());
|
||||
sender.sendMessage(_("expSet", target.getPlayer().getDisplayName(), amount));
|
||||
sender.sendMessage(_("{0} now has {1} exp.", target.getPlayer().getDisplayName(), amount));
|
||||
}
|
||||
}
|
@@ -25,7 +25,7 @@ public class Commandext extends EssentialsCommand
|
||||
if (args.length < 1)
|
||||
{
|
||||
user.getPlayer().setFireTicks(0);
|
||||
user.sendMessage(_("extinguish"));
|
||||
user.sendMessage(_("You extinguished yourself."));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public class Commandext extends EssentialsCommand
|
||||
{
|
||||
final Player player = matchPlayer.getPlayer();
|
||||
player.setFireTicks(0);
|
||||
sender.sendMessage(_("extinguishOthers", player.getDisplayName()));
|
||||
sender.sendMessage(_("You extinguished {0}.", player.getDisplayName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -22,7 +22,7 @@ public class Commandfeed extends EssentialsCommand
|
||||
final Player player = user.getPlayer();
|
||||
player.setFoodLevel(20);
|
||||
player.setSaturation(10);
|
||||
user.sendMessage(_("feed"));
|
||||
user.sendMessage(_("Your appetite was sated."));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public class Commandfeed extends EssentialsCommand
|
||||
final Set<IUser> users = ess.getUserMap().matchUsersExcludingHidden(name, getPlayerOrNull(sender));
|
||||
if (users.isEmpty())
|
||||
{
|
||||
sender.sendMessage(_("playerNotFound"));
|
||||
sender.sendMessage(_("Player not found."));
|
||||
return;
|
||||
}
|
||||
for (IUser player : users)
|
||||
@@ -39,7 +39,7 @@ public class Commandfeed extends EssentialsCommand
|
||||
final Player realPlayer = player.getPlayer();
|
||||
realPlayer.setFoodLevel(20);
|
||||
realPlayer.setSaturation(10);
|
||||
sender.sendMessage(_("feedOther", realPlayer.getDisplayName()));
|
||||
sender.sendMessage(_("Satisfied {0}.", realPlayer.getDisplayName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -83,7 +83,7 @@ public class Commandfirework extends EssentialsCommand
|
||||
if (amount > serverLimit)
|
||||
{
|
||||
amount = serverLimit;
|
||||
user.sendMessage(_("mobSpawnLimit"));
|
||||
user.sendMessage(_("Mob quantity limited to server limit."));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@@ -31,7 +31,7 @@ public class Commandfly extends EssentialsToggleCommand
|
||||
{
|
||||
if (value)
|
||||
{
|
||||
sender.sendMessage(_("flyMode", _(getValue(player) ? "enabled" : "disabled"), player.getPlayer().getDisplayName()));
|
||||
sender.sendMessage(_("Set fly mode {0} for {1}.", _(getValue(player) ? "enabled" : "disabled"), player.getPlayer().getDisplayName()));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -42,7 +42,7 @@ public class Commandfly extends EssentialsToggleCommand
|
||||
@Override
|
||||
protected void informPlayer(final IUser player)
|
||||
{
|
||||
final String message = _("flyMode", _(getValue(player) ? "enabled" : "disabled"), player.getPlayer().getDisplayName());
|
||||
final String message = _("Set fly mode {0} for {1}.", _(getValue(player) ? "enabled" : "disabled"), player.getPlayer().getDisplayName());
|
||||
player.sendMessage(message);
|
||||
}
|
||||
|
||||
|
@@ -30,7 +30,7 @@ public class Commandgamemode extends EssentialsSettingsCommand
|
||||
{
|
||||
if (value)
|
||||
{
|
||||
sender.sendMessage(_("gameMode", getValue(player).toString().toLowerCase(Locale.ENGLISH), player.getPlayer().getDisplayName()));
|
||||
sender.sendMessage(_("Set game mode {0} for {1}.", getValue(player).toString().toLowerCase(Locale.ENGLISH), player.getPlayer().getDisplayName()));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -41,7 +41,7 @@ public class Commandgamemode extends EssentialsSettingsCommand
|
||||
@Override
|
||||
protected void informPlayer(final IUser player)
|
||||
{
|
||||
final String message = _("gameMode", getValue(player).toString().toLowerCase(Locale.ENGLISH), player.getPlayer().getDisplayName());
|
||||
final String message = _("Set game mode {0} for {1}.", getValue(player).toString().toLowerCase(Locale.ENGLISH), player.getPlayer().getDisplayName());
|
||||
player.sendMessage(message);
|
||||
}
|
||||
|
||||
|
@@ -28,11 +28,11 @@ public class Commandgc extends EssentialsCommand
|
||||
color = ChatColor.RED;
|
||||
}
|
||||
final Runtime runtime = Runtime.getRuntime();
|
||||
sender.sendMessage(_("uptime", DateUtil.formatDateDiff(ManagementFactory.getRuntimeMXBean().getStartTime())));
|
||||
sender.sendMessage(_("tps", "" + color + tps));
|
||||
sender.sendMessage(_("gcmax", (runtime.maxMemory() / 1024 / 1024)));
|
||||
sender.sendMessage(_("gctotal", (runtime.totalMemory() / 1024 / 1024)));
|
||||
sender.sendMessage(_("gcfree", (runtime.freeMemory() / 1024 / 1024)));
|
||||
sender.sendMessage(_("Uptime: {0}", DateUtil.formatDateDiff(ManagementFactory.getRuntimeMXBean().getStartTime())));
|
||||
sender.sendMessage(_("Current TPS ", "" + color + tps));
|
||||
sender.sendMessage(_("Maximum memory: {0} MB", (runtime.maxMemory() / 1024 / 1024)));
|
||||
sender.sendMessage(_("Allocated memory: {0} MB", (runtime.totalMemory() / 1024 / 1024)));
|
||||
sender.sendMessage(_("Free memory: {0} MB", (runtime.freeMemory() / 1024 / 1024)));
|
||||
sender.sendMessage(_("gcquene", (ess.getStorageQueue().getQueueSize())));
|
||||
|
||||
for (World w : server.getWorlds())
|
||||
|
@@ -30,7 +30,7 @@ public class Commandgive extends EssentialsCommand
|
||||
final String itemname = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", "");
|
||||
if (!Permissions.GIVE.isAuthorized(sender, stack))
|
||||
{
|
||||
throw new Exception(_("cantSpawnItem", itemname));
|
||||
throw new Exception(_("You are not allowed to spawn the item {0}.", itemname));
|
||||
}
|
||||
|
||||
if (args.length > 3 && Util.isInt(args[2]) && Util.isInt(args[3]))
|
||||
@@ -75,7 +75,7 @@ public class Commandgive extends EssentialsCommand
|
||||
|
||||
if (stack.getTypeId() == 0)
|
||||
{
|
||||
throw new Exception(_("cantSpawnItem", "Air"));
|
||||
throw new Exception(_("You are not allowed to spawn the item {0}.", "Air"));
|
||||
}
|
||||
|
||||
giveTo.giveItems(stack, false);
|
||||
|
@@ -26,7 +26,7 @@ public class Commandgod extends EssentialsToggleCommand
|
||||
{
|
||||
if (value)
|
||||
{
|
||||
sender.sendMessage(_("godMode", _(getValue(player) ? "enabled" : "disabled"), player.getPlayer().getDisplayName()));
|
||||
sender.sendMessage(_("God mode {0}.", _(getValue(player) ? "enabled" : "disabled"), player.getPlayer().getDisplayName()));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -37,7 +37,7 @@ public class Commandgod extends EssentialsToggleCommand
|
||||
@Override
|
||||
protected void informPlayer(final IUser player)
|
||||
{
|
||||
final String message = _("godMode", _(getValue(player) ? "enabled" : "disabled"), player.getPlayer().getDisplayName());
|
||||
final String message = _("God mode {0}.", _(getValue(player) ? "enabled" : "disabled"), player.getPlayer().getDisplayName());
|
||||
player.sendMessage(message);
|
||||
}
|
||||
|
||||
|
@@ -20,14 +20,14 @@ public class Commandhat extends EssentialsCommand
|
||||
final ItemStack head = inv.getHelmet();
|
||||
if (head == null || head.getType() == Material.AIR)
|
||||
{
|
||||
user.sendMessage(_("hatEmpty"));
|
||||
user.sendMessage(_("You are not wearing a hat."));
|
||||
}
|
||||
else
|
||||
{
|
||||
final ItemStack air = new ItemStack(Material.AIR);
|
||||
inv.setHelmet(air);
|
||||
InventoryWorkaround.addItems(user.getPlayer().getInventory(), head);
|
||||
user.sendMessage(_("hatRemoved"));
|
||||
user.sendMessage(_("Your hat has been removed."));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -44,16 +44,16 @@ public class Commandhat extends EssentialsCommand
|
||||
inv.remove(hand);
|
||||
inv.setHelmet(hand);
|
||||
inv.setItemInHand(head);
|
||||
user.sendMessage(_("hatPlaced"));
|
||||
user.sendMessage(_("Enjoy your new hat!"));
|
||||
}
|
||||
else
|
||||
{
|
||||
user.sendMessage(_("hatArmor"));
|
||||
user.sendMessage(_("Error, you cannot use this item as a hat!"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
user.sendMessage(_("hatFail"));
|
||||
user.sendMessage(_("You must have something to wear in your hand."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -30,7 +30,7 @@ public class Commandheal extends EssentialsCommand
|
||||
player.setHealth(player.getMaxHealth());
|
||||
player.setFireTicks(0);
|
||||
player.setFoodLevel(20);
|
||||
user.sendMessage(_("heal"));
|
||||
user.sendMessage(_("You have been healed."));
|
||||
for (PotionEffect effect : player.getActivePotionEffects())
|
||||
{
|
||||
player.removePotionEffect(effect.getType());
|
||||
@@ -53,7 +53,7 @@ public class Commandheal extends EssentialsCommand
|
||||
final Set<IUser> users = ess.getUserMap().matchUsersExcludingHidden(name, getPlayerOrNull(sender));
|
||||
if (users.isEmpty())
|
||||
{
|
||||
sender.sendMessage(_("playerNotFound"));
|
||||
sender.sendMessage(_("Player not found."));
|
||||
return;
|
||||
}
|
||||
for (IUser p : users)
|
||||
@@ -62,8 +62,8 @@ public class Commandheal extends EssentialsCommand
|
||||
player.setHealth(20);
|
||||
player.setFoodLevel(20);
|
||||
player.setFireTicks(0);
|
||||
player.sendMessage(_("heal"));
|
||||
sender.sendMessage(_("healOther", player.getDisplayName()));
|
||||
player.sendMessage(_("You have been healed."));
|
||||
sender.sendMessage(_("Healed {0}.", player.getDisplayName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -48,6 +48,6 @@ public class Commandhelp extends EssentialsCommand
|
||||
@Override
|
||||
protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
{
|
||||
sender.sendMessage(_("helpConsole"));
|
||||
sender.sendMessage(_("To view help from the console, type ?."));
|
||||
}
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@ public class Commandhelpop extends EssentialsCommand
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
final String message = _("helpOp", user.getPlayer().getDisplayName(), FormatUtil.stripFormat(getFinalArg(args, 0)));
|
||||
final String message = _("[HelpOp] {0}: {1}", user.getPlayer().getDisplayName(), FormatUtil.stripFormat(getFinalArg(args, 0)));
|
||||
logger.log(Level.INFO, message);
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
|
@@ -74,7 +74,7 @@ public class Commandhome extends EssentialsCommand
|
||||
}
|
||||
else if (homes.isEmpty())
|
||||
{
|
||||
throw new Exception(player == user ? _("noHomeSet") : _("noHomeSetPlayer"));
|
||||
throw new Exception(player == user ? _("You have not set a home.") : _("Player has not set a home."));
|
||||
}
|
||||
else if (homes.size() == 1 && player.equals(user))
|
||||
{
|
||||
@@ -86,7 +86,7 @@ public class Commandhome extends EssentialsCommand
|
||||
{
|
||||
homes.add("bed");
|
||||
}
|
||||
user.sendMessage(_("homes", Util.joinList(homes)));
|
||||
user.sendMessage(_("Homes: {0}", Util.joinList(homes)));
|
||||
}
|
||||
}
|
||||
throw new NoChargeException();
|
||||
@@ -102,7 +102,7 @@ public class Commandhome extends EssentialsCommand
|
||||
if (user.getPlayer().getWorld() != loc.getWorld() && ess.getSettings().getData().getGeneral().isWorldHomePermissions() && !Permissions.WORLD.isAuthorized(
|
||||
user, loc.getWorld().getName()))
|
||||
{
|
||||
throw new Exception(_("noPerm", "essentials.world." + loc.getWorld().getName()));
|
||||
throw new Exception(_("You do not have the {0} permission.", "essentials.world." + loc.getWorld().getName()));
|
||||
}
|
||||
user.getTeleport().home(loc, charge);
|
||||
}
|
||||
|
@@ -35,12 +35,12 @@ public class Commandignore extends EssentialsCommand
|
||||
if (user.isIgnoringPlayer(player))
|
||||
{
|
||||
user.setIgnoredPlayer(player, false);
|
||||
user.sendMessage(_("unignorePlayer", player.getName()));
|
||||
user.sendMessage(_("You are not ignoring player {0} anymore.", player.getName()));
|
||||
}
|
||||
else
|
||||
{
|
||||
user.setIgnoredPlayer(player, true);
|
||||
user.sendMessage(_("ignorePlayer", player.getName()));
|
||||
user.sendMessage(_("You ignore player {0} from now on.", player.getName()));
|
||||
}
|
||||
user.queueSave();
|
||||
}
|
||||
|
@@ -27,7 +27,7 @@ public class Commandinvsee extends EssentialsCommand
|
||||
invUser.getPlayer().getInventory().setContents(user.getData().getInventory().getBukkitInventory());
|
||||
user.getData().setInventory(null);
|
||||
user.queueSave();
|
||||
user.sendMessage(_("invRestored"));
|
||||
user.sendMessage(_("Your inventory has been restored."));
|
||||
throw new NoChargeException();
|
||||
}
|
||||
if (user.getData().getInventory() == null)
|
||||
@@ -43,11 +43,11 @@ public class Commandinvsee extends EssentialsCommand
|
||||
}
|
||||
if (invUserStack.length > userStackLength)
|
||||
{
|
||||
throw new Exception(_("invBigger"));
|
||||
throw new Exception(_("The other users inventory is bigger than yours."));
|
||||
}
|
||||
user.getPlayer().getInventory().setContents(invUserStack);
|
||||
user.sendMessage(_("invSee", invUser.getPlayer().getDisplayName()));
|
||||
user.sendMessage(_("invSeeHelp"));
|
||||
user.sendMessage(_("You see the inventory of {0}.", invUser.getPlayer().getDisplayName()));
|
||||
user.sendMessage(_("Use /invsee to restore your inventory."));
|
||||
throw new NoChargeException();
|
||||
}
|
||||
}
|
||||
|
@@ -32,7 +32,7 @@ public class Commanditem extends EssentialsCommand
|
||||
final String itemname = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", "");
|
||||
if (!Permissions.ITEMSPAWN.isAuthorized(user, stack))
|
||||
{
|
||||
throw new Exception(_("cantSpawnItem", itemname));
|
||||
throw new Exception(_("You are not allowed to spawn the item {0}.", itemname));
|
||||
}
|
||||
|
||||
if (args.length > 1 && Integer.parseInt(args[1]) > 0)
|
||||
@@ -72,12 +72,12 @@ public class Commanditem extends EssentialsCommand
|
||||
|
||||
if (stack.getTypeId() == 0)
|
||||
{
|
||||
throw new Exception(_("cantSpawnItem", "Air"));
|
||||
throw new Exception(_("You are not allowed to spawn the item {0}.", "Air"));
|
||||
}
|
||||
|
||||
user.giveItems(stack, false);
|
||||
|
||||
final String displayName = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace('_', ' ');
|
||||
user.sendMessage(_("itemSpawn", stack.getAmount(), displayName));
|
||||
user.sendMessage(_("Giving {0} of {1}", stack.getAmount(), displayName));
|
||||
}
|
||||
}
|
||||
|
@@ -37,7 +37,7 @@ public class Commanditemdb extends EssentialsCommand
|
||||
final int durability = ((maxuses + 1) - itemStack.getDurability());
|
||||
if (maxuses != 0)
|
||||
{
|
||||
sender.sendMessage(_("durability", Integer.toString(durability)));
|
||||
sender.sendMessage(_("This tool has {0} uses left.", Integer.toString(durability)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -25,7 +25,7 @@ public class Commandjump extends EssentialsCommand
|
||||
}
|
||||
catch (NullPointerException ex)
|
||||
{
|
||||
throw new Exception(_("jumpError"), ex);
|
||||
throw new Exception(_("That would hurt your computer's brain."), ex);
|
||||
}
|
||||
|
||||
final Trade charge = new Trade(commandName, ess);
|
||||
|
@@ -22,9 +22,9 @@ public class Commandkick extends EssentialsCommand
|
||||
final IUser user = ess.getUserMap().matchUserExcludingHidden(args[0], getPlayerOrNull(sender));
|
||||
if (Permissions.KICK_EXEMPT.isAuthorized(user))
|
||||
{
|
||||
throw new Exception(_("kickExempt"));
|
||||
throw new Exception(_("You can not kick that person."));
|
||||
}
|
||||
String kickReason = args.length > 1 ? getFinalArg(args, 1) : _("kickDefault");
|
||||
String kickReason = args.length > 1 ? getFinalArg(args, 1) : _("Kicked from server");
|
||||
kickReason = FormatUtil.replaceFormat(kickReason.replace("\\n", "\n").replace("|", "\n"));
|
||||
user.getPlayer().kickPlayer(kickReason);
|
||||
final String senderName = sender instanceof IUser ? ((IUser)sender).getPlayer().getDisplayName() : Console.NAME;
|
||||
@@ -33,7 +33,7 @@ public class Commandkick extends EssentialsCommand
|
||||
{
|
||||
if (Permissions.KICK_NOTIFY.isAuthorized(onlinePlayer))
|
||||
{
|
||||
onlinePlayer.sendMessage(_("playerKicked", senderName, user.getName(), kickReason));
|
||||
onlinePlayer.sendMessage(_("Player {0} kicked {1} for {2}.", senderName, user.getName(), kickReason));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@ public class Commandkickall extends EssentialsCommand
|
||||
@Override
|
||||
protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
{
|
||||
String kickReason = args.length > 1 ? getFinalArg(args, 1) : _("kickDefault");
|
||||
String kickReason = args.length > 1 ? getFinalArg(args, 1) : _("Kicked from server");
|
||||
kickReason = FormatUtil.replaceFormat(kickReason.replace("\\n", "\n").replace("|", "\n"));
|
||||
for (Player onlinePlayer : server.getOnlinePlayers())
|
||||
{
|
||||
|
@@ -31,7 +31,7 @@ public class Commandkill extends EssentialsCommand
|
||||
}
|
||||
|
||||
player.damage(Short.MAX_VALUE);
|
||||
sender.sendMessage(_("kill", player.getDisplayName()));
|
||||
sender.sendMessage(_("Killed {0}.", player.getDisplayName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -45,7 +45,7 @@ public class Commandkillall extends EssentialsCommand
|
||||
}
|
||||
catch (NumberFormatException e)
|
||||
{
|
||||
throw new Exception(_("numberRequired"), e);
|
||||
throw new Exception(_("A number goes there, silly."), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -78,7 +78,7 @@ public class Commandkillall extends EssentialsCommand
|
||||
{
|
||||
if (LivingEntities.fromName(killType) == null)
|
||||
{
|
||||
throw new Exception(_("invalidMob"));
|
||||
throw new Exception(_("Invalid mob type."));
|
||||
}
|
||||
entityClass = LivingEntities.fromName(killType).getEntityClass();
|
||||
}
|
||||
@@ -149,6 +149,6 @@ public class Commandkillall extends EssentialsCommand
|
||||
}
|
||||
}
|
||||
}
|
||||
sender.sendMessage(_("kill", numKills));
|
||||
sender.sendMessage(_("Killed {0}.", numKills));
|
||||
}
|
||||
}
|
||||
|
@@ -20,7 +20,7 @@ public class Commandkit extends EssentialsCommand
|
||||
Collection<String> kitList = ess.getKits().getList();
|
||||
if (kitList.isEmpty())
|
||||
{
|
||||
user.sendMessage(_("noKits"));
|
||||
user.sendMessage(_("There are no kits available yet."));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -31,7 +31,7 @@ public class Commandkit extends EssentialsCommand
|
||||
kitList.remove(kitName);
|
||||
}
|
||||
}
|
||||
user.sendMessage(_("kits", Util.joinList(kitList)));
|
||||
user.sendMessage(_("Kits: {0}", Util.joinList(kitList)));
|
||||
}
|
||||
throw new NoChargeException();
|
||||
}
|
||||
@@ -42,7 +42,7 @@ public class Commandkit extends EssentialsCommand
|
||||
|
||||
if (!Permissions.KITS.isAuthorized(user, kitName))
|
||||
{
|
||||
throw new Exception(_("noKitPermission", "essentials.kit." + kitName));
|
||||
throw new Exception(_("You need the {0} permission to use that kit.", "essentials.kit." + kitName));
|
||||
}
|
||||
|
||||
//TODO: Check kit delay
|
||||
@@ -55,7 +55,7 @@ public class Commandkit extends EssentialsCommand
|
||||
//TODO: Merge kit changes from 2.9
|
||||
|
||||
charge.charge(user);
|
||||
user.sendMessage(_("kitGive", kitName));
|
||||
user.sendMessage(_("Giving kit {0}.", kitName));
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -29,7 +29,7 @@ public class Commandlightning extends EssentialsCommand
|
||||
|
||||
if (ess.getUserMap().matchUsersExcludingHidden(args[0], getPlayerOrNull(sender)).isEmpty())
|
||||
{
|
||||
throw new Exception(_("playerNotFound"));
|
||||
throw new Exception(_("Player not found."));
|
||||
}
|
||||
|
||||
int power = 5;
|
||||
@@ -47,7 +47,7 @@ public class Commandlightning extends EssentialsCommand
|
||||
for (IUser matchPlayer : ess.getUserMap().matchUsersExcludingHidden(args[0], getPlayerOrNull(sender)))
|
||||
{
|
||||
final Player player = matchPlayer.getPlayer();
|
||||
sender.sendMessage(_("lightningUse", player.getDisplayName()));
|
||||
sender.sendMessage(_("Smiting {0}", player.getDisplayName()));
|
||||
final LightningStrike strike = player.getWorld().strikeLightningEffect(player.getLocation());
|
||||
if (!matchPlayer.isGodModeEnabled())
|
||||
{
|
||||
@@ -56,7 +56,7 @@ public class Commandlightning extends EssentialsCommand
|
||||
final ISettings settings = ess.getSettings();
|
||||
if (settings.getData().getCommands().getLightning().isWarnPlayer())
|
||||
{
|
||||
matchPlayer.sendMessage(_("lightningSmited"));
|
||||
matchPlayer.sendMessage(_("Thou hast been smitten!"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -35,16 +35,16 @@ public class Commandlist extends EssentialsCommand
|
||||
|
||||
if (showhidden && playerHidden > 0)
|
||||
{
|
||||
online = _("listAmountHidden", server.getOnlinePlayers().length - playerHidden, playerHidden, server.getMaxPlayers());
|
||||
online = _(" There are {0}/{1} out of maximum {2} players online.", server.getOnlinePlayers().length - playerHidden, playerHidden, server.getMaxPlayers());
|
||||
}
|
||||
else
|
||||
{
|
||||
online = _("listAmount", server.getOnlinePlayers().length - playerHidden, server.getMaxPlayers());
|
||||
online = _(" There are {0} out of maximum {1} players online.", server.getOnlinePlayers().length - playerHidden, server.getMaxPlayers());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
online = _("listAmount", server.getOnlinePlayers().length, server.getMaxPlayers());
|
||||
online = _(" There are {0} out of maximum {1} players online.", server.getOnlinePlayers().length, server.getMaxPlayers());
|
||||
}
|
||||
|
||||
sender.sendMessage(online);
|
||||
@@ -81,7 +81,7 @@ public class Commandlist extends EssentialsCommand
|
||||
for (String group : groups)
|
||||
{
|
||||
final StringBuilder groupString = new StringBuilder();
|
||||
groupString.append(_("listGroupTag", FormatUtil.replaceFormat(group)));
|
||||
groupString.append(_("{0}: ", FormatUtil.replaceFormat(group)));
|
||||
final List<IUser> users = sort.get(group);
|
||||
Collections.sort(users);
|
||||
boolean first = true;
|
||||
@@ -98,12 +98,12 @@ public class Commandlist extends EssentialsCommand
|
||||
|
||||
if (user.getData().isAfk())
|
||||
{
|
||||
groupString.append(_("listAfkTag"));
|
||||
groupString.append(_(" [AFK]"));
|
||||
}
|
||||
|
||||
if (hiddenPlayers.contains(user.getName()))
|
||||
{
|
||||
groupString.append(_("listHiddenTag"));
|
||||
groupString.append(_(" [HIDDEN]"));
|
||||
}
|
||||
groupString.append(user.getPlayer().getDisplayName());
|
||||
groupString.append("§f");
|
||||
@@ -130,7 +130,7 @@ public class Commandlist extends EssentialsCommand
|
||||
Collections.sort(users);
|
||||
|
||||
final StringBuilder onlineUsers = new StringBuilder();
|
||||
onlineUsers.append(_("connectedPlayers"));
|
||||
onlineUsers.append(_("Connected players: "));
|
||||
boolean first = true;
|
||||
for (IUser user : users)
|
||||
{
|
||||
@@ -145,12 +145,12 @@ public class Commandlist extends EssentialsCommand
|
||||
|
||||
if (user.getData().isAfk())
|
||||
{
|
||||
onlineUsers.append(_("listAfkTag"));
|
||||
onlineUsers.append(_(" [AFK]"));
|
||||
}
|
||||
|
||||
if (hiddenPlayers.contains(user.getName()))
|
||||
{
|
||||
onlineUsers.append(_("listHiddenTag"));
|
||||
onlineUsers.append(_(" [HIDDEN]"));
|
||||
}
|
||||
onlineUsers.append(user.getPlayer().getDisplayName());
|
||||
onlineUsers.append("§f");
|
||||
|
@@ -20,51 +20,51 @@ public class Commandmail extends EssentialsCommand
|
||||
final List<String> mail = user.getData().getMails();
|
||||
if (mail == null || mail.isEmpty())
|
||||
{
|
||||
user.sendMessage(_("noMail"));
|
||||
user.sendMessage(_("You do not have any mail."));
|
||||
throw new NoChargeException();
|
||||
}
|
||||
for (String messages : mail)
|
||||
{
|
||||
user.sendMessage(messages);
|
||||
}
|
||||
user.sendMessage(_("mailClear"));
|
||||
user.sendMessage(_("To mark your mail as read, type /mail clear."));
|
||||
return;
|
||||
}
|
||||
if (args.length >= 3 && "send".equalsIgnoreCase(args[0]))
|
||||
{
|
||||
if (!Permissions.MAIL_SEND.isAuthorized(user))
|
||||
{
|
||||
throw new Exception(_("noPerm", "essentials.mail.send"));
|
||||
throw new Exception(_("You do not have the {0} permission.", "essentials.mail.send"));
|
||||
}
|
||||
|
||||
IUser u = ess.getUserMap().matchUser(args[1], true);
|
||||
if (u == null)
|
||||
{
|
||||
throw new Exception(_("playerNeverOnServer", args[1]));
|
||||
throw new Exception(_("Player {0} was never on this server.", args[1]));
|
||||
}
|
||||
if (!u.isIgnoringPlayer(user))
|
||||
{
|
||||
final String mail = Util.sanitizeString(FormatUtil.stripFormat(getFinalArg(args, 2)));
|
||||
u.addMail(user.getName() + ": " + mail);
|
||||
}
|
||||
user.sendMessage(_("mailSent"));
|
||||
user.sendMessage(_("Mail sent!"));
|
||||
return;
|
||||
}
|
||||
if (args.length > 1 && "sendall".equalsIgnoreCase(args[0]))
|
||||
{
|
||||
if (!Permissions.MAIL_SENDALL.isAuthorized(user))
|
||||
{
|
||||
throw new Exception(_("noPerm", "essentials.mail.sendall"));
|
||||
throw new Exception(_("You do not have the {0} permission.", "essentials.mail.sendall"));
|
||||
}
|
||||
ess.getPlugin().runTaskAsynchronously(new SendAll(user.getName() + ": " + FormatUtil.stripColor(getFinalArg(args, 1))));
|
||||
user.sendMessage(_("mailSent"));
|
||||
user.sendMessage(_("Mail sent!"));
|
||||
return;
|
||||
}
|
||||
if (args.length >= 1 && "clear".equalsIgnoreCase(args[0]))
|
||||
{
|
||||
user.getData().clearMails();
|
||||
user.queueSave();
|
||||
user.sendMessage(_("mailCleared"));
|
||||
user.sendMessage(_("Mail Cleared!"));
|
||||
return;
|
||||
}
|
||||
throw new NotEnoughArgumentsException();
|
||||
@@ -75,17 +75,17 @@ public class Commandmail extends EssentialsCommand
|
||||
{
|
||||
if (args.length >= 1 && "read".equalsIgnoreCase(args[0]))
|
||||
{
|
||||
throw new Exception(_("onlyPlayers", commandName + " read"));
|
||||
throw new Exception(_("Only in-game players can use {0}.", commandName + " read"));
|
||||
}
|
||||
else if (args.length >= 1 && "clear".equalsIgnoreCase(args[0]))
|
||||
{
|
||||
throw new Exception(_("onlyPlayers", commandName + " clear"));
|
||||
throw new Exception(_("Only in-game players can use {0}.", commandName + " clear"));
|
||||
}
|
||||
else if (args.length >= 3 && "send".equalsIgnoreCase(args[0]))
|
||||
{
|
||||
IUser u = ess.getUserMap().matchUser(args[1], true);
|
||||
u.addMail("Server: " + getFinalArg(args, 2));
|
||||
sender.sendMessage(_("mailSent"));
|
||||
sender.sendMessage(_("Mail sent!"));
|
||||
return;
|
||||
}
|
||||
else if (args.length >= 1 && "sendall".equalsIgnoreCase(args[0]))
|
||||
@@ -97,7 +97,7 @@ public class Commandmail extends EssentialsCommand
|
||||
//allow sending from console without "send" argument, since it's the only thing the console can do
|
||||
IUser u = ess.getUserMap().matchUser(args[0], true);
|
||||
u.addMail("Server: " + getFinalArg(args, 1));
|
||||
sender.sendMessage(_("mailSent"));
|
||||
sender.sendMessage(_("Mail sent!"));
|
||||
return;
|
||||
}
|
||||
throw new NotEnoughArgumentsException();
|
||||
|
@@ -13,7 +13,7 @@ public class Commandme extends EssentialsCommand
|
||||
{
|
||||
if (user.getData().isMuted())
|
||||
{
|
||||
throw new Exception(_("voiceSilenced"));
|
||||
throw new Exception(_("Your voice has been silenced."));
|
||||
}
|
||||
|
||||
if (args.length < 1)
|
||||
@@ -31,6 +31,6 @@ public class Commandme extends EssentialsCommand
|
||||
message = FormatUtil.stripColor(message);
|
||||
}
|
||||
|
||||
ess.broadcastMessage(user, _("action", user.getPlayer().getDisplayName(), message));
|
||||
ess.broadcastMessage(user, _("{0}", user.getPlayer().getDisplayName(), message));
|
||||
}
|
||||
}
|
||||
|
@@ -34,7 +34,7 @@ public class Commandmore extends EssentialsCommand
|
||||
{
|
||||
if (stacks.length == 1)
|
||||
{
|
||||
throw new Exception(_("cantSpawnItem", "Air"));
|
||||
throw new Exception(_("You are not allowed to spawn the item {0}.", "Air"));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -64,7 +64,7 @@ public class Commandmore extends EssentialsCommand
|
||||
{
|
||||
if (stacks.length == 1)
|
||||
{
|
||||
throw new Exception(_("cantSpawnItem", itemname));
|
||||
throw new Exception(_("You are not allowed to spawn the item {0}.", itemname));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -27,7 +27,7 @@ public class Commandmsg extends EssentialsCommand
|
||||
final IUser user = getUser(sender);
|
||||
if (user.getData().isMuted())
|
||||
{
|
||||
throw new Exception(_("voiceSilenced"));
|
||||
throw new Exception(_("Your voice has been silenced."));
|
||||
}
|
||||
if (Permissions.MSG_COLOR.isAuthorized(user))
|
||||
{
|
||||
@@ -50,9 +50,9 @@ public class Commandmsg extends EssentialsCommand
|
||||
|
||||
if (args[0].equalsIgnoreCase(Console.NAME))
|
||||
{
|
||||
sender.sendMessage(_("msgFormat", translatedMe, Console.NAME, message));
|
||||
sender.sendMessage(_("[{0} -> {1}] {2}", translatedMe, Console.NAME, message));
|
||||
CommandSender cs = server.getConsoleSender();
|
||||
cs.sendMessage(_("msgFormat", senderName, translatedMe, message));
|
||||
cs.sendMessage(_("[{0} -> {1}] {2}", senderName, translatedMe, message));
|
||||
replyTo.setReplyTo(cs);
|
||||
Console.getConsoleReplyTo().setReplyTo(sender);
|
||||
return;
|
||||
@@ -63,7 +63,7 @@ public class Commandmsg extends EssentialsCommand
|
||||
|
||||
if (matchedPlayers.isEmpty())
|
||||
{
|
||||
throw new Exception(_("playerNotFound"));
|
||||
throw new Exception(_("Player not found."));
|
||||
}
|
||||
|
||||
final Player player = getPlayerOrNull(sender);
|
||||
@@ -80,19 +80,19 @@ public class Commandmsg extends EssentialsCommand
|
||||
}
|
||||
if (i == matchedPlayers.size())
|
||||
{
|
||||
throw new Exception(_("playerNotFound"));
|
||||
throw new Exception(_("Player not found."));
|
||||
}
|
||||
}
|
||||
|
||||
for (IUser matchedPlayer : matchedPlayers)
|
||||
{
|
||||
final Player realPlayer = matchedPlayer.getPlayer();
|
||||
sender.sendMessage(_("msgFormat", translatedMe, realPlayer.getDisplayName(), message));
|
||||
sender.sendMessage(_("[{0} -> {1}] {2}", translatedMe, realPlayer.getDisplayName(), message));
|
||||
if (isUser(sender) && (matchedPlayer.isIgnoringPlayer(getUser(sender)) || !player.canSee(realPlayer)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
matchedPlayer.sendMessage(_("msgFormat", senderName, translatedMe, message));
|
||||
matchedPlayer.sendMessage(_("[{0} -> {1}] {2}", senderName, translatedMe, message));
|
||||
replyTo.setReplyTo(matchedPlayer);
|
||||
matchedPlayer.setReplyTo(sender);
|
||||
}
|
||||
|
@@ -21,7 +21,7 @@ public class Commandmute extends EssentialsCommand
|
||||
final IUser player = ess.getUserMap().matchUser(args[0], true);
|
||||
if (!player.getData().isMuted() && Permissions.MUTE_EXEMPT.isAuthorized(player))
|
||||
{
|
||||
throw new Exception(_("muteExempt"));
|
||||
throw new Exception(_("You may not mute that player."));
|
||||
}
|
||||
long muteTimestamp = 0;
|
||||
|
||||
@@ -38,10 +38,10 @@ public class Commandmute extends EssentialsCommand
|
||||
player.setTimestamp(TimestampType.MUTE, muteTimestamp);
|
||||
final boolean muted = player.getData().isMuted();
|
||||
sender.sendMessage(
|
||||
muted ? (muteTimestamp > 0 ? _("mutedPlayerFor", player.getPlayer().getDisplayName(), DateUtil.formatDateDiff(muteTimestamp)) : _(
|
||||
muted ? (muteTimestamp > 0 ? _("Player {0} muted for {1}.", player.getPlayer().getDisplayName(), DateUtil.formatDateDiff(muteTimestamp)) : _(
|
||||
"mutedPlayer", player.getPlayer().getDisplayName())) : _(
|
||||
"unmutedPlayer", player.getPlayer().getDisplayName()));
|
||||
player.sendMessage(
|
||||
muted ? (muteTimestamp > 0 ? _("playerMutedFor", DateUtil.formatDateDiff(muteTimestamp)) : _("playerMuted")) : _("playerUnmuted"));
|
||||
muted ? (muteTimestamp > 0 ? _("You have been muted for {0}.", DateUtil.formatDateDiff(muteTimestamp)) : _("You have been muted.")) : _("You have been unmuted"));
|
||||
}
|
||||
}
|
||||
|
@@ -47,11 +47,11 @@ public class Commandnear extends EssentialsCommand
|
||||
}
|
||||
if (otherUser == null || Permissions.NEAR_OTHERS.isAuthorized(user))
|
||||
{
|
||||
user.sendMessage(_("nearbyPlayers", getLocal(otherUser == null ? user : otherUser, radius)));
|
||||
user.sendMessage(_("Players nearby: {0}", getLocal(otherUser == null ? user : otherUser, radius)));
|
||||
}
|
||||
else
|
||||
{
|
||||
user.sendMessage(_("noAccessCommand"));
|
||||
user.sendMessage(_("You do not have access to that command."));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ public class Commandnear extends EssentialsCommand
|
||||
{
|
||||
}
|
||||
}
|
||||
sender.sendMessage(_("nearbyPlayers", getLocal(otherUser, radius)));
|
||||
sender.sendMessage(_("Players nearby: {0}", getLocal(otherUser, radius)));
|
||||
}
|
||||
|
||||
private String getLocal(final IUser user, final long radius)
|
||||
|
@@ -23,16 +23,16 @@ public class Commandnick extends EssentialsCommand
|
||||
final ISettings settings = ess.getSettings();
|
||||
if (!settings.getData().getChat().getChangeDisplayname())
|
||||
{
|
||||
throw new Exception(_("nickDisplayName"));
|
||||
throw new Exception(_("You have to enable change-displayname in Essentials config."));
|
||||
}
|
||||
if (args.length > 1)
|
||||
{
|
||||
if (!Permissions.NICK_OTHERS.isAuthorized(user))
|
||||
{
|
||||
throw new Exception(_("nickOthersPermission"));
|
||||
throw new Exception(_("You do not have permission to change the nickname of others."));
|
||||
}
|
||||
setNickname(ess.getUserMap().matchUserExcludingHidden(args[0], user.getPlayer()), formatNickname(user, args[1]));
|
||||
user.sendMessage(_("nickChanged"));
|
||||
user.sendMessage(_("Nickname changed."));
|
||||
return;
|
||||
}
|
||||
setNickname(user, formatNickname(user, args[0]));
|
||||
@@ -48,7 +48,7 @@ public class Commandnick extends EssentialsCommand
|
||||
final ISettings settings = ess.getSettings();
|
||||
if (!settings.getData().getChat().getChangeDisplayname())
|
||||
{
|
||||
throw new Exception(_("nickDisplayName"));
|
||||
throw new Exception(_("You have to enable change-displayname in Essentials config."));
|
||||
}
|
||||
if ((args[0].equalsIgnoreCase("*") || args[0].equalsIgnoreCase("all")) && args[1].equalsIgnoreCase("off"))
|
||||
{
|
||||
@@ -58,7 +58,7 @@ public class Commandnick extends EssentialsCommand
|
||||
{
|
||||
setNickname(ess.getUserMap().matchUser(args[0], false), formatNickname(null, args[1]));
|
||||
}
|
||||
sender.sendMessage(_("nickChanged"));
|
||||
sender.sendMessage(_("Nickname changed."));
|
||||
}
|
||||
|
||||
private String formatNickname(final IUser user, final String nick)
|
||||
@@ -91,18 +91,18 @@ public class Commandnick extends EssentialsCommand
|
||||
{
|
||||
if (!nick.matches("^[a-zA-Z_0-9\u00a7]+$"))
|
||||
{
|
||||
throw new Exception(_("nickNamesAlpha"));
|
||||
throw new Exception(_("Nicknames must be alphanumeric."));
|
||||
}
|
||||
final String stripNick = FormatUtil.stripFormat(nick);
|
||||
if (ess.getSettings().getData().getChat().getMaxNickLength() > 0 && stripNick.length() > ess.getSettings().getData().getChat().getMaxNickLength())
|
||||
{
|
||||
throw new Exception(_("nickTooLong"));
|
||||
throw new Exception(_("You cannot set a nick that long."));
|
||||
}
|
||||
else if ("off".equalsIgnoreCase(nick) || target.getName().equalsIgnoreCase(nick))
|
||||
{
|
||||
target.getData().setNickname(null);
|
||||
target.updateDisplayName();
|
||||
target.sendMessage(_("nickNoMore"));
|
||||
target.sendMessage(_("You no longer have a nickname."));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -117,13 +117,13 @@ public class Commandnick extends EssentialsCommand
|
||||
final String nk = nick.toLowerCase(Locale.ENGLISH);
|
||||
if (nk.equals(dn) || nk.equals(n))
|
||||
{
|
||||
throw new Exception(_("nickInUse"));
|
||||
throw new Exception(_("That name is already in use."));
|
||||
}
|
||||
}
|
||||
|
||||
target.getData().setNickname(nick);
|
||||
target.updateDisplayName();
|
||||
target.sendMessage(_("nickSet", target.getPlayer().getDisplayName() + "§7."));
|
||||
target.sendMessage(_("Your nickname is now {0}.", target.getPlayer().getDisplayName() + "§7."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -34,7 +34,7 @@ public class Commandpay extends EssentialsCommand
|
||||
|
||||
if (!foundUser)
|
||||
{
|
||||
throw new NoSuchFieldException(_("playerNotFound"));
|
||||
throw new NoSuchFieldException(_("Player not found."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@ public class Commandping extends EssentialsCommand
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
user.sendMessage(_("pong"));
|
||||
user.sendMessage(_("Pong!"));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -24,14 +24,14 @@ public class Commandpowertool extends EssentialsCommand
|
||||
{
|
||||
userData.clearAllPowertools();
|
||||
user.queueSave();
|
||||
user.sendMessage(_("powerToolClearAll"));
|
||||
user.sendMessage(_("All powertool commands have been cleared."));
|
||||
return;
|
||||
}
|
||||
|
||||
final ItemStack itemStack = user.getPlayer().getItemInHand();
|
||||
if (itemStack == null || itemStack.getType() == Material.AIR)
|
||||
{
|
||||
throw new Exception(_("powerToolAir"));
|
||||
throw new Exception(_("Command can't be attached to air."));
|
||||
}
|
||||
|
||||
final String itemName = itemStack.getType().toString().toLowerCase(Locale.ENGLISH).replaceAll("_", " ");
|
||||
@@ -42,11 +42,11 @@ public class Commandpowertool extends EssentialsCommand
|
||||
{
|
||||
if (powertools == null || powertools.isEmpty())
|
||||
{
|
||||
throw new Exception(_("powerToolListEmpty", itemName));
|
||||
throw new Exception(_("Item {0} has no commands assigned.", itemName));
|
||||
}
|
||||
else
|
||||
{
|
||||
user.sendMessage(_("powerToolList", Util.joinList(powertools), itemName));
|
||||
user.sendMessage(_("Item {1} has the following commands: {0}.", Util.joinList(powertools), itemName));
|
||||
}
|
||||
throw new NoChargeException();
|
||||
}
|
||||
@@ -55,12 +55,12 @@ public class Commandpowertool extends EssentialsCommand
|
||||
command = command.substring(2);
|
||||
if (!powertools.contains(command))
|
||||
{
|
||||
throw new Exception(_("powerToolNoSuchCommandAssigned", command, itemName));
|
||||
throw new Exception(_("Command {0} has not been assigned to {1}.", command, itemName));
|
||||
}
|
||||
|
||||
powertools = new ArrayList<String>(powertools);
|
||||
powertools.remove(command);
|
||||
user.sendMessage(_("powerToolRemove", command, itemName));
|
||||
user.sendMessage(_("Command {0} removed from {1}.", command, itemName));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -68,12 +68,12 @@ public class Commandpowertool extends EssentialsCommand
|
||||
{
|
||||
if (!Permissions.POWERTOOL_APPEND.isAuthorized(user))
|
||||
{
|
||||
throw new Exception(_("noPerm", "essentials.powertool.append"));
|
||||
throw new Exception(_("You do not have the {0} permission.", "essentials.powertool.append"));
|
||||
}
|
||||
command = command.substring(2);
|
||||
if (powertools.contains(command))
|
||||
{
|
||||
throw new Exception(_("powerToolAlreadySet", command, itemName));
|
||||
throw new Exception(_("Command {0} is already assigned to {1}.", command, itemName));
|
||||
}
|
||||
powertools = new ArrayList<String>(powertools);
|
||||
}
|
||||
@@ -83,19 +83,19 @@ public class Commandpowertool extends EssentialsCommand
|
||||
}
|
||||
|
||||
powertools.add(command);
|
||||
user.sendMessage(_("powerToolAttach", Util.joinList(powertools), itemName));
|
||||
user.sendMessage(_("{0} command assigned to {1}.", Util.joinList(powertools), itemName));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
powertools = new ArrayList<String>();
|
||||
user.sendMessage(_("powerToolRemoveAll", itemName));
|
||||
user.sendMessage(_("All commands removed from {0}.", itemName));
|
||||
}
|
||||
|
||||
if (!userData.isPowerToolsEnabled())
|
||||
{
|
||||
userData.setPowerToolsEnabled(true);
|
||||
user.sendMessage(_("powerToolsEnabled"));
|
||||
user.sendMessage(_("All of your power tools have been enabled."));
|
||||
}
|
||||
userData.setPowertool(itemStack.getType(), powertools);
|
||||
user.queueSave();
|
||||
|
@@ -13,12 +13,12 @@ public class Commandpowertooltoggle extends EssentialsCommand
|
||||
final UserData userData = user.getData();
|
||||
if (!userData.hasPowerTools())
|
||||
{
|
||||
user.sendMessage(_("noPowerTools"));
|
||||
user.sendMessage(_("You have no power tools assigned."));
|
||||
return;
|
||||
}
|
||||
userData.setPowerToolsEnabled(!userData.isPowerToolsEnabled());
|
||||
user.queueSave();
|
||||
user.sendMessage(
|
||||
userData.isPowerToolsEnabled() ? _("powerToolsEnabled") : _("powerToolsDisabled"));
|
||||
userData.isPowerToolsEnabled() ? _("All of your power tools have been enabled.") : _("All of your power tools have been disabled."));
|
||||
}
|
||||
}
|
||||
|
@@ -43,7 +43,7 @@ public class Commandptime extends EssentialsCommand
|
||||
IUser user = isUser(sender) ? getUser(sender) : null;
|
||||
if (user != null && (!users.contains(user) || users.size() > 1) && !Permissions.PTIME_OTHERS.isAuthorized(user))
|
||||
{
|
||||
user.sendMessage(_("pTimeOthersPermission"));
|
||||
user.sendMessage(_("You are not authorized to set other players' time."));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -88,25 +88,25 @@ public class Commandptime extends EssentialsCommand
|
||||
{
|
||||
if (users.size() > 1)
|
||||
{
|
||||
sender.sendMessage(_("pTimePlayers"));
|
||||
sender.sendMessage(_("These players have their own time:"));
|
||||
}
|
||||
|
||||
for (IUser user : users)
|
||||
{
|
||||
if (user.getPlayer().getPlayerTimeOffset() == 0)
|
||||
{
|
||||
sender.sendMessage(_("pTimeNormal", user.getName()));
|
||||
sender.sendMessage(_("{0}'s time is normal and matches the server.", user.getName()));
|
||||
}
|
||||
else
|
||||
{
|
||||
String time = DescParseTickFormat.format(user.getPlayer().getPlayerTime());
|
||||
if (!user.getPlayer().isPlayerTimeRelative())
|
||||
{
|
||||
sender.sendMessage(_("pTimeCurrentFixed", user.getName(), time));
|
||||
sender.sendMessage(_("{0}'s time is fixed to {1}.", user.getName(), time));
|
||||
}
|
||||
else
|
||||
{
|
||||
sender.sendMessage(_("pTimeCurrent", user.getName(), time));
|
||||
sender.sendMessage(_("{0}'s time is {1}.", user.getName(), time));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -158,18 +158,18 @@ public class Commandptime extends EssentialsCommand
|
||||
// Inform the sender of the change
|
||||
if (ticks == null)
|
||||
{
|
||||
sender.sendMessage(_("pTimeReset", msg.toString()));
|
||||
sender.sendMessage(_("Player time has been reset for: {0}.", msg.toString()));
|
||||
}
|
||||
else
|
||||
{
|
||||
String time = DescParseTickFormat.format(ticks);
|
||||
if (!relative)
|
||||
{
|
||||
sender.sendMessage(_("pTimeSetFixed", time, msg.toString()));
|
||||
sender.sendMessage(_("Player time is fixed to {0} for: {1}.", time, msg.toString()));
|
||||
}
|
||||
else
|
||||
{
|
||||
sender.sendMessage(_("pTimeSet", time, msg.toString()));
|
||||
sender.sendMessage(_("Player time is set to {0} for: {1}.", time, msg.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -221,7 +221,7 @@ public class Commandptime extends EssentialsCommand
|
||||
// We failed to understand the world target...
|
||||
else
|
||||
{
|
||||
throw new Exception(_("playerNotFound"));
|
||||
throw new Exception(_("Player not found."));
|
||||
}
|
||||
|
||||
return users;
|
||||
|
@@ -47,11 +47,11 @@ public class Commandr extends EssentialsCommand
|
||||
final CommandSender target = replyTo.getReplyTo();
|
||||
if (target == null || (isUser(target) && !getUser(target).isOnline()))
|
||||
{
|
||||
throw new Exception(_("foreverAlone"));
|
||||
throw new Exception(_("You have nobody to whom you can reply."));
|
||||
}
|
||||
final String targetName = isUser(target) ? getPlayer(target).getDisplayName() : Console.NAME;
|
||||
|
||||
sender.sendMessage(_("msgFormat", _("me"), targetName, message));
|
||||
sender.sendMessage(_("[{0} -> {1}] {2}", _("me"), targetName, message));
|
||||
if (isUser(target))
|
||||
{
|
||||
if (isUser(sender) && getUser(target).isIgnoringPlayer(getUser(sender)))
|
||||
@@ -59,7 +59,7 @@ public class Commandr extends EssentialsCommand
|
||||
return;
|
||||
}
|
||||
}
|
||||
target.sendMessage(_("msgFormat", senderName, _("me"), message));
|
||||
target.sendMessage(_("[{0} -> {1}] {2}", senderName, _("me"), message));
|
||||
replyTo.setReplyTo(target);
|
||||
if (target != sender)
|
||||
{
|
||||
|
@@ -39,7 +39,7 @@ public class Commandrealname extends EssentialsCommand
|
||||
}
|
||||
if (!foundUser)
|
||||
{
|
||||
throw new NoSuchFieldException(_("playerNotFound"));
|
||||
throw new NoSuchFieldException(_("Player not found."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -41,7 +41,7 @@ public class Commandremove extends EssentialsCommand
|
||||
}
|
||||
catch (NumberFormatException e)
|
||||
{
|
||||
throw new Exception(_("numberRequired"), e);
|
||||
throw new Exception(_("A number goes there, silly."), e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ public class Commandremove extends EssentialsCommand
|
||||
|
||||
if (world == null)
|
||||
{
|
||||
throw new Exception(_("invalidWorld"));
|
||||
throw new Exception(_("Invalid world."));
|
||||
}
|
||||
final ToRemove toRemove;
|
||||
try
|
||||
@@ -149,6 +149,6 @@ public class Commandremove extends EssentialsCommand
|
||||
|
||||
}
|
||||
}
|
||||
sender.sendMessage(_("removed", removed));
|
||||
sender.sendMessage(_("Removed {0} entities.", removed));
|
||||
}
|
||||
}
|
||||
|
@@ -28,12 +28,12 @@ public class Commandrepair extends EssentialsCommand
|
||||
final ItemStack item = user.getPlayer().getItemInHand();
|
||||
if (item == null)
|
||||
{
|
||||
throw new Exception(_("repairInvalidType"));
|
||||
throw new Exception(_("This item cannot be repaired."));
|
||||
}
|
||||
|
||||
if (!item.getEnchantments().isEmpty() && !Permissions.REPAIR_ENCHANTED.isAuthorized(user))
|
||||
{
|
||||
throw new Exception(_("repairEnchanted"));
|
||||
throw new Exception(_("You are not allowed to repair enchanted items."));
|
||||
}
|
||||
|
||||
final String itemName = item.getType().toString().toLowerCase(Locale.ENGLISH);
|
||||
@@ -45,7 +45,7 @@ public class Commandrepair extends EssentialsCommand
|
||||
|
||||
charge.charge(user);
|
||||
|
||||
user.sendMessage(_("repair", itemName.replace('_', ' ')));
|
||||
user.sendMessage(_("You have successfully repaired your: {0}.", itemName.replace('_', ' ')));
|
||||
}
|
||||
else if (args[0].equalsIgnoreCase("all") && Permissions.REPAIR_ALL.isAuthorized(user))
|
||||
{
|
||||
@@ -61,11 +61,11 @@ public class Commandrepair extends EssentialsCommand
|
||||
|
||||
if (repaired.isEmpty())
|
||||
{
|
||||
throw new Exception(_("repairNone"));
|
||||
throw new Exception(_("There were no items that needing repairing."));
|
||||
}
|
||||
else
|
||||
{
|
||||
user.sendMessage(_("repair", Util.joinList(repaired)));
|
||||
user.sendMessage(_("You have successfully repaired your: {0}.", Util.joinList(repaired)));
|
||||
}
|
||||
charge.charge(user);
|
||||
|
||||
@@ -81,12 +81,12 @@ public class Commandrepair extends EssentialsCommand
|
||||
final Material material = Material.getMaterial(item.getTypeId());
|
||||
if (material.isBlock() || material.getMaxDurability() < 1)
|
||||
{
|
||||
throw new Exception(_("repairInvalidType"));
|
||||
throw new Exception(_("This item cannot be repaired."));
|
||||
}
|
||||
|
||||
if (item.getDurability() == 0)
|
||||
{
|
||||
throw new Exception(_("repairAlreadyFixed"));
|
||||
throw new Exception(_("This item does not need repairing."));
|
||||
}
|
||||
|
||||
item.setDurability((short)0);
|
||||
|
@@ -33,20 +33,20 @@ public class Commandseen extends EssentialsCommand
|
||||
{
|
||||
final IUser u = ess.getUserMap().matchUserExcludingHidden(args[0], getPlayerOrNull(sender));
|
||||
u.setDisplayNick();
|
||||
sender.sendMessage(_("seenOnline", u.getPlayer().getDisplayName(), DateUtil.formatDateDiff(u.getTimestamp(TimestampType.LOGIN))));
|
||||
sender.sendMessage(_("Player {0} is online since {1}.", u.getPlayer().getDisplayName(), DateUtil.formatDateDiff(u.getTimestamp(TimestampType.LOGIN))));
|
||||
if(u.getData().isAfk())
|
||||
{
|
||||
sender.sendMessage(_("whoisAFK", _("true")));
|
||||
sender.sendMessage(_(" - AFK: {0}", _("true")));
|
||||
}
|
||||
if(u.getData().isJailed())
|
||||
{
|
||||
sender.sendMessage(_("whoisJail", u.getTimestamp(TimestampType.JAIL) > 0
|
||||
sender.sendMessage(_(" - Jail: {0}", u.getTimestamp(TimestampType.JAIL) > 0
|
||||
? DateUtil.formatDateDiff(u.getTimestamp(TimestampType.JAIL))
|
||||
: _("true")));
|
||||
}
|
||||
if(u.getData().isMuted())
|
||||
{
|
||||
sender.sendMessage(_("whoisMuted", u.getTimestamp(TimestampType.MUTE) > 0
|
||||
sender.sendMessage(_(" - Muted: {0}", u.getTimestamp(TimestampType.MUTE) > 0
|
||||
? DateUtil.formatDateDiff(u.getTimestamp(TimestampType.MUTE))
|
||||
: _("true")));
|
||||
}
|
||||
@@ -54,10 +54,10 @@ public class Commandseen extends EssentialsCommand
|
||||
catch (PlayerNotFoundException e)
|
||||
{
|
||||
final IUser u = ess.getUserMap().matchUser(args[0], true);
|
||||
sender.sendMessage(_("seenOffline", u.getName(), DateUtil.formatDateDiff(u.getTimestamp(TimestampType.LOGOUT))));
|
||||
sender.sendMessage(_("Player {0} is offline since {1}.", u.getName(), DateUtil.formatDateDiff(u.getTimestamp(TimestampType.LOGOUT))));
|
||||
if (u.isBanned())
|
||||
{
|
||||
sender.sendMessage(_("whoisBanned", show ? u.getData().getBan().getReason() : _("true")));
|
||||
sender.sendMessage(_(" - Banned: {0}", show ? u.getData().getBan().getReason() : _("true")));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -72,7 +72,7 @@ public class Commandsell extends EssentialsCommand
|
||||
{
|
||||
if (is == null || is.getType() == Material.AIR)
|
||||
{
|
||||
throw new Exception(_("itemSellAir"));
|
||||
throw new Exception(_("You really tried to sell Air? Put an item in your hand."));
|
||||
}
|
||||
int amount = 0;
|
||||
if (args.length > 1)
|
||||
@@ -88,7 +88,7 @@ public class Commandsell extends EssentialsCommand
|
||||
|
||||
if (Double.isNaN(worth))
|
||||
{
|
||||
throw new Exception(_("itemCannotBeSold"));
|
||||
throw new Exception(_("That item cannot be sold to the server."));
|
||||
}
|
||||
|
||||
|
||||
@@ -127,9 +127,9 @@ public class Commandsell extends EssentialsCommand
|
||||
{
|
||||
if (!isBulkSell)
|
||||
{
|
||||
user.sendMessage(_("itemNotEnough1"));
|
||||
user.sendMessage(_("itemNotEnough2"));
|
||||
throw new Exception(_("itemNotEnough3"));
|
||||
user.sendMessage(_("You do not have enough of that item to sell."));
|
||||
user.sendMessage(_("If you meant to sell all of your items of that type, use /sell itemname."));
|
||||
throw new Exception(_("/sell itemname -1 will sell all but one item, etc."));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -38,13 +38,13 @@ public class Commandsethome extends EssentialsCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception(_("maxHomes", ess.getRanks().getHomeLimit(user)));
|
||||
throw new Exception(_("You cannot set more than {0} homes.", ess.getRanks().getHomeLimit(user)));
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception(_("maxHomes", 1));
|
||||
throw new Exception(_("You cannot set more than {0} homes.", 1));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -54,7 +54,7 @@ public class Commandsethome extends EssentialsCommand
|
||||
IUser usersHome = ess.getUserMap().getUser(ess.getServer().getPlayer(args[0]));
|
||||
if (usersHome == null)
|
||||
{
|
||||
throw new NoSuchFieldException(_("playerNotFound"));
|
||||
throw new NoSuchFieldException(_("Player not found."));
|
||||
}
|
||||
String name = args[1].toLowerCase(Locale.ENGLISH);
|
||||
if (!Permissions.SETHOME_MULTIPLE.isAuthorized(user))
|
||||
@@ -63,7 +63,7 @@ public class Commandsethome extends EssentialsCommand
|
||||
}
|
||||
if ("bed".equals(name.toLowerCase(Locale.ENGLISH)))
|
||||
{
|
||||
throw new NoSuchFieldException(_("invalidHomeName"));
|
||||
throw new NoSuchFieldException(_("Invalid home name"));
|
||||
}
|
||||
|
||||
usersHome.getData().addHome(name, user.getPlayer().getLocation());
|
||||
|
@@ -15,7 +15,7 @@ public class Commandsetjail extends EssentialsCommand
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
ess.getJails().setJail(args[0], user.getPlayer().getLocation());
|
||||
user.sendMessage(_("jailSet", Util.sanitizeString(args[0])));
|
||||
user.sendMessage(_("Jail {0} has been set.", Util.sanitizeString(args[0])));
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -11,6 +11,6 @@ public class Commandsetspawn extends EssentialsCommand
|
||||
{
|
||||
final String group = args.length > 0 ? getFinalArg(args, 0) : "default";
|
||||
ess.getSpawns().setSpawn(user.getPlayer().getLocation(), group);
|
||||
user.sendMessage(_("spawnSet", group));
|
||||
user.sendMessage(_("Spawn location set for group {0}.", group));
|
||||
}
|
||||
}
|
||||
|
@@ -20,7 +20,7 @@ public class Commandsetwarp extends EssentialsCommand
|
||||
|
||||
if (Util.isInt(args[0]))
|
||||
{
|
||||
throw new NoSuchFieldException(_("invalidWarpName"));
|
||||
throw new NoSuchFieldException(_("Invalid warp name"));
|
||||
}
|
||||
|
||||
final Location loc = user.getPlayer().getLocation();
|
||||
@@ -42,9 +42,9 @@ public class Commandsetwarp extends EssentialsCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception(_("warpOverwrite"));
|
||||
throw new Exception(_("You cannot overwrite that warp."));
|
||||
}
|
||||
|
||||
user.sendMessage(_("warpSet", args[0]));
|
||||
user.sendMessage(_("Warp {0} set.", args[0]));
|
||||
}
|
||||
}
|
||||
|
@@ -31,7 +31,7 @@ public class Commandsetworth extends EssentialsCommand
|
||||
}
|
||||
|
||||
ess.getWorth().setPrice(stack, Double.parseDouble(price));
|
||||
user.sendMessage(_("worthSet"));
|
||||
user.sendMessage(_("Worth value set."));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -44,6 +44,6 @@ public class Commandsetworth extends EssentialsCommand
|
||||
|
||||
final ItemStack stack = ess.getItemDb().get(args[0]);
|
||||
ess.getWorth().setPrice(stack, Double.parseDouble(args[1]));
|
||||
sender.sendMessage(_("worthSet"));
|
||||
sender.sendMessage(_("Worth value set."));
|
||||
}
|
||||
}
|
||||
|
@@ -22,8 +22,8 @@ public class Commandspawn extends EssentialsCommand
|
||||
respawn(otherUser, null);
|
||||
if (!otherUser.equals(user))
|
||||
{
|
||||
otherUser.sendMessage(_("teleportAtoB", user.getPlayer().getDisplayName(), "spawn"));
|
||||
user.sendMessage(_("teleporting"));
|
||||
otherUser.sendMessage(_("{0} teleported you to {1}.", user.getPlayer().getDisplayName(), "spawn"));
|
||||
user.sendMessage(_("Teleporting..."));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -41,8 +41,8 @@ public class Commandspawn extends EssentialsCommand
|
||||
}
|
||||
final IUser user = ess.getUserMap().matchUser(args[0], false);
|
||||
respawn(user, null);
|
||||
user.sendMessage(_("teleportAtoB", user.getPlayer().getDisplayName(), "spawn"));
|
||||
sender.sendMessage(_("teleporting"));
|
||||
user.sendMessage(_("{0} teleported you to {1}.", user.getPlayer().getDisplayName(), "spawn"));
|
||||
sender.sendMessage(_("Teleporting..."));
|
||||
}
|
||||
|
||||
private void respawn(final IUser user, final Trade charge) throws Exception
|
||||
|
@@ -21,13 +21,13 @@ public class Commandspawner extends EssentialsCommand
|
||||
{
|
||||
if (args.length < 1 || args[0].length() < 2)
|
||||
{
|
||||
throw new NotEnoughArgumentsException(_("mobsAvailable", Util.joinList(LivingEntities.getLivingEntityList())));
|
||||
throw new NotEnoughArgumentsException(_("Mobs: {0}", Util.joinList(LivingEntities.getLivingEntityList())));
|
||||
}
|
||||
|
||||
final Location target = LocationUtil.getTarget(user.getPlayer());
|
||||
if (target == null || target.getBlock().getType() != Material.MOB_SPAWNER)
|
||||
{
|
||||
throw new Exception(_("mobSpawnTarget"));
|
||||
throw new Exception(_("Target block must be a mob spawner."));
|
||||
}
|
||||
|
||||
try
|
||||
@@ -38,12 +38,12 @@ public class Commandspawner extends EssentialsCommand
|
||||
mob = LivingEntities.fromName(name);
|
||||
if (mob == null)
|
||||
{
|
||||
user.sendMessage(_("invalidMob"));
|
||||
user.sendMessage(_("Invalid mob type."));
|
||||
return;
|
||||
}
|
||||
if (!Permissions.SPAWNER.isAuthorized(user, mob.getName()))
|
||||
{
|
||||
throw new Exception(_("unableToSpawnMob"));
|
||||
throw new Exception(_("Unable to spawn mob."));
|
||||
}
|
||||
int delay = 0;
|
||||
if(args.length > 1 && Util.isInt(args[1]))
|
||||
@@ -58,11 +58,11 @@ public class Commandspawner extends EssentialsCommand
|
||||
spawner.setDelay(delay);
|
||||
|
||||
charge.charge(user);
|
||||
user.sendMessage(_("setSpawner", mob.getName()));
|
||||
user.sendMessage(_("Changed spawner type to {0}.", mob.getName()));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new Exception(_("mobSpawnError"), ex);
|
||||
throw new Exception(_("Error while changing mob spawner."), ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@ public class Commandspawnmob extends EssentialsCommand
|
||||
if (args.length < 1)
|
||||
{
|
||||
final String mobList = SpawnMob.mobList(user);
|
||||
throw new NotEnoughArgumentsException(_("mobsAvailable", mobList));
|
||||
throw new NotEnoughArgumentsException(_("Mobs: {0}", mobList));
|
||||
}
|
||||
|
||||
List<String> mobParts = SpawnMob.mobParts(args[0]);
|
||||
|
@@ -61,12 +61,12 @@ public class Commandspeed extends EssentialsCommand
|
||||
//if (isFly)
|
||||
//{
|
||||
user.getPlayer().setFlySpeed((float)getRealMoveSpeed(speed, isFly, isBypass));
|
||||
user.sendMessage(_("moveSpeed", _("flying"), speed, user.getPlayer().getDisplayName()));
|
||||
user.sendMessage(_("Set {0} speed to {1} for {2}.", _("flying"), speed, user.getPlayer().getDisplayName()));
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// user.setWalkSpeed(getRealMoveSpeed(speed, isFly, isBypass));
|
||||
// user.sendMessage(_("moveSpeed", _("walking"), speed, user.getDisplayName()));
|
||||
// user.sendMessage(_("Set {0} speed to {1} for {2}.", _("walking"), speed, user.getDisplayName()));
|
||||
//}
|
||||
}
|
||||
|
||||
@@ -77,12 +77,12 @@ public class Commandspeed extends EssentialsCommand
|
||||
if (isFly)
|
||||
{
|
||||
matchPlayer.setFlySpeed((float)getRealMoveSpeed(speed, isFly, isBypass));
|
||||
sender.sendMessage(_("moveSpeed", _("flying"), speed, matchPlayer.getDisplayName()));
|
||||
sender.sendMessage(_("Set {0} speed to {1} for {2}.", _("flying"), speed, matchPlayer.getDisplayName()));
|
||||
}
|
||||
//else
|
||||
// {
|
||||
// matchPlayer.setWalkSpeed(getRealMoveSpeed(speed, isFly, isBypass));
|
||||
// sender.sendMessage(_("moveSpeed", _("walking"), speed, matchPlayer.getDisplayName()));
|
||||
// sender.sendMessage(_("Set {0} speed to {1} for {2}.", _("walking"), speed, matchPlayer.getDisplayName()));
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
@@ -29,11 +29,11 @@ public class Commandsudo extends EssentialsCommand
|
||||
|
||||
if (Permissions.SUDO_EXEMPT.isAuthorized(user))
|
||||
{
|
||||
throw new Exception(_("sudoExempt"));
|
||||
throw new Exception(_("You cannot sudo this user."));
|
||||
}
|
||||
|
||||
final Player player = user.getPlayer();
|
||||
sender.sendMessage(_("sudoRun", player.getDisplayName(), command, getFinalArg(arguments, 0)));
|
||||
sender.sendMessage(_("Forcing {0} to run: /{1} {2}.", player.getDisplayName(), command, getFinalArg(arguments, 0)));
|
||||
|
||||
final Server server = ess.getServer();
|
||||
server.dispatchCommand(user, command);
|
||||
|
@@ -13,7 +13,7 @@ public class Commandsuicide extends EssentialsCommand
|
||||
final Player player = user.getPlayer();
|
||||
ess.getPlugin().callSuicideEvent(player);
|
||||
user.getPlayer().damage(player.getHealth());
|
||||
user.sendMessage(_("suicideMessage"));
|
||||
ess.broadcastMessage(user, _("suicideSuccess", player.getDisplayName()));
|
||||
user.sendMessage(_("Goodbye cruel world..."));
|
||||
ess.broadcastMessage(user, _(" {0} took their own life", player.getDisplayName()));
|
||||
}
|
||||
}
|
||||
|
@@ -27,7 +27,7 @@ public class Commandtempban extends EssentialsCommand
|
||||
{
|
||||
if (Permissions.TEMPBAN_OFFLINE.isAuthorized(sender))
|
||||
{
|
||||
sender.sendMessage(_("tempbanExempt"));
|
||||
sender.sendMessage(_("You may not tempban that player."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,7 @@ public class Commandtempban extends EssentialsCommand
|
||||
{
|
||||
if (Permissions.TEMPBAN_EXEMPT.isAuthorized(user) && sender instanceof Player)
|
||||
{
|
||||
sender.sendMessage(_("tempbanExempt"));
|
||||
sender.sendMessage(_("You may not tempban that player."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -49,7 +49,7 @@ public class Commandtempban extends EssentialsCommand
|
||||
return;
|
||||
}
|
||||
|
||||
final String banReason = _("tempBanned", DateUtil.formatDateDiff(banTimestamp));
|
||||
final String banReason = _("Temporarily banned from server for {0}", DateUtil.formatDateDiff(banTimestamp));
|
||||
final Ban ban = new Ban();
|
||||
final UserData userData = user.getData();
|
||||
ban.setReason(banReason);
|
||||
@@ -65,7 +65,7 @@ public class Commandtempban extends EssentialsCommand
|
||||
final IUser player = ess.getUserMap().getUser(onlinePlayer);
|
||||
if (Permissions.BAN_NOTIFY.isAuthorized(player))
|
||||
{
|
||||
onlinePlayer.sendMessage(_("playerBanned", senderName, user.getName(), banReason));
|
||||
onlinePlayer.sendMessage(_("Player {0} banned {1} for {2}.", senderName, user.getName(), banReason));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -22,13 +22,13 @@ public class Commandthunder extends EssentialsCommand
|
||||
|
||||
world.setThundering(setThunder ? true : false);
|
||||
world.setThunderDuration(Integer.parseInt(args[1]) * 20);
|
||||
user.sendMessage(_("thunderDuration", (setThunder ? _("enabled") : _("disabled")), Integer.parseInt(args[1])));
|
||||
user.sendMessage(_("You {0} thunder in your world for {1} seconds.", (setThunder ? _("enabled") : _("disabled")), Integer.parseInt(args[1])));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
world.setThundering(setThunder ? true : false);
|
||||
user.sendMessage(_("thunder", setThunder ? _("enabled") : _("disabled")));
|
||||
user.sendMessage(_(" You {0} thunder in your world.", setThunder ? _("enabled") : _("disabled")));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -45,7 +45,7 @@ public class Commandtime extends EssentialsCommand
|
||||
|
||||
if (!Permissions.TIME_SET.isAuthorized(sender))
|
||||
{
|
||||
sender.sendMessage(_("timeSetPermission"));
|
||||
sender.sendMessage(_("You are not authorized to set the time."));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ public class Commandtime extends EssentialsCommand
|
||||
|
||||
for (World world : worlds)
|
||||
{
|
||||
sender.sendMessage(_("timeWorldCurrent", world.getName(), DescParseTickFormat.format(world.getTime())));
|
||||
sender.sendMessage(_("The current time in {0} is {1}.", world.getName(), DescParseTickFormat.format(world.getTime())));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ public class Commandtime extends EssentialsCommand
|
||||
output.append(world.getName());
|
||||
}
|
||||
|
||||
sender.sendMessage(_("timeWorldSet", DescParseTickFormat.format(ticks), output.toString()));
|
||||
sender.sendMessage(_("The time was set to {0} in: {1}.", DescParseTickFormat.format(ticks), output.toString()));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -159,7 +159,7 @@ public class Commandtime extends EssentialsCommand
|
||||
// We failed to understand the world target...
|
||||
else
|
||||
{
|
||||
throw new Exception(_("invalidWorld"));
|
||||
throw new Exception(_("Invalid world."));
|
||||
}
|
||||
|
||||
return worlds;
|
||||
|
@@ -26,7 +26,7 @@ public class Commandtogglejail extends EssentialsCommand
|
||||
{
|
||||
if (Permissions.TOGGLEJAIL_OFFLINE.isAuthorized(sender))
|
||||
{
|
||||
sender.sendMessage(_("mayNotJail"));
|
||||
sender.sendMessage(_("You may not jail that person."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,7 @@ public class Commandtogglejail extends EssentialsCommand
|
||||
{
|
||||
if (Permissions.JAIL_EXEMPT.isAuthorized(player))
|
||||
{
|
||||
sender.sendMessage(_("mayNotJail"));
|
||||
sender.sendMessage(_("You may not jail that person."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -48,7 +48,7 @@ public class Commandtogglejail extends EssentialsCommand
|
||||
ess.getJails().getJail(args[1]);
|
||||
}
|
||||
player.getData().setJailed(true);
|
||||
player.sendMessage(_("userJailed"));
|
||||
player.sendMessage(_("You have been jailed."));
|
||||
player.getData().setJail(args[1]);
|
||||
long timeDiff = 0;
|
||||
if (args.length > 2)
|
||||
@@ -59,13 +59,13 @@ public class Commandtogglejail extends EssentialsCommand
|
||||
}
|
||||
player.queueSave();
|
||||
sender.sendMessage(
|
||||
(timeDiff > 0 ? _("playerJailedFor", player.getName(), DateUtil.formatDateDiff(timeDiff)) : _("playerJailed", player.getName())));
|
||||
(timeDiff > 0 ? _(" Player {0} jailed for {1}.", player.getName(), DateUtil.formatDateDiff(timeDiff)) : _("Player {0} jailed.", player.getName())));
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.length >= 2 && player.getData().isJailed() && !args[1].equalsIgnoreCase(player.getData().getJail()))
|
||||
{
|
||||
sender.sendMessage(_("jailAlreadyIncarcerated", player.getData().getJail()));
|
||||
sender.sendMessage(_("Person is already in jail: {0}", player.getData().getJail()));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ public class Commandtogglejail extends EssentialsCommand
|
||||
final long timeDiff = DateUtil.parseDateDiff(time, true);
|
||||
player.setTimestamp(TimestampType.JAIL, timeDiff);
|
||||
player.queueSave();
|
||||
sender.sendMessage(_("jailSentenceExtended", DateUtil.formatDateDiff(timeDiff)));
|
||||
sender.sendMessage(_("Jail time extend to: {0}", DateUtil.formatDateDiff(timeDiff)));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -87,14 +87,14 @@ public class Commandtogglejail extends EssentialsCommand
|
||||
}
|
||||
player.getData().setJailed(false);
|
||||
player.setTimestamp(TimestampType.JAIL, 0);
|
||||
player.sendMessage(_("jailReleasedPlayerNotify"));
|
||||
player.sendMessage(_("You have been released!"));
|
||||
player.getData().setJail(null);
|
||||
if (player.isOnline())
|
||||
{
|
||||
player.getTeleport().back();
|
||||
}
|
||||
player.queueSave();
|
||||
sender.sendMessage(_("jailReleased", player.getName()));
|
||||
sender.sendMessage(_("Player {0} unjailed.", player.getName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -21,6 +21,6 @@ public class Commandtop extends EssentialsCommand
|
||||
user.getTeleport().teleport(
|
||||
new Location(player.getWorld(), topX, topY + 1, topZ, playerLocation.getYaw(), playerLocation.getPitch()), new Trade(commandName, ess),
|
||||
TeleportCause.COMMAND);
|
||||
user.sendMessage(_("teleportTop"));
|
||||
user.sendMessage(_("Teleporting to top."));
|
||||
}
|
||||
}
|
||||
|
@@ -25,19 +25,19 @@ public class Commandtp extends EssentialsCommand
|
||||
final IUser player = ess.getUserMap().matchUserExcludingHidden(args[0], user.getPlayer());
|
||||
if (!player.getData().isTeleportEnabled())
|
||||
{
|
||||
throw new Exception(_("teleportDisabled", player.getPlayer().getDisplayName()));
|
||||
throw new Exception(_("{0} has teleportation disabled.", player.getPlayer().getDisplayName()));
|
||||
}
|
||||
if (settings.getData().getGeneral().isPerGroupTeleport() && !Permissions.PERGROUPTELEPORT.isAuthorized(
|
||||
user, ess.getRanks().getMainGroup(player)))
|
||||
{
|
||||
throw new Exception(_("noPerm", "essentials.teleport.groups." + ess.getRanks().getMainGroup(player)));
|
||||
throw new Exception(_("You do not have the {0} permission.", "essentials.teleport.groups." + ess.getRanks().getMainGroup(player)));
|
||||
}
|
||||
if (user.getPlayer().getWorld() != player.getPlayer().getWorld() && settings.getData().getGeneral().isWorldTeleportPermissions() && !Permissions.WORLD.isAuthorized(
|
||||
user, player.getPlayer().getWorld().getName()))
|
||||
{
|
||||
throw new Exception(_("noPerm", "essentials.world." + player.getPlayer().getWorld().getName()));
|
||||
throw new Exception(_("You do not have the {0} permission.", "essentials.world." + player.getPlayer().getWorld().getName()));
|
||||
}
|
||||
user.sendMessage(_("teleporting"));
|
||||
user.sendMessage(_("Teleporting..."));
|
||||
final Trade charge = new Trade(commandName, ess);
|
||||
charge.isAffordableFor(user);
|
||||
user.getTeleport().teleport(player.getPlayer(), charge, TeleportCause.COMMAND);
|
||||
@@ -48,7 +48,7 @@ public class Commandtp extends EssentialsCommand
|
||||
{
|
||||
throw new Exception(_("needTpohere"));
|
||||
}
|
||||
user.sendMessage(_("teleporting"));
|
||||
user.sendMessage(_("Teleporting..."));
|
||||
|
||||
final IUser target = ess.getUserMap().matchUserExcludingHidden(args[0], user.getPlayer());
|
||||
|
||||
@@ -56,19 +56,19 @@ public class Commandtp extends EssentialsCommand
|
||||
|
||||
if (!target.getData().isTeleportEnabled())
|
||||
{
|
||||
throw new Exception(_("teleportDisabled", target.getPlayer().getDisplayName()));
|
||||
throw new Exception(_("{0} has teleportation disabled.", target.getPlayer().getDisplayName()));
|
||||
}
|
||||
if (!toPlayer.getData().isTeleportEnabled())
|
||||
{
|
||||
throw new Exception(_("teleportDisabled", toPlayer.getPlayer().getDisplayName()));
|
||||
throw new Exception(_("{0} has teleportation disabled.", toPlayer.getPlayer().getDisplayName()));
|
||||
}
|
||||
if (target.getPlayer().getWorld() != toPlayer.getPlayer().getWorld() && settings.getData().getGeneral().isWorldTeleportPermissions() && !Permissions.WORLD.isAuthorized(
|
||||
user, toPlayer.getPlayer().getWorld().getName()))
|
||||
{
|
||||
throw new Exception(_("noPerm", "essentials.world." + toPlayer.getPlayer().getWorld().getName()));
|
||||
throw new Exception(_("You do not have the {0} permission.", "essentials.world." + toPlayer.getPlayer().getWorld().getName()));
|
||||
}
|
||||
target.getTeleport().now(toPlayer.getPlayer(), false, TeleportCause.COMMAND);
|
||||
target.sendMessage(_("teleportAtoB", user.getPlayer().getDisplayName(), toPlayer.getPlayer().getDisplayName()));
|
||||
target.sendMessage(_("{0} teleported you to {1}.", user.getPlayer().getDisplayName(), toPlayer.getPlayer().getDisplayName()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -81,10 +81,10 @@ public class Commandtp extends EssentialsCommand
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
|
||||
sender.sendMessage(_("teleporting"));
|
||||
sender.sendMessage(_("Teleporting..."));
|
||||
final IUser target = ess.getUserMap().getUser(args[0]);
|
||||
final IUser toPlayer = ess.getUserMap().getUser(args[1]);
|
||||
target.getTeleport().now(toPlayer.getPlayer(), false, TeleportCause.COMMAND);
|
||||
target.sendMessage(_("teleportAtoB", Console.NAME, toPlayer.getPlayer().getDisplayName()));
|
||||
target.sendMessage(_("{0} teleported you to {1}.", Console.NAME, toPlayer.getPlayer().getDisplayName()));
|
||||
}
|
||||
}
|
||||
|
@@ -20,32 +20,32 @@ public class Commandtpa extends EssentialsCommand
|
||||
IUser player = ess.getUserMap().matchUserExcludingHidden(args[0], user.getPlayer());
|
||||
if (!player.getData().isTeleportEnabled())
|
||||
{
|
||||
throw new Exception(_("teleportDisabled", player.getPlayer().getDisplayName()));
|
||||
throw new Exception(_("{0} has teleportation disabled.", player.getPlayer().getDisplayName()));
|
||||
}
|
||||
ISettings settings = ess.getSettings();
|
||||
if (settings.getData().getGeneral().isPerGroupTeleport() && !Permissions.PERGROUPTELEPORT.isAuthorized(
|
||||
user, ess.getRanks().getMainGroup(player)))
|
||||
{
|
||||
throw new Exception(_("noPerm", "essentials.teleport.groups." + ess.getRanks().getMainGroup(player)));
|
||||
throw new Exception(_("You do not have the {0} permission.", "essentials.teleport.groups." + ess.getRanks().getMainGroup(player)));
|
||||
}
|
||||
if (user.getPlayer().getWorld() != player.getPlayer().getWorld() && ess.getSettings().getData().getGeneral().isWorldTeleportPermissions() && !Permissions.WORLD.isAuthorized(
|
||||
user, user.getPlayer().getWorld().getName()))
|
||||
{
|
||||
throw new Exception(_("noPerm", "essentials.world." + player.getPlayer().getWorld().getName()));
|
||||
throw new Exception(_("You do not have the {0} permission.", "essentials.world." + player.getPlayer().getWorld().getName()));
|
||||
}
|
||||
if (!player.isIgnoringPlayer(user))
|
||||
{
|
||||
player.requestTeleport(user, false);
|
||||
player.sendMessage(_("teleportRequest", user.getPlayer().getDisplayName()));
|
||||
player.sendMessage(_("typeTpaccept"));
|
||||
player.sendMessage(_("typeTpdeny"));
|
||||
player.sendMessage(_("{0} has requested to teleport to you.", user.getPlayer().getDisplayName()));
|
||||
player.sendMessage(_("To teleport, type /tpaccept."));
|
||||
player.sendMessage(_("To deny this request, type /tpdeny."));
|
||||
int tpaAcceptCancellation = 0;
|
||||
tpaAcceptCancellation = settings.getData().getCommands().getTeleport().getRequestTimeout();
|
||||
if (tpaAcceptCancellation != 0)
|
||||
{
|
||||
player.sendMessage(_("teleportRequestTimeoutInfo", tpaAcceptCancellation));
|
||||
player.sendMessage(_("This request will timeout after {0} seconds.", tpaAcceptCancellation));
|
||||
}
|
||||
}
|
||||
user.sendMessage(_("requestSent", player.getPlayer().getDisplayName()));
|
||||
user.sendMessage(_("Request sent to {0}.", player.getPlayer().getDisplayName()));
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user