mirror of
https://github.com/essentials/Essentials.git
synced 2025-10-03 17:41:57 +02:00
This feels so good D:
This commit is contained in:
@@ -1,21 +1,12 @@
|
||||
package com.earth2me.essentials;
|
||||
|
||||
import com.earth2me.essentials.api.ICommandHandler;
|
||||
import com.earth2me.essentials.api.ISettings;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IEssentials;
|
||||
import com.earth2me.essentials.api.IEssentialsModule;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import com.earth2me.essentials.api.*;
|
||||
import com.earth2me.essentials.commands.EssentialsCommand;
|
||||
import com.earth2me.essentials.commands.IEssentialsCommand;
|
||||
import com.earth2me.essentials.commands.NoChargeException;
|
||||
import com.earth2me.essentials.commands.NotEnoughArgumentsException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.bukkit.Bukkit;
|
||||
@@ -36,6 +27,7 @@ public class EssentialsCommandHandler implements ICommandHandler
|
||||
private static final transient Logger LOGGER = Bukkit.getLogger();
|
||||
private final transient Map<String, List<PluginCommand>> altcommands = new HashMap<String, List<PluginCommand>>();
|
||||
private final transient Map<String, String> disabledList = new HashMap<String, String>();
|
||||
private final transient Map<String, IEssentialsCommand> commands = new HashMap<String, IEssentialsCommand>();
|
||||
private final transient IEssentials ess;
|
||||
|
||||
public EssentialsCommandHandler(ClassLoader classLoader, String commandPath, String permissionPrefix, IEssentials ess)
|
||||
@@ -66,10 +58,13 @@ public class EssentialsCommandHandler implements ICommandHandler
|
||||
boolean overridden = false;
|
||||
ISettings settings = ess.getSettings();
|
||||
settings.acquireReadLock();
|
||||
try {
|
||||
try
|
||||
{
|
||||
disabled = settings.getData().getCommands().isDisabled(command.getName());
|
||||
overridden = !disabled || settings.getData().getCommands().isOverridden(command.getName());
|
||||
} finally {
|
||||
}
|
||||
finally
|
||||
{
|
||||
settings.unlock();
|
||||
}
|
||||
// Allow plugins to override the command via onCommand
|
||||
@@ -98,22 +93,27 @@ public class EssentialsCommandHandler implements ICommandHandler
|
||||
return true;
|
||||
}
|
||||
|
||||
IEssentialsCommand cmd;
|
||||
try
|
||||
final String commandName = command.getName().toLowerCase(Locale.ENGLISH);
|
||||
IEssentialsCommand cmd = commands.get(commandName);
|
||||
if (cmd == null)
|
||||
{
|
||||
cmd = (IEssentialsCommand)classLoader.loadClass(commandPath + command.getName()).newInstance();
|
||||
cmd.setEssentials(ess);
|
||||
cmd.setEssentialsModule(module);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
sender.sendMessage(_("commandNotLoaded", commandLabel));
|
||||
LOGGER.log(Level.SEVERE, _("commandNotLoaded", commandLabel), ex);
|
||||
return true;
|
||||
try
|
||||
{
|
||||
cmd = (IEssentialsCommand)classLoader.loadClass(commandPath + commandName).newInstance();
|
||||
cmd.init(ess, commandName);
|
||||
cmd.setEssentialsModule(module);
|
||||
commands.put(commandName, cmd);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
sender.sendMessage(_("commandNotLoaded", commandName));
|
||||
LOGGER.log(Level.SEVERE, _("commandNotLoaded", commandName), ex);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Check authorization
|
||||
if (user != null && !user.isAuthorized(cmd, permissionPrefix))
|
||||
if (user != null && !user.isAuthorized(cmd))
|
||||
{
|
||||
LOGGER.log(Level.WARNING, _("deniedAccessCommand", user.getName()));
|
||||
user.sendMessage(_("noAccessCommand"));
|
||||
@@ -125,14 +125,14 @@ public class EssentialsCommandHandler implements ICommandHandler
|
||||
{
|
||||
if (user == null)
|
||||
{
|
||||
cmd.run(ess.getServer(), sender, commandLabel, command, args);
|
||||
cmd.run(sender, command, args);
|
||||
}
|
||||
else
|
||||
{
|
||||
user.acquireReadLock();
|
||||
try
|
||||
{
|
||||
cmd.run(ess.getServer(), user, commandLabel, command, args);
|
||||
cmd.run(user, command, args);
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -177,11 +177,10 @@ public class EssentialsCommandHandler implements ICommandHandler
|
||||
LOGGER.log(Level.WARNING, _("errorCallingCommand", commandLabel), exception);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onReload()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public final void addPlugin(final Plugin plugin)
|
||||
|
@@ -14,6 +14,7 @@ import java.util.logging.Logger;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import lombok.Cleanup;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
@@ -39,17 +40,17 @@ public final class Util
|
||||
try
|
||||
{
|
||||
String r = name.toLowerCase(Locale.ENGLISH);
|
||||
r = r.replace('.', (char)('\ue200'+'.'));
|
||||
r = r.replace('\\', (char)('\ue200'+'\\'));
|
||||
r = r.replace('/', (char)('\ue200'+'/'));
|
||||
r = r.replace('"', (char)('\ue200'+'"'));
|
||||
r = r.replace('<', (char)('\ue200'+'<'));
|
||||
r = r.replace('>', (char)('\ue200'+'>'));
|
||||
r = r.replace('|', (char)('\ue200'+'|'));
|
||||
r = r.replace('?', (char)('\ue200'+'?'));
|
||||
r = r.replace('*', (char)('\ue200'+'*'));
|
||||
r = r.replace(':', (char)('\ue200'+':'));
|
||||
r = r.replace('-', (char)('\ue200'+'-'));
|
||||
r = r.replace('.', (char)('\ue200' + '.'));
|
||||
r = r.replace('\\', (char)('\ue200' + '\\'));
|
||||
r = r.replace('/', (char)('\ue200' + '/'));
|
||||
r = r.replace('"', (char)('\ue200' + '"'));
|
||||
r = r.replace('<', (char)('\ue200' + '<'));
|
||||
r = r.replace('>', (char)('\ue200' + '>'));
|
||||
r = r.replace('|', (char)('\ue200' + '|'));
|
||||
r = r.replace('?', (char)('\ue200' + '?'));
|
||||
r = r.replace('*', (char)('\ue200' + '*'));
|
||||
r = r.replace(':', (char)('\ue200' + ':'));
|
||||
r = r.replace('-', (char)('\ue200' + '-'));
|
||||
r = unsafeFileChars.matcher(r).replaceAll("");
|
||||
return Punycode.encode(r);
|
||||
}
|
||||
@@ -58,23 +59,23 @@ public final class Util
|
||||
throw new InvalidNameException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static String decodeFileName(String name) throws InvalidNameException
|
||||
{
|
||||
try
|
||||
{
|
||||
String r = Punycode.decode(name);
|
||||
r = r.replace((char)('\ue200'+'.'), '.');
|
||||
r = r.replace((char)('\ue200'+'\\'), '\\');
|
||||
r = r.replace((char)('\ue200'+'/'), '/');
|
||||
r = r.replace((char)('\ue200'+'"'), '"');
|
||||
r = r.replace((char)('\ue200'+'<'), '<');
|
||||
r = r.replace((char)('\ue200'+'>'), '>');
|
||||
r = r.replace((char)('\ue200'+'|'), '|');
|
||||
r = r.replace((char)('\ue200'+'?'), '?');
|
||||
r = r.replace((char)('\ue200'+'*'), '*');
|
||||
r = r.replace((char)('\ue200'+':'), ':');
|
||||
r = r.replace((char)('\ue200'+'-'), '-');
|
||||
r = r.replace((char)('\ue200' + '.'), '.');
|
||||
r = r.replace((char)('\ue200' + '\\'), '\\');
|
||||
r = r.replace((char)('\ue200' + '/'), '/');
|
||||
r = r.replace((char)('\ue200' + '"'), '"');
|
||||
r = r.replace((char)('\ue200' + '<'), '<');
|
||||
r = r.replace((char)('\ue200' + '>'), '>');
|
||||
r = r.replace((char)('\ue200' + '|'), '|');
|
||||
r = r.replace((char)('\ue200' + '?'), '?');
|
||||
r = r.replace((char)('\ue200' + '*'), '*');
|
||||
r = r.replace((char)('\ue200' + ':'), ':');
|
||||
r = r.replace((char)('\ue200' + '-'), '-');
|
||||
return r;
|
||||
}
|
||||
catch (PunycodeException ex)
|
||||
@@ -581,6 +582,44 @@ public final class Util
|
||||
}
|
||||
basePerm.recalculatePermissibles();
|
||||
}
|
||||
private static transient final Pattern DOT_PATTERN = Pattern.compile("\\.");
|
||||
|
||||
public static Permission registerPermission(String permission, PermissionDefault defaultPerm)
|
||||
{
|
||||
final PluginManager pluginManager = Bukkit.getServer().getPluginManager();
|
||||
final String[] parts = DOT_PATTERN.split(permission);
|
||||
final StringBuilder builder = new StringBuilder(permission.length());
|
||||
Permission parent = null;
|
||||
for (int i = 0; i < parts.length - 1; i++)
|
||||
{
|
||||
builder.append(parts[i]).append(".*");
|
||||
String permString = builder.toString();
|
||||
Permission perm = pluginManager.getPermission(permString);
|
||||
if (perm == null)
|
||||
{
|
||||
perm = new Permission(permString, PermissionDefault.FALSE);
|
||||
pluginManager.addPermission(perm);
|
||||
if (parent != null)
|
||||
{
|
||||
parent.getChildren().put(perm.getName(), Boolean.TRUE);
|
||||
}
|
||||
parent = perm;
|
||||
}
|
||||
builder.deleteCharAt(builder.length() - 1);
|
||||
}
|
||||
Permission perm = pluginManager.getPermission(permission);
|
||||
if (perm == null)
|
||||
{
|
||||
perm = new Permission(permission, defaultPerm);
|
||||
pluginManager.addPermission(perm);
|
||||
if (parent != null)
|
||||
{
|
||||
parent.getChildren().put(perm.getName(), Boolean.TRUE);
|
||||
}
|
||||
parent = perm;
|
||||
}
|
||||
return perm;
|
||||
}
|
||||
private static transient final Pattern COLOR_PATTERN = Pattern.compile("(?i)\u00A7[0-9A-F]");
|
||||
|
||||
public static String stripColor(final String input)
|
||||
|
@@ -1,5 +1,14 @@
|
||||
package com.earth2me.essentials.api;
|
||||
|
||||
public interface IPermission {
|
||||
import org.bukkit.permissions.Permission;
|
||||
import org.bukkit.permissions.PermissionDefault;
|
||||
|
||||
|
||||
public interface IPermission
|
||||
{
|
||||
String getPermission();
|
||||
|
||||
Permission getBukkitPermission();
|
||||
|
||||
PermissionDefault getPermissionDefault();
|
||||
}
|
||||
|
@@ -16,9 +16,9 @@ public interface IUser extends Player, IStorageObjectHolder<UserData>, IReload,
|
||||
|
||||
boolean isAuthorized(IPermission node);
|
||||
|
||||
boolean isAuthorized(IEssentialsCommand cmd);
|
||||
//boolean isAuthorized(IEssentialsCommand cmd);
|
||||
|
||||
boolean isAuthorized(IEssentialsCommand cmd, String permissionPrefix);
|
||||
//boolean isAuthorized(IEssentialsCommand cmd, String permissionPrefix);
|
||||
|
||||
Player getBase();
|
||||
|
||||
|
@@ -2,21 +2,17 @@ package com.earth2me.essentials.commands;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import org.bukkit.Server;
|
||||
import com.earth2me.essentials.perm.Permissions;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.permissions.PermissionDefault;
|
||||
|
||||
|
||||
public class Commandafk extends EssentialsCommand
|
||||
{
|
||||
public Commandafk()
|
||||
{
|
||||
super("afk");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(Server server, IUser user, String commandLabel, String[] args) throws Exception
|
||||
public void run(IUser user, String[] args) throws Exception
|
||||
{
|
||||
if (args.length > 0 && user.isAuthorized("essentials.afk.others"))
|
||||
if (args.length > 0 && user.isAuthorized(Permissions.AFK_OTHERS))
|
||||
{
|
||||
IUser afkUser = ess.getUser((Player)ess.getServer().matchPlayer(args[0]));
|
||||
if (afkUser != null)
|
||||
@@ -50,4 +46,10 @@ public class Commandafk extends EssentialsCommand
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PermissionDefault getPermissionDefault()
|
||||
{
|
||||
return PermissionDefault.TRUE;
|
||||
}
|
||||
}
|
||||
|
@@ -3,19 +3,13 @@ package com.earth2me.essentials.commands;
|
||||
import com.earth2me.essentials.Util;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.entity.TNTPrimed;
|
||||
|
||||
|
||||
public class Commandantioch extends EssentialsCommand
|
||||
{
|
||||
public Commandantioch()
|
||||
{
|
||||
super("antioch");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
ess.broadcastMessage(user, "...lobbest thou thy Holy Hand Grenade of Antioch towards thy foe,");
|
||||
ess.broadcastMessage(user, "who being naughty in My sight, shall snuff it.");
|
||||
|
@@ -3,20 +3,14 @@ package com.earth2me.essentials.commands;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.Trade;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import org.bukkit.Server;
|
||||
|
||||
|
||||
public class Commandback extends EssentialsCommand
|
||||
{
|
||||
public Commandback()
|
||||
{
|
||||
super("back");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
protected void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
final Trade charge = new Trade(this.getName(), ess);
|
||||
final Trade charge = new Trade(commandName, ess);
|
||||
charge.isAffordableFor(user);
|
||||
user.sendMessage(_("backUsageMsg"));
|
||||
user.getTeleport().back(charge);
|
||||
|
@@ -1,20 +1,14 @@
|
||||
package com.earth2me.essentials.commands;
|
||||
|
||||
import com.earth2me.essentials.api.IBackup;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import org.bukkit.Server;
|
||||
import com.earth2me.essentials.api.IBackup;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
|
||||
public class Commandbackup extends EssentialsCommand
|
||||
{
|
||||
public Commandbackup()
|
||||
{
|
||||
super("backup");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
protected void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
final IBackup backup = ess.getBackup();
|
||||
backup.run();
|
||||
|
@@ -3,35 +3,30 @@ package com.earth2me.essentials.commands;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.Util;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import org.bukkit.Server;
|
||||
import com.earth2me.essentials.perm.Permissions;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.permissions.PermissionDefault;
|
||||
|
||||
|
||||
public class Commandbalance extends EssentialsCommand
|
||||
{
|
||||
public Commandbalance()
|
||||
{
|
||||
super("balance");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
protected void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
sender.sendMessage(_("balance", Util.formatCurrency(getPlayer(server, args, 0, true).getMoney(), ess)));
|
||||
sender.sendMessage(_("balance", Util.formatCurrency(getPlayer(args, 0, true).getMoney(), ess)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
final double bal = (args.length < 1
|
||||
|| !(user.isAuthorized("essentials.balance.others")
|
||||
|| user.isAuthorized("essentials.balance.other"))
|
||||
|| !user.isAuthorized(Permissions.BALANCE_OTHERS)
|
||||
? user
|
||||
: getPlayer(server, args, 0, true)).getMoney();
|
||||
: getPlayer(args, 0, true)).getMoney();
|
||||
user.sendMessage(_("balance", Util.formatCurrency(bal, ess)));
|
||||
}
|
||||
}
|
||||
|
@@ -1,24 +1,19 @@
|
||||
package com.earth2me.essentials.commands;
|
||||
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.Util;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import com.earth2me.essentials.textreader.ArrayListInput;
|
||||
import com.earth2me.essentials.textreader.TextPager;
|
||||
import java.text.DateFormat;
|
||||
import java.util.*;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
|
||||
public class Commandbalancetop extends EssentialsCommand
|
||||
{
|
||||
public Commandbalancetop()
|
||||
{
|
||||
super("balancetop");
|
||||
}
|
||||
private static final int CACHETIME = 2 * 60 * 1000;
|
||||
public static final int MINUSERS = 50;
|
||||
private static ArrayListInput cache = new ArrayListInput();
|
||||
@@ -26,7 +21,7 @@ public class Commandbalancetop extends EssentialsCommand
|
||||
private static ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
protected void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
int page = 0;
|
||||
boolean force = false;
|
||||
|
@@ -2,31 +2,24 @@ package com.earth2me.essentials.commands;
|
||||
|
||||
import com.earth2me.essentials.Console;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.OfflinePlayer;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import com.earth2me.essentials.user.Ban;
|
||||
import lombok.Cleanup;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
public class Commandban extends EssentialsCommand
|
||||
{
|
||||
public Commandban()
|
||||
{
|
||||
super("ban");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
@Cleanup
|
||||
final IUser user = getPlayer(server, args, 0, true);
|
||||
final IUser user = getPlayer(args, 0, true);
|
||||
if (user.getBase() instanceof OfflinePlayer)
|
||||
{
|
||||
if (sender instanceof Player
|
||||
|
@@ -3,19 +3,13 @@ package com.earth2me.essentials.commands;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import lombok.Cleanup;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
|
||||
public class Commandbanip extends EssentialsCommand
|
||||
{
|
||||
public Commandbanip()
|
||||
{
|
||||
super("banip");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
|
@@ -1,22 +1,16 @@
|
||||
package com.earth2me.essentials.commands;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import com.earth2me.essentials.Util;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.TreeType;
|
||||
|
||||
|
||||
public class Commandbigtree extends EssentialsCommand
|
||||
{
|
||||
public Commandbigtree()
|
||||
{
|
||||
super("bigtree");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
TreeType tree;
|
||||
if (args.length > 0 && args[0].equalsIgnoreCase("redwood"))
|
||||
|
@@ -2,21 +2,15 @@ package com.earth2me.essentials.commands;
|
||||
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
|
||||
|
||||
public class Commandbreak extends EssentialsCommand
|
||||
{
|
||||
public Commandbreak()
|
||||
{
|
||||
super("break");
|
||||
}
|
||||
|
||||
//TODO: Switch to use util class
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
final Block block = user.getTargetBlock(null, 20);
|
||||
if (block == null)
|
||||
|
@@ -1,19 +1,13 @@
|
||||
package com.earth2me.essentials.commands;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
|
||||
public class Commandbroadcast extends EssentialsCommand
|
||||
{
|
||||
public Commandbroadcast()
|
||||
{
|
||||
super("broadcast");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
|
@@ -1,20 +1,14 @@
|
||||
package com.earth2me.essentials.commands;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
public class Commandburn extends EssentialsCommand
|
||||
{
|
||||
public Commandburn()
|
||||
{
|
||||
super("burn");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
protected void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 2)
|
||||
{
|
||||
|
@@ -3,21 +3,15 @@ package com.earth2me.essentials.commands;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import java.util.List;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
public class Commandclearinventory extends EssentialsCommand
|
||||
{
|
||||
public Commandclearinventory()
|
||||
{
|
||||
super("clearinventory");
|
||||
}
|
||||
|
||||
//TODO: Cleanup
|
||||
@Override
|
||||
public void run(Server server, IUser user, String commandLabel, String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length > 0 && user.isAuthorized("essentials.clearinventory.others"))
|
||||
{
|
||||
@@ -59,7 +53,7 @@ public class Commandclearinventory extends EssentialsCommand
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
|
||||
protected void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
|
@@ -2,18 +2,12 @@ package com.earth2me.essentials.commands;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import org.bukkit.Server;
|
||||
|
||||
|
||||
public class Commandcompass extends EssentialsCommand
|
||||
{
|
||||
public Commandcompass()
|
||||
{
|
||||
super("compass");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
final int bearing = (int)(user.getLocation().getYaw() + 180 + 360) % 360;
|
||||
String dir;
|
||||
|
@@ -4,20 +4,14 @@ import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import java.util.Locale;
|
||||
import lombok.Cleanup;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
public class Commanddelhome extends EssentialsCommand
|
||||
{
|
||||
public Commanddelhome()
|
||||
{
|
||||
super("delhome");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
@@ -31,7 +25,7 @@ public class Commanddelhome extends EssentialsCommand
|
||||
|
||||
if (expandedArg.length > 1 && (user == null || user.isAuthorized("essentials.delhome.others")))
|
||||
{
|
||||
user = getPlayer(server, expandedArg, 0, true);
|
||||
user = getPlayer(expandedArg, 0, true);
|
||||
name = expandedArg[1];
|
||||
}
|
||||
else if (user == null)
|
||||
@@ -44,9 +38,7 @@ public class Commanddelhome extends EssentialsCommand
|
||||
}
|
||||
//TODO: Think up a nice error message
|
||||
/*
|
||||
* if (name.equalsIgnoreCase("bed")) {
|
||||
* throw new Exception("You cannot remove the vanilla home point");
|
||||
* }
|
||||
* if (name.equalsIgnoreCase("bed")) { throw new Exception("You cannot remove the vanilla home point"); }
|
||||
*/
|
||||
user.acquireWriteLock();
|
||||
user.getData().removeHome(name.toLowerCase(Locale.ENGLISH));
|
||||
|
@@ -1,19 +1,13 @@
|
||||
package com.earth2me.essentials.commands;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
|
||||
public class Commanddeljail extends EssentialsCommand
|
||||
{
|
||||
public Commanddeljail()
|
||||
{
|
||||
super("deljail");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
protected void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
|
@@ -1,19 +1,13 @@
|
||||
package com.earth2me.essentials.commands;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
|
||||
public class Commanddelwarp extends EssentialsCommand
|
||||
{
|
||||
public Commanddelwarp()
|
||||
{
|
||||
super("delwarp");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
|
@@ -2,18 +2,12 @@ package com.earth2me.essentials.commands;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import org.bukkit.Server;
|
||||
|
||||
|
||||
public class Commanddepth extends EssentialsCommand
|
||||
{
|
||||
public Commanddepth()
|
||||
{
|
||||
super("depth");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
final int depth = user.getLocation().getBlockY() - 63;
|
||||
if (depth > 0)
|
||||
|
@@ -4,20 +4,14 @@ import com.earth2me.essentials.api.ISettings;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import java.util.Locale;
|
||||
import lombok.Cleanup;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
public class Commandeco extends EssentialsCommand
|
||||
{
|
||||
public Commandeco()
|
||||
{
|
||||
super("eco");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 2)
|
||||
{
|
||||
@@ -60,7 +54,7 @@ public class Commandeco extends EssentialsCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
final IUser player = getPlayer(server, args, 1, true);
|
||||
final IUser player = getPlayer(args, 1, true);
|
||||
switch (cmd)
|
||||
{
|
||||
case GIVE:
|
||||
|
@@ -5,21 +5,15 @@ import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import com.earth2me.essentials.Util;
|
||||
import java.util.*;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
|
||||
public class Commandenchant extends EssentialsCommand
|
||||
{
|
||||
public Commandenchant()
|
||||
{
|
||||
super("enchant");
|
||||
}
|
||||
|
||||
//TODO: Implement charge costs: final Trade charge = new Trade("enchant-" + enchantmentName, ess);
|
||||
@Override
|
||||
protected void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
protected void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
final ItemStack stack = user.getItemInHand();
|
||||
if (stack == null)
|
||||
|
@@ -1,13 +1,10 @@
|
||||
package com.earth2me.essentials.commands;
|
||||
|
||||
import com.earth2me.essentials.api.ISettings;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import lombok.Cleanup;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -15,33 +12,31 @@ import org.bukkit.entity.Player;
|
||||
|
||||
public class Commandessentials extends EssentialsCommand
|
||||
{
|
||||
public Commandessentials()
|
||||
{
|
||||
super("essentials");
|
||||
}
|
||||
private transient int taskid;
|
||||
private final transient Map<Player, Block> noteBlocks = new HashMap<Player, Block>();
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length == 0) {
|
||||
run_disabled(server, sender, commandLabel, args);
|
||||
if (args.length == 0)
|
||||
{
|
||||
run_disabled(sender, args);
|
||||
}
|
||||
else if (args[0].equalsIgnoreCase("debug"))
|
||||
{
|
||||
run_debug(server, sender, commandLabel, args);
|
||||
run_debug(sender, args);
|
||||
}
|
||||
else if (args[0].equalsIgnoreCase("nya"))
|
||||
{
|
||||
run_nya(server, sender, commandLabel, args);
|
||||
run_nya(sender, args);
|
||||
}
|
||||
else {
|
||||
run_reload(server, sender, commandLabel, args);
|
||||
else
|
||||
{
|
||||
run_reload(sender, args);
|
||||
}
|
||||
}
|
||||
|
||||
private void run_disabled(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
|
||||
private void run_disabled(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
sender.sendMessage("Essentials " + ess.getDescription().getVersion());
|
||||
sender.sendMessage("/<command> <reload/debug>");
|
||||
@@ -49,27 +44,28 @@ public class Commandessentials extends EssentialsCommand
|
||||
final StringBuilder disabledCommands = new StringBuilder();
|
||||
for (Map.Entry<String, String> entry : ess.getCommandHandler().disabledCommands().entrySet())
|
||||
{
|
||||
if (disabledCommands.length() > 0) {
|
||||
if (disabledCommands.length() > 0)
|
||||
{
|
||||
disabledCommands.append(", ");
|
||||
}
|
||||
disabledCommands.append(entry.getKey()).append(" => ").append(entry.getValue());
|
||||
}
|
||||
sender.sendMessage(disabledCommands.toString());
|
||||
}
|
||||
|
||||
private void run_debug(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
|
||||
private void run_debug(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
ess.getSettings().setDebug(!ess.getSettings().isDebug());
|
||||
sender.sendMessage("Essentials " + ess.getDescription().getVersion() + " debug mode " + (ess.getSettings().isDebug() ? "enabled" : "disabled"));
|
||||
}
|
||||
|
||||
private void run_reload(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
|
||||
private void run_reload(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
ess.reload();
|
||||
sender.sendMessage(_("essentialsReload", ess.getDescription().getVersion()));
|
||||
}
|
||||
|
||||
private void run_nya(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
|
||||
private void run_nya(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
final Map<String, Byte> noteMap = new HashMap<String, Byte>();
|
||||
noteMap.put("1F#", (byte)0x0);
|
||||
@@ -96,56 +92,56 @@ public class Commandessentials extends EssentialsCommand
|
||||
noteMap.put("2D#", (byte)(0x9 + 0xC));
|
||||
noteMap.put("2E", (byte)(0xA + 0xC));
|
||||
noteMap.put("2F", (byte)(0xB + 0xC));
|
||||
if (!noteBlocks.isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
final String tuneStr = "1D#,1E,2F#,,2A#,1E,1D#,1E,2F#,2B,2D#,2E,2D#,2A#,2B,,2F#,,1D#,1E,2F#,2B,2C#,2A#,2B,2C#,2E,2D#,2E,2C#,,2F#,,2G#,,1D,1D#,,1C#,1D,1C#,1B,,1B,,1C#,,1D,,1D,1C#,1B,1C#,1D#,2F#,2G#,1D#,2F#,1C#,1D#,1B,1C#,1B,1D#,,2F#,,2G#,1D#,2F#,1C#,1D#,1B,1D,1D#,1D,1C#,1B,1C#,1D,,1B,1C#,1D#,2F#,1C#,1D,1C#,1B,1C#,,1B,,1C#,,2F#,,2G#,,1D,1D#,,1C#,1D,1C#,1B,,1B,,1C#,,1D,,1D,1C#,1B,1C#,1D#,2F#,2G#,1D#,2F#,1C#,1D#,1B,1C#,1B,1D#,,2F#,,2G#,1D#,2F#,1C#,1D#,1B,1D,1D#,1D,1C#,1B,1C#,1D,,1B,1C#,1D#,2F#,1C#,1D,1C#,1B,1C#,,1B,,1B,,1B,,1F#,1G#,1B,,1F#,1G#,1B,1C#,1D#,1B,1E,1D#,1E,2F#,1B,,1B,,1F#,1G#,1B,1E,1D#,1C#,1B,,,,1F#,1B,,1F#,1G#,1B,,1F#,1G#,1B,1B,1C#,1D#,1B,1F#,1G#,1F#,1B,,1B,1A#,1B,1F#,1G#,1B,1E,1D#,1E,2F#,1B,,1A#,,1B,,1F#,1G#,1B,,1F#,1G#,1B,1C#,1D#,1B,1E,1D#,1E,2F#,1B,,1B,,1F#,1G#,1B,1F#,1E,1D#,1C#,1B,,,,1F#,1B,,1F#,1G#,1B,,1F#,1G#,1B,1B,1C#,1D#,1B,1F#,1G#,1F#,1B,,1B,1A#,1B,1F#,1G#,1B,1E,1D#,1E,2F#,1B,,1A#,,1B,,1F#,1G#,1B,,1F#,1G#,1B,1C#,1D#,1B,1E,1D#,1E,2F#,1B,,1B,,1F#,1G#,1B,1F#,1E,1D#,1C#,1B,,,,1F#,1B,,1F#,1G#,1B,,1F#,1G#,1B,1B,1C#,1D#,1B,1F#,1G#,1F#,1B,,1B,1A#,1B,1F#,1G#,1B,1E,1D#,1E,2F#,1B,,1A#,,1B,,1F#,1G#,1B,,1F#,1G#,1B,1C#,1D#,1B,1E,1D#,1E,2F#,1B,,1B,,1F#,1G#,1B,1F#,1E,1D#,1C#,1B,,,,1F#,1B,,1F#,1G#,1B,,1F#,1G#,1B,1B,1C#,1D#,1B,1F#,1G#,1F#,1B,,1B,1A#,1B,1F#,1G#,1B,1E,1D#,1E,2F#,1B,,1A#,,1B,,1F#,1G#,1B,,1F#,1G#,1B,1C#,1D#,1B,1E,1D#,1E,2F#,1B,,1B,,1F#,1G#,1B,1F#,1E,1D#,1C#,1B,,,,1F#,1B,,1F#,1G#,1B,,1F#,1G#,1B,1B,1C#,1D#,1B,1F#,1G#,1F#,1B,,1B,1A#,1B,1F#,1G#,1B,1E,1D#,1E,2F#,1B,,1B,,";
|
||||
final String[] tune = tuneStr.split(",");
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
final Location loc = player.getLocation();
|
||||
loc.add(0, 3, 0);
|
||||
while (loc.getBlockY() < player.getLocation().getBlockY() + 10 && loc.getBlock().getTypeId() != 0)
|
||||
{
|
||||
loc.add(0, 1, 0);
|
||||
}
|
||||
if (loc.getBlock().getTypeId() == 0)
|
||||
{
|
||||
noteBlocks.put(player, loc.getBlock());
|
||||
loc.getBlock().setType(Material.NOTE_BLOCK);
|
||||
}
|
||||
}
|
||||
taskid = ess.scheduleSyncRepeatingTask(new Runnable()
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
final String note = tune[i];
|
||||
i++;
|
||||
if (i >= tune.length)
|
||||
{
|
||||
Commandessentials.this.stopTune();
|
||||
}
|
||||
if (note.isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
Map<Player, Block> noteBlocks = Commandessentials.this.noteBlocks;
|
||||
for (Player onlinePlayer : server.getOnlinePlayers())
|
||||
{
|
||||
final Block block = noteBlocks.get(onlinePlayer);
|
||||
if (block == null || block.getType() != Material.NOTE_BLOCK)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
onlinePlayer.playNote(block.getLocation(), (byte)0, noteMap.get(note));
|
||||
}
|
||||
}
|
||||
}, 20, 2);
|
||||
if (!noteBlocks.isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
final String tuneStr = "1D#,1E,2F#,,2A#,1E,1D#,1E,2F#,2B,2D#,2E,2D#,2A#,2B,,2F#,,1D#,1E,2F#,2B,2C#,2A#,2B,2C#,2E,2D#,2E,2C#,,2F#,,2G#,,1D,1D#,,1C#,1D,1C#,1B,,1B,,1C#,,1D,,1D,1C#,1B,1C#,1D#,2F#,2G#,1D#,2F#,1C#,1D#,1B,1C#,1B,1D#,,2F#,,2G#,1D#,2F#,1C#,1D#,1B,1D,1D#,1D,1C#,1B,1C#,1D,,1B,1C#,1D#,2F#,1C#,1D,1C#,1B,1C#,,1B,,1C#,,2F#,,2G#,,1D,1D#,,1C#,1D,1C#,1B,,1B,,1C#,,1D,,1D,1C#,1B,1C#,1D#,2F#,2G#,1D#,2F#,1C#,1D#,1B,1C#,1B,1D#,,2F#,,2G#,1D#,2F#,1C#,1D#,1B,1D,1D#,1D,1C#,1B,1C#,1D,,1B,1C#,1D#,2F#,1C#,1D,1C#,1B,1C#,,1B,,1B,,1B,,1F#,1G#,1B,,1F#,1G#,1B,1C#,1D#,1B,1E,1D#,1E,2F#,1B,,1B,,1F#,1G#,1B,1E,1D#,1C#,1B,,,,1F#,1B,,1F#,1G#,1B,,1F#,1G#,1B,1B,1C#,1D#,1B,1F#,1G#,1F#,1B,,1B,1A#,1B,1F#,1G#,1B,1E,1D#,1E,2F#,1B,,1A#,,1B,,1F#,1G#,1B,,1F#,1G#,1B,1C#,1D#,1B,1E,1D#,1E,2F#,1B,,1B,,1F#,1G#,1B,1F#,1E,1D#,1C#,1B,,,,1F#,1B,,1F#,1G#,1B,,1F#,1G#,1B,1B,1C#,1D#,1B,1F#,1G#,1F#,1B,,1B,1A#,1B,1F#,1G#,1B,1E,1D#,1E,2F#,1B,,1A#,,1B,,1F#,1G#,1B,,1F#,1G#,1B,1C#,1D#,1B,1E,1D#,1E,2F#,1B,,1B,,1F#,1G#,1B,1F#,1E,1D#,1C#,1B,,,,1F#,1B,,1F#,1G#,1B,,1F#,1G#,1B,1B,1C#,1D#,1B,1F#,1G#,1F#,1B,,1B,1A#,1B,1F#,1G#,1B,1E,1D#,1E,2F#,1B,,1A#,,1B,,1F#,1G#,1B,,1F#,1G#,1B,1C#,1D#,1B,1E,1D#,1E,2F#,1B,,1B,,1F#,1G#,1B,1F#,1E,1D#,1C#,1B,,,,1F#,1B,,1F#,1G#,1B,,1F#,1G#,1B,1B,1C#,1D#,1B,1F#,1G#,1F#,1B,,1B,1A#,1B,1F#,1G#,1B,1E,1D#,1E,2F#,1B,,1A#,,1B,,1F#,1G#,1B,,1F#,1G#,1B,1C#,1D#,1B,1E,1D#,1E,2F#,1B,,1B,,1F#,1G#,1B,1F#,1E,1D#,1C#,1B,,,,1F#,1B,,1F#,1G#,1B,,1F#,1G#,1B,1B,1C#,1D#,1B,1F#,1G#,1F#,1B,,1B,1A#,1B,1F#,1G#,1B,1E,1D#,1E,2F#,1B,,1B,,";
|
||||
final String[] tune = tuneStr.split(",");
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
final Location loc = player.getLocation();
|
||||
loc.add(0, 3, 0);
|
||||
while (loc.getBlockY() < player.getLocation().getBlockY() + 10 && loc.getBlock().getTypeId() != 0)
|
||||
{
|
||||
loc.add(0, 1, 0);
|
||||
}
|
||||
if (loc.getBlock().getTypeId() == 0)
|
||||
{
|
||||
noteBlocks.put(player, loc.getBlock());
|
||||
loc.getBlock().setType(Material.NOTE_BLOCK);
|
||||
}
|
||||
}
|
||||
taskid = ess.scheduleSyncRepeatingTask(new Runnable()
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
final String note = tune[i];
|
||||
i++;
|
||||
if (i >= tune.length)
|
||||
{
|
||||
Commandessentials.this.stopTune();
|
||||
}
|
||||
if (note.isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
Map<Player, Block> noteBlocks = Commandessentials.this.noteBlocks;
|
||||
for (Player onlinePlayer : server.getOnlinePlayers())
|
||||
{
|
||||
final Block block = noteBlocks.get(onlinePlayer);
|
||||
if (block == null || block.getType() != Material.NOTE_BLOCK)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
onlinePlayer.playNote(block.getLocation(), (byte)0, noteMap.get(note));
|
||||
}
|
||||
}
|
||||
}, 20, 2);
|
||||
return;
|
||||
}
|
||||
|
||||
private void stopTune()
|
||||
|
@@ -2,31 +2,27 @@ package com.earth2me.essentials.commands;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
public class Commandext extends EssentialsCommand
|
||||
{
|
||||
public Commandext()
|
||||
{
|
||||
super("ext");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
protected void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
|
||||
extinguishPlayers(server, sender, args[0]);
|
||||
extinguishPlayers(sender, args[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
@@ -35,10 +31,10 @@ public class Commandext extends EssentialsCommand
|
||||
return;
|
||||
}
|
||||
|
||||
extinguishPlayers(server, user, commandLabel);
|
||||
extinguishPlayers(user, args[0]);
|
||||
}
|
||||
|
||||
private void extinguishPlayers(final Server server, final CommandSender sender, final String name) throws Exception
|
||||
private void extinguishPlayers(final CommandSender sender, final String name) throws Exception
|
||||
{
|
||||
for (Player matchPlayer : server.matchPlayer(name))
|
||||
{
|
||||
|
@@ -3,24 +3,18 @@ package com.earth2me.essentials.commands;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import java.util.List;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
public class Commandfeed extends EssentialsCommand
|
||||
{
|
||||
public Commandfeed()
|
||||
{
|
||||
super("feed");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
protected void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length > 0 && user.isAuthorized("essentials.feed.others"))
|
||||
{
|
||||
feedOtherPlayers(server, user, args[0]);
|
||||
feedOtherPlayers(user, args[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -30,7 +24,7 @@ public class Commandfeed extends EssentialsCommand
|
||||
}
|
||||
}
|
||||
|
||||
private void feedOtherPlayers(final Server server, final CommandSender sender, final String name)
|
||||
private void feedOtherPlayers(final CommandSender sender, final String name)
|
||||
{
|
||||
final List<Player> players = server.matchPlayer(name);
|
||||
if (players.isEmpty())
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package com.earth2me.essentials.commands;
|
||||
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.entity.Fireball;
|
||||
import org.bukkit.entity.SmallFireball;
|
||||
import org.bukkit.util.Vector;
|
||||
@@ -9,13 +8,8 @@ import org.bukkit.util.Vector;
|
||||
|
||||
public class Commandfireball extends EssentialsCommand
|
||||
{
|
||||
public Commandfireball()
|
||||
{
|
||||
super("fireball");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
protected void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
boolean small = false;
|
||||
if (args.length > 0 && args[0].equalsIgnoreCase("small"))
|
||||
|
@@ -4,35 +4,29 @@ import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import java.util.Locale;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
public class Commandgamemode extends EssentialsCommand
|
||||
{
|
||||
public Commandgamemode()
|
||||
{
|
||||
super("gamemode");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
protected void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
|
||||
gamemodeOtherPlayers(server, sender, args[0]);
|
||||
gamemodeOtherPlayers(sender, args[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
protected void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length > 0 && !args[0].trim().isEmpty() && user.isAuthorized("essentials.gamemode.others"))
|
||||
{
|
||||
gamemodeOtherPlayers(server, user, args[0]);
|
||||
gamemodeOtherPlayers(user, args[0]);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -40,7 +34,7 @@ public class Commandgamemode extends EssentialsCommand
|
||||
user.sendMessage(_("gameMode", _(user.getGameMode().toString().toLowerCase(Locale.ENGLISH)), user.getDisplayName()));
|
||||
}
|
||||
|
||||
private void gamemodeOtherPlayers(final Server server, final CommandSender sender, final String name)
|
||||
private void gamemodeOtherPlayers(final CommandSender sender, final String name)
|
||||
{
|
||||
for (Player matchPlayer : server.matchPlayer(name))
|
||||
{
|
||||
|
@@ -1,20 +1,14 @@
|
||||
package com.earth2me.essentials.commands;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
|
||||
public class Commandgc extends EssentialsCommand
|
||||
{
|
||||
public Commandgc()
|
||||
{
|
||||
super("gc");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
protected void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
sender.sendMessage(_("gcmax", (Runtime.getRuntime().maxMemory() / 1024 / 1024)));
|
||||
sender.sendMessage(_("gctotal", (Runtime.getRuntime().totalMemory() / 1024 / 1024)));
|
||||
|
@@ -2,23 +2,17 @@ package com.earth2me.essentials.commands;
|
||||
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
|
||||
public class Commandgetpos extends EssentialsCommand
|
||||
{
|
||||
public Commandgetpos()
|
||||
{
|
||||
super("getpos");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length > 0 && user.isAuthorized("essentials.getpos.others"))
|
||||
{
|
||||
final IUser otherUser = getPlayer(server, args, 0);
|
||||
final IUser otherUser = getPlayer(args, 0);
|
||||
outputPosition(user, otherUser.getLocation(), user.getLocation());
|
||||
}
|
||||
else
|
||||
@@ -26,18 +20,18 @@ public class Commandgetpos extends EssentialsCommand
|
||||
outputPosition(user, user.getLocation(), null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
protected void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
final IUser user = getPlayer(server, args, 0);
|
||||
final IUser user = getPlayer(args, 0);
|
||||
outputPosition(sender, user.getLocation(), null);
|
||||
}
|
||||
|
||||
|
||||
//TODO: Translate
|
||||
private void outputPosition(final CommandSender sender, final Location coords, final Location distance)
|
||||
{
|
||||
|
@@ -6,7 +6,6 @@ import com.earth2me.essentials.craftbukkit.InventoryWorkaround;
|
||||
import java.util.Locale;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -15,14 +14,9 @@ import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class Commandgive extends EssentialsCommand
|
||||
{
|
||||
public Commandgive()
|
||||
{
|
||||
super("give");
|
||||
}
|
||||
|
||||
//TODO: move these messages to message file
|
||||
@Override
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 2)
|
||||
{
|
||||
@@ -39,7 +33,7 @@ public class Commandgive extends EssentialsCommand
|
||||
throw new Exception(ChatColor.RED + "You are not allowed to spawn the item " + itemname);
|
||||
}
|
||||
|
||||
final IUser giveTo = getPlayer(server, args, 0);
|
||||
final IUser giveTo = getPlayer(args, 0);
|
||||
|
||||
int defaultStackSize = 0;
|
||||
int oversizedStackSize = 0;
|
||||
|
@@ -2,42 +2,36 @@ package com.earth2me.essentials.commands;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
public class Commandgod extends EssentialsCommand
|
||||
{
|
||||
public Commandgod()
|
||||
{
|
||||
super("god");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
protected void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
|
||||
godOtherPlayers(server, sender, args[0]);
|
||||
godOtherPlayers(sender, args[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
protected void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length > 0 && !args[0].trim().isEmpty() && user.isAuthorized("essentials.god.others"))
|
||||
{
|
||||
godOtherPlayers(server, user, args[0]);
|
||||
godOtherPlayers(user, args[0]);
|
||||
return;
|
||||
}
|
||||
|
||||
user.sendMessage(_("godMode", (user.toggleGodModeEnabled() ? _("enabled") : _("disabled"))));
|
||||
}
|
||||
|
||||
private void godOtherPlayers(final Server server, final CommandSender sender, final String name)
|
||||
private void godOtherPlayers(final CommandSender sender, final String name)
|
||||
{
|
||||
for (Player matchPlayer : server.matchPlayer(name))
|
||||
{
|
||||
|
@@ -4,27 +4,21 @@ import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import com.earth2me.essentials.user.UserData.TimestampType;
|
||||
import java.util.List;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
public class Commandheal extends EssentialsCommand
|
||||
{
|
||||
public Commandheal()
|
||||
{
|
||||
super("heal");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
|
||||
|
||||
if (args.length > 0 && user.isAuthorized("essentials.heal.others"))
|
||||
{
|
||||
user.checkCooldown(TimestampType.LASTHEAL, ess.getGroups().getHealCooldown(user), true, "essentials.heal.cooldown.bypass");
|
||||
|
||||
healOtherPlayers(server, user, args[0]);
|
||||
healOtherPlayers(user, args[0]);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -36,17 +30,17 @@ public class Commandheal extends EssentialsCommand
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
|
||||
healOtherPlayers(server, sender, args[0]);
|
||||
healOtherPlayers(sender, args[0]);
|
||||
}
|
||||
|
||||
private void healOtherPlayers(final Server server, final CommandSender sender, final String name)
|
||||
private void healOtherPlayers(final CommandSender sender, final String name)
|
||||
{
|
||||
final List<Player> players = server.matchPlayer(name);
|
||||
if (players.isEmpty())
|
||||
|
@@ -4,19 +4,13 @@ import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import com.earth2me.essentials.Util;
|
||||
import com.earth2me.essentials.textreader.*;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
|
||||
public class Commandhelp extends EssentialsCommand
|
||||
{
|
||||
public Commandhelp()
|
||||
{
|
||||
super("help");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
protected void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
IText output;
|
||||
String pageStr = args.length > 0 ? args[0] : null;
|
||||
@@ -45,7 +39,7 @@ public class Commandhelp extends EssentialsCommand
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
protected void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
sender.sendMessage(_("helpConsole"));
|
||||
}
|
||||
|
@@ -3,19 +3,13 @@ package com.earth2me.essentials.commands;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import java.util.logging.Level;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
public class Commandhelpop extends EssentialsCommand
|
||||
{
|
||||
public Commandhelpop()
|
||||
{
|
||||
super("helpop");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
|
@@ -2,27 +2,20 @@ package com.earth2me.essentials.commands;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.Trade;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import com.earth2me.essentials.Util;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import lombok.Cleanup;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
|
||||
public class Commandhome extends EssentialsCommand
|
||||
{
|
||||
public Commandhome()
|
||||
{
|
||||
super("home");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
final Trade charge = new Trade(this.getName(), ess);
|
||||
final Trade charge = new Trade(commandName, ess);
|
||||
charge.isAffordableFor(user);
|
||||
IUser player = user;
|
||||
String homeName = "";
|
||||
@@ -36,7 +29,7 @@ public class Commandhome extends EssentialsCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
player = getPlayer(server, nameParts, 0, true);
|
||||
player = getPlayer(nameParts, 0, true);
|
||||
if (nameParts.length > 1)
|
||||
{
|
||||
homeName = nameParts[1];
|
||||
|
@@ -2,18 +2,12 @@ package com.earth2me.essentials.commands;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import org.bukkit.Server;
|
||||
|
||||
|
||||
public class Commandignore extends EssentialsCommand
|
||||
{
|
||||
public Commandignore()
|
||||
{
|
||||
super("ignore");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
protected void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
@@ -22,7 +16,7 @@ public class Commandignore extends EssentialsCommand
|
||||
IUser player;
|
||||
try
|
||||
{
|
||||
player = getPlayer(server, args, 0);
|
||||
player = getPlayer(args, 0);
|
||||
}
|
||||
catch (NoSuchFieldException ex)
|
||||
{
|
||||
|
@@ -4,19 +4,13 @@ import com.earth2me.essentials.textreader.IText;
|
||||
import com.earth2me.essentials.textreader.KeywordReplacer;
|
||||
import com.earth2me.essentials.textreader.TextInput;
|
||||
import com.earth2me.essentials.textreader.TextPager;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
|
||||
public class Commandinfo extends EssentialsCommand
|
||||
{
|
||||
public Commandinfo()
|
||||
{
|
||||
super("info");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
protected void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
final IText input = new TextInput(sender, "info", true, ess);
|
||||
final IText output = new KeywordReplacer(input, sender, ess);
|
||||
|
@@ -4,19 +4,13 @@ import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import com.earth2me.essentials.user.Inventory;
|
||||
import java.util.Arrays;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
|
||||
public class Commandinvsee extends EssentialsCommand
|
||||
{
|
||||
public Commandinvsee()
|
||||
{
|
||||
super("invsee");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
protected void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
|
||||
if (args.length < 1 && user.getData().getInventory() == null)
|
||||
@@ -26,7 +20,7 @@ public class Commandinvsee extends EssentialsCommand
|
||||
IUser invUser = user;
|
||||
if (args.length == 1)
|
||||
{
|
||||
invUser = getPlayer(server, args, 0);
|
||||
invUser = getPlayer(args, 0);
|
||||
}
|
||||
user.acquireWriteLock();
|
||||
if (invUser == user && user.getData().getInventory() != null)
|
||||
|
@@ -6,20 +6,14 @@ import com.earth2me.essentials.api.IUser;
|
||||
import com.earth2me.essentials.craftbukkit.InventoryWorkaround;
|
||||
import java.util.Locale;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
|
||||
public class Commanditem extends EssentialsCommand
|
||||
{
|
||||
public Commanditem()
|
||||
{
|
||||
super("item");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
@@ -29,7 +23,7 @@ public class Commanditem extends EssentialsCommand
|
||||
|
||||
final String itemname = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", "");
|
||||
if (!user.isAuthorized("essentials.itemspawn.item-" + itemname)
|
||||
&& !user.isAuthorized("essentials.itemspawn.item-" + stack.getTypeId()))
|
||||
&& !user.isAuthorized("essentials.itemspawn.item-" + stack.getTypeId()))
|
||||
{
|
||||
throw new Exception(_("cantSpawnItem", itemname));
|
||||
}
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package com.earth2me.essentials.commands;
|
||||
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
@@ -8,13 +7,8 @@ import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class Commanditemdb extends EssentialsCommand
|
||||
{
|
||||
public Commanditemdb()
|
||||
{
|
||||
super("find");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
|
||||
protected void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
ItemStack itemStack = null;
|
||||
if (args.length < 1)
|
||||
|
@@ -1,19 +1,13 @@
|
||||
package com.earth2me.essentials.commands;
|
||||
|
||||
import com.earth2me.essentials.Util;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
|
||||
public class Commandjails extends EssentialsCommand
|
||||
{
|
||||
public Commandjails()
|
||||
{
|
||||
super("jails");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
protected void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
sender.sendMessage("§7" + Util.joinList(" ", ess.getJails().getList()));
|
||||
}
|
||||
|
@@ -5,19 +5,13 @@ import com.earth2me.essentials.Trade;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import com.earth2me.essentials.Util;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
|
||||
public class Commandjump extends EssentialsCommand
|
||||
{
|
||||
public Commandjump()
|
||||
{
|
||||
super("jump");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
Location loc;
|
||||
final Location cloc = user.getLocation();
|
||||
@@ -34,7 +28,7 @@ public class Commandjump extends EssentialsCommand
|
||||
throw new Exception(_("jumpError"), ex);
|
||||
}
|
||||
|
||||
final Trade charge = new Trade(this.getName(), ess);
|
||||
final Trade charge = new Trade(commandName, ess);
|
||||
charge.isAffordableFor(user);
|
||||
user.getTeleport().teleport(loc, charge, TeleportCause.COMMAND);
|
||||
}
|
||||
|
@@ -3,27 +3,21 @@ package com.earth2me.essentials.commands;
|
||||
import com.earth2me.essentials.Console;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
public class Commandkick extends EssentialsCommand
|
||||
{
|
||||
public Commandkick()
|
||||
{
|
||||
super("kick");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
|
||||
final IUser user = getPlayer(server, args, 0);
|
||||
final IUser user = getPlayer(args, 0);
|
||||
if (user.isAuthorized("essentials.kick.exempt"))
|
||||
{
|
||||
throw new Exception(_("kickExempt"));
|
||||
|
@@ -1,20 +1,14 @@
|
||||
package com.earth2me.essentials.commands;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
public class Commandkickall extends EssentialsCommand
|
||||
{
|
||||
public Commandkickall()
|
||||
{
|
||||
super("kickall");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
for (Player onlinePlayer : server.getOnlinePlayers())
|
||||
{
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package com.earth2me.essentials.commands;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
@@ -9,13 +8,8 @@ import org.bukkit.event.entity.EntityDamageEvent;
|
||||
|
||||
public class Commandkill extends EssentialsCommand
|
||||
{
|
||||
public Commandkill()
|
||||
{
|
||||
super("kill");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
|
@@ -5,7 +5,6 @@ import static com.earth2me.essentials.I18n._;
|
||||
import java.util.Collections;
|
||||
import java.util.Locale;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Animals;
|
||||
@@ -26,14 +25,9 @@ import org.bukkit.event.entity.EntityDeathEvent;
|
||||
|
||||
public class Commandkillall extends EssentialsCommand
|
||||
{
|
||||
public Commandkillall()
|
||||
{
|
||||
super("killall");
|
||||
}
|
||||
|
||||
//TODO: Tidy - missed this during command cleanup
|
||||
@Override
|
||||
public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
|
||||
public void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
String type = "all";
|
||||
int radius = -1;
|
||||
|
@@ -1,21 +1,18 @@
|
||||
package com.earth2me.essentials.commands;
|
||||
|
||||
import com.earth2me.essentials.*;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import java.util.*;
|
||||
import org.bukkit.Server;
|
||||
import com.earth2me.essentials.Kit;
|
||||
import com.earth2me.essentials.Trade;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public class Commandkit extends EssentialsCommand
|
||||
{
|
||||
public Commandkit()
|
||||
{
|
||||
super("kit");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
@@ -48,7 +45,7 @@ public class Commandkit extends EssentialsCommand
|
||||
charge.isAffordableFor(user);
|
||||
|
||||
Kit.expandItems(ess, user, items);
|
||||
|
||||
|
||||
charge.charge(user);
|
||||
user.sendMessage(_("kitGive", kitName));
|
||||
|
||||
|
@@ -4,7 +4,6 @@ import com.earth2me.essentials.api.ISettings;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import lombok.Cleanup;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.LightningStrike;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -12,13 +11,8 @@ import org.bukkit.entity.Player;
|
||||
|
||||
public class Commandlightning extends EssentialsCommand
|
||||
{
|
||||
public Commandlightning()
|
||||
{
|
||||
super("lightning");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
|
||||
IUser user = null;
|
||||
|
@@ -4,20 +4,14 @@ import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.ISettings;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import java.util.*;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
public class Commandlist extends EssentialsCommand
|
||||
{
|
||||
public Commandlist()
|
||||
{
|
||||
super("list");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
boolean showhidden = false;
|
||||
if (sender instanceof Player)
|
||||
@@ -50,13 +44,16 @@ public class Commandlist extends EssentialsCommand
|
||||
online = _("listAmount", server.getOnlinePlayers().length - playerHidden, server.getMaxPlayers());
|
||||
}
|
||||
sender.sendMessage(online);
|
||||
|
||||
|
||||
boolean sortListByGroups = false;
|
||||
ISettings settings = ess.getSettings();
|
||||
settings.acquireReadLock();
|
||||
try {
|
||||
try
|
||||
{
|
||||
sortListByGroups = settings.getData().getCommands().getList().isSortByGroups();
|
||||
} finally {
|
||||
}
|
||||
finally
|
||||
{
|
||||
settings.unlock();
|
||||
}
|
||||
|
||||
|
@@ -3,21 +3,15 @@ package com.earth2me.essentials.commands;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import java.util.List;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
public class Commandmail extends EssentialsCommand
|
||||
{
|
||||
public Commandmail()
|
||||
{
|
||||
super("mail");
|
||||
}
|
||||
|
||||
//TODO: Tidy this up
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length >= 1 && "read".equalsIgnoreCase(args[0]))
|
||||
{
|
||||
@@ -38,7 +32,7 @@ public class Commandmail extends EssentialsCommand
|
||||
{
|
||||
if (!user.isAuthorized("essentials.mail.send"))
|
||||
{
|
||||
throw new Exception(_("noPerm","essentials.mail.send"));
|
||||
throw new Exception(_("noPerm", "essentials.mail.send"));
|
||||
}
|
||||
|
||||
Player player = server.getPlayer(args[1]);
|
||||
@@ -66,7 +60,7 @@ public class Commandmail extends EssentialsCommand
|
||||
{
|
||||
if (!user.isAuthorized("essentials.mail.sendall"))
|
||||
{
|
||||
throw new Exception(_("noPerm","essentials.mail.sendall"));
|
||||
throw new Exception(_("noPerm", "essentials.mail.sendall"));
|
||||
}
|
||||
ess.scheduleAsyncDelayedTask(new SendAll(user.getName() + ": " + getFinalArg(args, 1)));
|
||||
user.sendMessage(_("mailSent"));
|
||||
@@ -83,15 +77,15 @@ public class Commandmail extends EssentialsCommand
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
|
||||
protected void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length >= 1 && "read".equalsIgnoreCase(args[0]))
|
||||
{
|
||||
throw new Exception(_("onlyPlayers", commandLabel + " read"));
|
||||
throw new Exception(_("onlyPlayers", commandName + " read"));
|
||||
}
|
||||
else if (args.length >= 1 && "clear".equalsIgnoreCase(args[0]))
|
||||
{
|
||||
throw new Exception(_("onlyPlayers", commandLabel + " clear"));
|
||||
throw new Exception(_("onlyPlayers", commandName + " clear"));
|
||||
}
|
||||
else if (args.length >= 3 && "send".equalsIgnoreCase(args[0]))
|
||||
{
|
||||
|
@@ -2,18 +2,12 @@ package com.earth2me.essentials.commands;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import org.bukkit.Server;
|
||||
|
||||
|
||||
public class Commandme extends EssentialsCommand
|
||||
{
|
||||
public Commandme()
|
||||
{
|
||||
super("me");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
if (user.getData().isMuted())
|
||||
{
|
||||
|
@@ -4,19 +4,13 @@ import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.ISettings;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import java.util.Locale;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
|
||||
public class Commandmore extends EssentialsCommand
|
||||
{
|
||||
public Commandmore()
|
||||
{
|
||||
super("more");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
final ItemStack stack = user.getItemInHand();
|
||||
if (stack == null)
|
||||
|
@@ -4,19 +4,13 @@ import com.earth2me.essentials.textreader.IText;
|
||||
import com.earth2me.essentials.textreader.KeywordReplacer;
|
||||
import com.earth2me.essentials.textreader.TextInput;
|
||||
import com.earth2me.essentials.textreader.TextPager;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
|
||||
public class Commandmotd extends EssentialsCommand
|
||||
{
|
||||
public Commandmotd()
|
||||
{
|
||||
super("motd");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
final IText input = new TextInput(sender, "motd", true, ess);
|
||||
final IText output = new KeywordReplacer(input, sender, ess);
|
||||
|
@@ -6,20 +6,14 @@ import com.earth2me.essentials.api.IReplyTo;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import java.util.List;
|
||||
import lombok.Cleanup;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
public class Commandmsg extends EssentialsCommand
|
||||
{
|
||||
public Commandmsg()
|
||||
{
|
||||
super("msg");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, String[] args) throws Exception
|
||||
public void run(final CommandSender sender, String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 2 || args[0].trim().isEmpty() || args[1].trim().isEmpty())
|
||||
{
|
||||
|
@@ -5,19 +5,13 @@ import com.earth2me.essentials.api.IUser;
|
||||
import com.earth2me.essentials.Util;
|
||||
import com.earth2me.essentials.user.UserData.TimestampType;
|
||||
import lombok.Cleanup;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
|
||||
public class Commandmute extends EssentialsCommand
|
||||
{
|
||||
public Commandmute()
|
||||
{
|
||||
super("mute");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
@@ -25,7 +19,7 @@ public class Commandmute extends EssentialsCommand
|
||||
}
|
||||
|
||||
@Cleanup
|
||||
final IUser player = getPlayer(server, args, 0, true);
|
||||
final IUser player = getPlayer(args, 0, true);
|
||||
player.acquireReadLock();
|
||||
if (!player.getData().isMuted() && player.isAuthorized("essentials.mute.exempt"))
|
||||
{
|
||||
|
@@ -3,7 +3,6 @@ package com.earth2me.essentials.commands;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -11,22 +10,17 @@ import org.bukkit.entity.Player;
|
||||
|
||||
public class Commandnear extends EssentialsCommand
|
||||
{
|
||||
public Commandnear()
|
||||
{
|
||||
super("near");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
protected void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
long radius = 200;
|
||||
IUser otherUser = null;
|
||||
|
||||
|
||||
if (args.length > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
otherUser = getPlayer(server, args, 0);
|
||||
otherUser = getPlayer(args, 0);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -51,22 +45,22 @@ public class Commandnear extends EssentialsCommand
|
||||
}
|
||||
if (otherUser == null || user.isAuthorized("essentials.near.others"))
|
||||
{
|
||||
user.sendMessage(_("nearbyPlayers", getLocal(server, otherUser == null ? user : otherUser, radius)));
|
||||
user.sendMessage(_("nearbyPlayers", getLocal(otherUser == null ? user : otherUser, radius)));
|
||||
}
|
||||
else
|
||||
{
|
||||
user.sendMessage(_("noAccessCommand"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
protected void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
|
||||
|
||||
IUser otherUser = null;
|
||||
if (args.length > 0)
|
||||
{
|
||||
otherUser = getPlayer(server, args, 0);
|
||||
otherUser = getPlayer(args, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -83,16 +77,16 @@ public class Commandnear extends EssentialsCommand
|
||||
{
|
||||
}
|
||||
}
|
||||
sender.sendMessage(_("nearbyPlayers", getLocal(server, otherUser, radius)));
|
||||
sender.sendMessage(_("nearbyPlayers", getLocal(otherUser, radius)));
|
||||
}
|
||||
|
||||
private String getLocal(final Server server, final IUser user, final long radius)
|
||||
|
||||
private String getLocal(final IUser user, final long radius)
|
||||
{
|
||||
final Location loc = user.getLocation();
|
||||
final World world = loc.getWorld();
|
||||
final StringBuilder output = new StringBuilder();
|
||||
final long radiusSquared = radius * radius;
|
||||
|
||||
|
||||
for (Player onlinePlayer : server.getOnlinePlayers())
|
||||
{
|
||||
final IUser player = ess.getUser(onlinePlayer);
|
||||
@@ -103,7 +97,7 @@ public class Commandnear extends EssentialsCommand
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
final long delta = (long)playerLoc.distanceSquared(loc);
|
||||
if (delta < radiusSquared)
|
||||
{
|
||||
|
@@ -12,13 +12,8 @@ import org.bukkit.entity.Player;
|
||||
|
||||
public class Commandnick extends EssentialsCommand
|
||||
{
|
||||
public Commandnick()
|
||||
{
|
||||
super("nick");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
@@ -37,15 +32,15 @@ public class Commandnick extends EssentialsCommand
|
||||
{
|
||||
throw new Exception(_("nickOthersPermission"));
|
||||
}
|
||||
setNickname(server, getPlayer(server, args, 0), formatNickname(user, args[1]));
|
||||
setNickname(getPlayer(args, 0), formatNickname(user, args[1]));
|
||||
user.sendMessage(_("nickChanged"));
|
||||
return;
|
||||
}
|
||||
setNickname(server, user, formatNickname(user, args[0]));
|
||||
setNickname(user, formatNickname(user, args[0]));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 2)
|
||||
{
|
||||
@@ -64,7 +59,7 @@ public class Commandnick extends EssentialsCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
setNickname(server, getPlayer(server, args, 0), formatNickname(null, args[1]));
|
||||
setNickname(getPlayer(args, 0), formatNickname(null, args[1]));
|
||||
}
|
||||
sender.sendMessage(_("nickChanged"));
|
||||
}
|
||||
@@ -84,7 +79,7 @@ public class Commandnick extends EssentialsCommand
|
||||
{
|
||||
try
|
||||
{
|
||||
setNickname(server, ess.getUser(player), "off");
|
||||
setNickname(ess.getUser(player), "off");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -92,7 +87,7 @@ public class Commandnick extends EssentialsCommand
|
||||
}
|
||||
}
|
||||
|
||||
private void setNickname(final Server server, final IUser target, final String nick) throws Exception
|
||||
private void setNickname(final IUser target, final String nick) throws Exception
|
||||
{
|
||||
if (nick.matches("[^a-zA-Z_0-9]"))
|
||||
{
|
||||
|
@@ -4,7 +4,6 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -13,13 +12,8 @@ import org.bukkit.entity.TNTPrimed;
|
||||
|
||||
public class Commandnuke extends EssentialsCommand
|
||||
{
|
||||
public Commandnuke()
|
||||
{
|
||||
super("nuke");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws NoSuchFieldException, NotEnoughArgumentsException
|
||||
protected void run(final CommandSender sender, final String[] args) throws NoSuchFieldException, NotEnoughArgumentsException
|
||||
{
|
||||
List<Player> targets;
|
||||
if (args.length > 0)
|
||||
@@ -28,7 +22,7 @@ public class Commandnuke extends EssentialsCommand
|
||||
int pos = 0;
|
||||
for (String arg : args)
|
||||
{
|
||||
targets.add(getPlayer(server, args, pos));
|
||||
targets.add(getPlayer(args, pos));
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
|
@@ -3,25 +3,19 @@ package com.earth2me.essentials.commands;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.Trade;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
public class Commandpay extends EssentialsCommand
|
||||
{
|
||||
public Commandpay()
|
||||
{
|
||||
super("pay");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 2)
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
|
||||
|
||||
if (args[0] == "")
|
||||
{
|
||||
throw new NotEnoughArgumentsException("You need to specify a player to pay.");
|
||||
|
@@ -2,18 +2,12 @@ package com.earth2me.essentials.commands;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import org.bukkit.Server;
|
||||
|
||||
|
||||
public class Commandping extends EssentialsCommand
|
||||
{
|
||||
public Commandping()
|
||||
{
|
||||
super("ping");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser player, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser player, final String[] args) throws Exception
|
||||
{
|
||||
player.sendMessage(_("pong"));
|
||||
}
|
||||
|
@@ -7,19 +7,13 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
|
||||
public class Commandpowertool extends EssentialsCommand
|
||||
{
|
||||
public Commandpowertool()
|
||||
{
|
||||
super("powertool");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
protected void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
String command = getFinalArg(args, 0);
|
||||
|
||||
|
@@ -2,18 +2,12 @@ package com.earth2me.essentials.commands;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import org.bukkit.Server;
|
||||
|
||||
|
||||
public class Commandpowertooltoggle extends EssentialsCommand
|
||||
{
|
||||
public Commandpowertooltoggle()
|
||||
{
|
||||
super("powertooltoggle");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
protected void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
if (!user.getData().hasPowerTools())
|
||||
{
|
||||
|
@@ -4,7 +4,6 @@ import com.earth2me.essentials.DescParseTickFormat;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import java.util.*;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -22,13 +21,8 @@ public class Commandptime extends EssentialsCommand
|
||||
getAliases.add("display");
|
||||
}
|
||||
|
||||
public Commandptime()
|
||||
{
|
||||
super("ptime");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
// Which Players(s) / Users(s) are we interested in?
|
||||
String userSelector = null;
|
||||
@@ -36,7 +30,7 @@ public class Commandptime extends EssentialsCommand
|
||||
{
|
||||
userSelector = args[1];
|
||||
}
|
||||
Set<IUser> users = getUsers(server, sender, userSelector);
|
||||
Set<IUser> users = getUsers(sender, userSelector);
|
||||
|
||||
// If no arguments we are reading the time
|
||||
if (args.length == 0)
|
||||
@@ -181,7 +175,7 @@ public class Commandptime extends EssentialsCommand
|
||||
/**
|
||||
* Used to parse an argument of the type "users(s) selector"
|
||||
*/
|
||||
private Set<IUser> getUsers(final Server server, final CommandSender sender, final String selector) throws Exception
|
||||
private Set<IUser> getUsers(final CommandSender sender, final String selector) throws Exception
|
||||
{
|
||||
final Set<IUser> users = new TreeSet<IUser>();
|
||||
// If there is no selector we want the sender itself. Or all users if sender isn't a user.
|
||||
|
@@ -4,20 +4,14 @@ import com.earth2me.essentials.Console;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IReplyTo;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
public class Commandr extends EssentialsCommand
|
||||
{
|
||||
public Commandr()
|
||||
{
|
||||
super("r");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
@@ -58,4 +52,10 @@ public class Commandr extends EssentialsCommand
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPermission()
|
||||
{
|
||||
return "essentials.msg";
|
||||
}
|
||||
}
|
||||
|
@@ -4,20 +4,14 @@ import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import com.earth2me.essentials.Util;
|
||||
import java.util.Locale;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
public class Commandrealname extends EssentialsCommand
|
||||
{
|
||||
public Commandrealname()
|
||||
{
|
||||
super("realname");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
protected void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
|
@@ -4,7 +4,6 @@ import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import java.util.Locale;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.*;
|
||||
@@ -12,12 +11,6 @@ import org.bukkit.entity.*;
|
||||
|
||||
public class Commandremove extends EssentialsCommand
|
||||
{
|
||||
public Commandremove()
|
||||
{
|
||||
super("remove");
|
||||
}
|
||||
|
||||
|
||||
private enum ToRemove
|
||||
{
|
||||
DROPS,
|
||||
@@ -29,7 +22,7 @@ public class Commandremove extends EssentialsCommand
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
protected void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
@@ -64,7 +57,7 @@ public class Commandremove extends EssentialsCommand
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
protected void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 2)
|
||||
{
|
||||
@@ -92,8 +85,9 @@ public class Commandremove extends EssentialsCommand
|
||||
protected void removeEntities(final CommandSender sender, final World world, final ToRemove toRemove, int radius) throws Exception
|
||||
{
|
||||
int removed = 0;
|
||||
if (radius > 0) {
|
||||
radius*=radius;
|
||||
if (radius > 0)
|
||||
{
|
||||
radius *= radius;
|
||||
}
|
||||
for (Chunk chunk : world.getLoadedChunks())
|
||||
{
|
||||
|
@@ -7,19 +7,13 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
|
||||
public class Commandrepair extends EssentialsCommand
|
||||
{
|
||||
public Commandrepair()
|
||||
{
|
||||
super("repair");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
|
@@ -4,19 +4,13 @@ import com.earth2me.essentials.textreader.IText;
|
||||
import com.earth2me.essentials.textreader.KeywordReplacer;
|
||||
import com.earth2me.essentials.textreader.TextInput;
|
||||
import com.earth2me.essentials.textreader.TextPager;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
|
||||
public class Commandrules extends EssentialsCommand
|
||||
{
|
||||
public Commandrules()
|
||||
{
|
||||
super("rules");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
final IText input = new TextInput(sender, "rules", true, ess);
|
||||
final IText output = new KeywordReplacer(input, sender, ess);
|
||||
|
@@ -4,19 +4,13 @@ import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import com.earth2me.essentials.Util;
|
||||
import com.earth2me.essentials.user.UserData.TimestampType;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
|
||||
public class Commandseen extends EssentialsCommand
|
||||
{
|
||||
public Commandseen()
|
||||
{
|
||||
super("seen");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
protected void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
@@ -24,7 +18,7 @@ public class Commandseen extends EssentialsCommand
|
||||
}
|
||||
try
|
||||
{
|
||||
IUser u = getPlayer(server, args, 0);
|
||||
IUser u = getPlayer(args, 0);
|
||||
sender.sendMessage(_("seenOnline", u.getDisplayName(), Util.formatDateDiff(u.getTimestamp(TimestampType.LOGIN))));
|
||||
}
|
||||
catch (NoSuchFieldException e)
|
||||
|
@@ -8,19 +8,13 @@ import com.earth2me.essentials.craftbukkit.InventoryWorkaround;
|
||||
import java.util.Locale;
|
||||
import java.util.logging.Level;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
|
||||
public class Commandsell extends EssentialsCommand
|
||||
{
|
||||
public Commandsell()
|
||||
{
|
||||
super("sell");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
|
@@ -6,18 +6,12 @@ import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import lombok.Cleanup;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Server;
|
||||
|
||||
|
||||
public class Commandsethome extends EssentialsCommand
|
||||
{
|
||||
public Commandsethome()
|
||||
{
|
||||
super("sethome");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, String[] args) throws Exception
|
||||
public void run(final IUser user, String[] args) throws Exception
|
||||
{
|
||||
if (args.length > 0)
|
||||
{
|
||||
|
@@ -2,18 +2,12 @@ package com.earth2me.essentials.commands;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import org.bukkit.Server;
|
||||
|
||||
|
||||
public class Commandsetjail extends EssentialsCommand
|
||||
{
|
||||
public Commandsetjail()
|
||||
{
|
||||
super("setjail");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
|
@@ -3,25 +3,20 @@ package com.earth2me.essentials.commands;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Server;
|
||||
|
||||
|
||||
public class Commandsetwarp extends EssentialsCommand
|
||||
{
|
||||
public Commandsetwarp()
|
||||
{
|
||||
super("setwarp");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
|
||||
if (args[0].matches("[0-9]+")) {
|
||||
|
||||
if (args[0].matches("[0-9]+"))
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
|
||||
|
@@ -2,19 +2,13 @@ package com.earth2me.essentials.commands;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
|
||||
public class Commandsetworth extends EssentialsCommand
|
||||
{
|
||||
public Commandsetworth()
|
||||
{
|
||||
super("setworth");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 2)
|
||||
{
|
||||
|
@@ -2,18 +2,12 @@ package com.earth2me.essentials.commands;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import org.bukkit.Server;
|
||||
|
||||
|
||||
public class Commandsocialspy extends EssentialsCommand
|
||||
{
|
||||
public Commandsocialspy()
|
||||
{
|
||||
super("socialspy");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
user.sendMessage("§7SocialSpy " + (user.toggleSocialSpy() ? _("enabled") : _("disabled")));
|
||||
}
|
||||
|
@@ -7,19 +7,13 @@ import com.earth2me.essentials.Util;
|
||||
import java.util.Locale;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.block.CreatureSpawner;
|
||||
|
||||
|
||||
public class Commandspawner extends EssentialsCommand
|
||||
{
|
||||
public Commandspawner()
|
||||
{
|
||||
super("spawner");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
protected void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1 || args[0].length() < 2)
|
||||
{
|
||||
|
@@ -9,20 +9,14 @@ import java.util.Locale;
|
||||
import java.util.Random;
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.*;
|
||||
|
||||
|
||||
public class Commandspawnmob extends EssentialsCommand
|
||||
{
|
||||
public Commandspawnmob()
|
||||
{
|
||||
super("spawnmob");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
@@ -79,7 +73,7 @@ public class Commandspawnmob extends EssentialsCommand
|
||||
IUser otherUser = null;
|
||||
if (args.length >= 3)
|
||||
{
|
||||
otherUser = getPlayer(ess.getServer(), args, 2);
|
||||
otherUser = getPlayer(ess.getServer(), args, 2);
|
||||
}
|
||||
final Location loc = (otherUser == null) ? block.getLocation() : otherUser.getLocation();
|
||||
final Location sloc = Util.getSafeDestination(loc);
|
||||
|
@@ -1,27 +1,21 @@
|
||||
package com.earth2me.essentials.commands;
|
||||
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.PluginCommand;
|
||||
|
||||
|
||||
public class Commandsudo extends EssentialsCommand
|
||||
{
|
||||
public Commandsudo()
|
||||
{
|
||||
super("sudo");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 2)
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
|
||||
final IUser user = getPlayer(server, args, 0, false);
|
||||
final IUser user = getPlayer(args, 0, false);
|
||||
final String command = args[1];
|
||||
final String[] arguments = new String[args.length - 2];
|
||||
if (arguments.length > 0)
|
||||
|
@@ -2,18 +2,12 @@ package com.earth2me.essentials.commands;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import org.bukkit.Server;
|
||||
|
||||
|
||||
public class Commandsuicide extends EssentialsCommand
|
||||
{
|
||||
public Commandsuicide()
|
||||
{
|
||||
super("suicide");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
user.setHealth(0);
|
||||
user.sendMessage(_("suicideMessage"));
|
||||
|
@@ -6,26 +6,21 @@ import com.earth2me.essentials.OfflinePlayer;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import com.earth2me.essentials.Util;
|
||||
import com.earth2me.essentials.user.Ban;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
public class Commandtempban extends EssentialsCommand
|
||||
{
|
||||
public Commandtempban()
|
||||
{
|
||||
super("tempban");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 2)
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
final IUser user = getPlayer(server, args, 0, true);
|
||||
final IUser user = getPlayer(args, 0, true);
|
||||
if (user.getBase() instanceof OfflinePlayer)
|
||||
{
|
||||
if (sender instanceof Player
|
||||
|
@@ -2,19 +2,13 @@ package com.earth2me.essentials.commands;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.World;
|
||||
|
||||
|
||||
public class Commandthunder extends EssentialsCommand
|
||||
{
|
||||
public Commandthunder()
|
||||
{
|
||||
super("thunder");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
|
@@ -4,7 +4,6 @@ import com.earth2me.essentials.DescParseTickFormat;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import java.util.*;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -12,13 +11,8 @@ import org.bukkit.entity.Player;
|
||||
|
||||
public class Commandtime extends EssentialsCommand
|
||||
{
|
||||
public Commandtime()
|
||||
{
|
||||
super("time");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
// Which World(s) are we interested in?
|
||||
String worldSelector = null;
|
||||
@@ -26,7 +20,7 @@ public class Commandtime extends EssentialsCommand
|
||||
{
|
||||
worldSelector = args[1];
|
||||
}
|
||||
final Set<World> worlds = getWorlds(server, sender, worldSelector);
|
||||
final Set<World> worlds = getWorlds(sender, worldSelector);
|
||||
|
||||
// If no arguments we are reading the time
|
||||
if (args.length == 0)
|
||||
@@ -104,7 +98,7 @@ public class Commandtime extends EssentialsCommand
|
||||
/**
|
||||
* Used to parse an argument of the type "world(s) selector"
|
||||
*/
|
||||
private Set<World> getWorlds(final Server server, final CommandSender sender, final String selector) throws Exception
|
||||
private Set<World> getWorlds(final CommandSender sender, final String selector) throws Exception
|
||||
{
|
||||
final Set<World> worlds = new TreeSet<World>(new WorldNameComparator());
|
||||
|
||||
|
@@ -6,20 +6,15 @@ import com.earth2me.essentials.api.IUser;
|
||||
import com.earth2me.essentials.Util;
|
||||
import com.earth2me.essentials.user.UserData.TimestampType;
|
||||
import lombok.Cleanup;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
public class Commandtogglejail extends EssentialsCommand
|
||||
{
|
||||
public Commandtogglejail()
|
||||
{
|
||||
super("togglejail");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
@@ -27,7 +22,7 @@ public class Commandtogglejail extends EssentialsCommand
|
||||
}
|
||||
|
||||
@Cleanup
|
||||
final IUser player = getPlayer(server, args, 0, true);
|
||||
final IUser player = getPlayer(args, 0, true);
|
||||
player.acquireReadLock();
|
||||
|
||||
if (args.length >= 2 && !player.getData().isJailed())
|
||||
|
@@ -4,24 +4,18 @@ import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.Trade;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
|
||||
public class Commandtop extends EssentialsCommand
|
||||
{
|
||||
public Commandtop()
|
||||
{
|
||||
super("top");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
final int topX = user.getLocation().getBlockX();
|
||||
final int topZ = user.getLocation().getBlockZ();
|
||||
final int topY = user.getWorld().getHighestBlockYAt(topX, topZ);
|
||||
user.getTeleport().teleport(new Location(user.getWorld(), user.getLocation().getX(), topY + 1, user.getLocation().getZ()), new Trade(this.getName(), ess), TeleportCause.COMMAND);
|
||||
user.getTeleport().teleport(new Location(user.getWorld(), user.getLocation().getX(), topY + 1, user.getLocation().getZ()), new Trade(commandName, ess), TeleportCause.COMMAND);
|
||||
user.sendMessage(_("teleportTop"));
|
||||
}
|
||||
}
|
||||
|
@@ -5,20 +5,14 @@ import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.Trade;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import lombok.Cleanup;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
|
||||
public class Commandtp extends EssentialsCommand
|
||||
{
|
||||
public Commandtp()
|
||||
{
|
||||
super("tp");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
switch (args.length)
|
||||
{
|
||||
@@ -27,14 +21,14 @@ public class Commandtp extends EssentialsCommand
|
||||
|
||||
case 1:
|
||||
@Cleanup
|
||||
final IUser player = getPlayer(server, args, 0);
|
||||
final IUser player = getPlayer(args, 0);
|
||||
player.acquireReadLock();
|
||||
if (!player.getData().isTeleportEnabled())
|
||||
{
|
||||
throw new Exception(_("teleportDisabled", player.getDisplayName()));
|
||||
}
|
||||
user.sendMessage(_("teleporting"));
|
||||
final Trade charge = new Trade(this.getName(), ess);
|
||||
final Trade charge = new Trade(commandName, ess);
|
||||
charge.isAffordableFor(user);
|
||||
user.getTeleport().teleport(player, charge, TeleportCause.COMMAND);
|
||||
throw new NoChargeException();
|
||||
@@ -46,8 +40,8 @@ public class Commandtp extends EssentialsCommand
|
||||
throw new Exception("You need access to /tpohere to teleport other players.");
|
||||
}
|
||||
user.sendMessage(_("teleporting"));
|
||||
final IUser target = getPlayer(server, args, 0);
|
||||
final IUser toPlayer = getPlayer(server, args, 1);
|
||||
final IUser target = getPlayer(args, 0);
|
||||
final IUser toPlayer = getPlayer(args, 1);
|
||||
target.getTeleport().now(toPlayer, false, TeleportCause.COMMAND);
|
||||
target.sendMessage(_("teleportAtoB", user.getDisplayName(), toPlayer.getDisplayName()));
|
||||
break;
|
||||
@@ -55,7 +49,7 @@ public class Commandtp extends EssentialsCommand
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 2)
|
||||
{
|
||||
@@ -63,8 +57,8 @@ public class Commandtp extends EssentialsCommand
|
||||
}
|
||||
|
||||
sender.sendMessage(_("teleporting"));
|
||||
final IUser target = getPlayer(server, args, 0);
|
||||
final IUser toPlayer = getPlayer(server, args, 1);
|
||||
final IUser target = getPlayer(args, 0);
|
||||
final IUser toPlayer = getPlayer(args, 1);
|
||||
target.getTeleport().now(toPlayer, false, TeleportCause.COMMAND);
|
||||
target.sendMessage(_("teleportAtoB", Console.NAME, toPlayer.getDisplayName()));
|
||||
}
|
||||
|
@@ -3,18 +3,12 @@ package com.earth2me.essentials.commands;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import lombok.Cleanup;
|
||||
import org.bukkit.Server;
|
||||
|
||||
|
||||
public class Commandtpa extends EssentialsCommand
|
||||
{
|
||||
public Commandtpa()
|
||||
{
|
||||
super("tpa");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(Server server, IUser user, String commandLabel, String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
@@ -22,7 +16,7 @@ public class Commandtpa extends EssentialsCommand
|
||||
}
|
||||
|
||||
@Cleanup
|
||||
IUser player = getPlayer(server, args, 0);
|
||||
IUser player = getPlayer(args, 0);
|
||||
player.acquireReadLock();
|
||||
if (!player.getData().isTeleportEnabled())
|
||||
{
|
||||
|
@@ -3,36 +3,30 @@ package com.earth2me.essentials.commands;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import lombok.Cleanup;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
public class Commandtpaall extends EssentialsCommand
|
||||
{
|
||||
public Commandtpaall()
|
||||
{
|
||||
super("tpaall");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
if (sender instanceof Player)
|
||||
{
|
||||
teleportAAllPlayers(server, sender, ess.getUser(sender));
|
||||
teleportAAllPlayers( sender, ess.getUser(sender));
|
||||
return;
|
||||
}
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
|
||||
final IUser player = getPlayer(server, args, 0);
|
||||
teleportAAllPlayers(server, sender, player);
|
||||
final IUser player = getPlayer(args, 0);
|
||||
teleportAAllPlayers( sender, player);
|
||||
}
|
||||
|
||||
private void teleportAAllPlayers(final Server server, final CommandSender sender, final IUser user)
|
||||
private void teleportAAllPlayers(final CommandSender sender, final IUser user)
|
||||
{
|
||||
sender.sendMessage(_("teleportAAll"));
|
||||
for (Player onlinePlayer : server.getOnlinePlayers())
|
||||
@@ -60,7 +54,7 @@ public class Commandtpaall extends EssentialsCommand
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ess.showCommandError(sender, getName(), ex);
|
||||
ess.showCommandError(sender, commandName, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -4,26 +4,20 @@ import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.OfflinePlayer;
|
||||
import com.earth2me.essentials.Trade;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import lombok.Cleanup;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
|
||||
public class Commandtpaccept extends EssentialsCommand
|
||||
{
|
||||
public Commandtpaccept()
|
||||
{
|
||||
super("tpaccept");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
if (user.getTeleportRequester() == null)
|
||||
{
|
||||
throw new Exception(_("noPendingRequest"));
|
||||
}
|
||||
|
||||
|
||||
final IUser target = user.getTeleportRequester();
|
||||
if (target.getBase() instanceof OfflinePlayer
|
||||
|| (user.isTeleportRequestHere() && !target.isAuthorized("essentials.tpahere")))
|
||||
@@ -38,7 +32,7 @@ public class Commandtpaccept extends EssentialsCommand
|
||||
throw new Exception(_("requestTimedOut"));
|
||||
}
|
||||
|
||||
final Trade charge = new Trade(this.getName(), ess);
|
||||
final Trade charge = new Trade(commandName, ess);
|
||||
if (user.isTeleportRequestHere())
|
||||
{
|
||||
charge.isAffordableFor(user);
|
||||
|
@@ -3,18 +3,12 @@ package com.earth2me.essentials.commands;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import lombok.Cleanup;
|
||||
import org.bukkit.Server;
|
||||
|
||||
|
||||
public class Commandtpahere extends EssentialsCommand
|
||||
{
|
||||
public Commandtpahere()
|
||||
{
|
||||
super("tpahere");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
@@ -22,7 +16,7 @@ public class Commandtpahere extends EssentialsCommand
|
||||
}
|
||||
|
||||
@Cleanup
|
||||
final IUser player = getPlayer(server, args, 0);
|
||||
final IUser player = getPlayer(args, 0);
|
||||
player.acquireReadLock();
|
||||
if (!player.getData().isTeleportEnabled())
|
||||
{
|
||||
|
@@ -10,25 +10,20 @@ import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
public class Commandtpall extends EssentialsCommand
|
||||
{
|
||||
public Commandtpall()
|
||||
{
|
||||
super("tpall");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
if (sender instanceof Player)
|
||||
{
|
||||
teleportAllPlayers(server, sender, ess.getUser(sender));
|
||||
teleportAllPlayers(sender, ess.getUser(sender));
|
||||
return;
|
||||
}
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
|
||||
final IUser player = getPlayer(server, args, 0);
|
||||
final IUser player = getPlayer(args, 0);
|
||||
teleportAllPlayers(server, sender, player);
|
||||
}
|
||||
|
||||
@@ -48,7 +43,7 @@ public class Commandtpall extends EssentialsCommand
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ess.showCommandError(sender, getName(), ex);
|
||||
ess.showCommandError(sender, commandName, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -2,18 +2,12 @@ package com.earth2me.essentials.commands;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import org.bukkit.Server;
|
||||
|
||||
|
||||
public class Commandtpdeny extends EssentialsCommand
|
||||
{
|
||||
public Commandtpdeny()
|
||||
{
|
||||
super("tpdeny");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
final IUser player = user.getTeleportRequester();
|
||||
if (player == null)
|
||||
|
@@ -4,28 +4,22 @@ import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.Trade;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import lombok.Cleanup;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
|
||||
public class Commandtphere extends EssentialsCommand
|
||||
{
|
||||
public Commandtphere()
|
||||
{
|
||||
super("tphere");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
@Cleanup
|
||||
final IUser player = getPlayer(server, args, 0);
|
||||
final IUser player = getPlayer(args, 0);
|
||||
player.acquireReadLock();
|
||||
if (!player.getData().isTeleportEnabled())
|
||||
{
|
||||
throw new Exception(_("teleportDisabled", player.getDisplayName()));
|
||||
}
|
||||
player.getTeleport().teleport(user, new Trade(this.getName(), ess), TeleportCause.COMMAND);
|
||||
player.getTeleport().teleport(user, new Trade(commandName, ess), TeleportCause.COMMAND);
|
||||
user.sendMessage(_("teleporting"));
|
||||
player.sendMessage(_("teleporting"));
|
||||
throw new NoChargeException();
|
||||
|
@@ -3,19 +3,14 @@ package com.earth2me.essentials.commands;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.OfflinePlayer;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
|
||||
public class Commandtpo extends EssentialsCommand
|
||||
{
|
||||
public Commandtpo()
|
||||
{
|
||||
super("tpo");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
@@ -23,7 +18,7 @@ public class Commandtpo extends EssentialsCommand
|
||||
}
|
||||
|
||||
//Just basically the old tp command
|
||||
final IUser player = getPlayer(server, args, 0, true);
|
||||
final IUser player = getPlayer(args, 0, true);
|
||||
// Check if user is offline
|
||||
if (player.getBase() instanceof OfflinePlayer)
|
||||
{
|
||||
|
@@ -3,19 +3,14 @@ package com.earth2me.essentials.commands;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.OfflinePlayer;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
|
||||
public class Commandtpohere extends EssentialsCommand
|
||||
{
|
||||
public Commandtpohere()
|
||||
{
|
||||
super("tpohere");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
@@ -23,7 +18,7 @@ public class Commandtpohere extends EssentialsCommand
|
||||
}
|
||||
|
||||
//Just basically the old tphere command
|
||||
final IUser player = getPlayer(server, args, 0, true);
|
||||
final IUser player = getPlayer(args, 0, true);
|
||||
|
||||
// Check if user is offline
|
||||
if (player.getBase() instanceof OfflinePlayer)
|
||||
|
@@ -4,19 +4,13 @@ import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.Trade;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
|
||||
public class Commandtppos extends EssentialsCommand
|
||||
{
|
||||
public Commandtppos()
|
||||
{
|
||||
super("tppos");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 3)
|
||||
{
|
||||
@@ -35,7 +29,7 @@ public class Commandtppos extends EssentialsCommand
|
||||
{
|
||||
location.setPitch(Float.parseFloat(args[4]));
|
||||
}
|
||||
final Trade charge = new Trade(this.getName(), ess);
|
||||
final Trade charge = new Trade(commandName, ess);
|
||||
charge.isAffordableFor(user);
|
||||
user.sendMessage(_("teleporting"));
|
||||
user.getTeleport().teleport(location, charge, TeleportCause.COMMAND);
|
||||
|
@@ -2,18 +2,12 @@ package com.earth2me.essentials.commands;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import org.bukkit.Server;
|
||||
|
||||
|
||||
public class Commandtptoggle extends EssentialsCommand
|
||||
{
|
||||
public Commandtptoggle()
|
||||
{
|
||||
super("tptoggle");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
user.sendMessage(user.toggleTeleportEnabled()
|
||||
? _("teleportationEnabled")
|
||||
|
@@ -4,19 +4,13 @@ import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import com.earth2me.essentials.Util;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.TreeType;
|
||||
|
||||
|
||||
public class Commandtree extends EssentialsCommand
|
||||
{
|
||||
public Commandtree()
|
||||
{
|
||||
super("tree");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final IUser user, final String[] args) throws Exception
|
||||
{
|
||||
TreeType tree;
|
||||
if (args.length < 1)
|
||||
|
@@ -3,19 +3,13 @@ package com.earth2me.essentials.commands;
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.api.IUser;
|
||||
import lombok.Cleanup;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
|
||||
public class Commandunban extends EssentialsCommand
|
||||
{
|
||||
public Commandunban()
|
||||
{
|
||||
super("unban");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
|
||||
public void run(final CommandSender sender, final String[] args) throws Exception
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
@@ -25,7 +19,7 @@ public class Commandunban extends EssentialsCommand
|
||||
try
|
||||
{
|
||||
@Cleanup
|
||||
final IUser player = getPlayer(server, args, 0, true);
|
||||
final IUser player = getPlayer(args, 0, true);
|
||||
player.acquireWriteLock();
|
||||
player.getData().setBan(null);
|
||||
player.setBanned(false);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user