diff options
97 files changed, 446 insertions, 281 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Console.java b/Essentials/src/com/earth2me/essentials/Console.java index 304764adf..296ff380f 100644 --- a/Essentials/src/com/earth2me/essentials/Console.java +++ b/Essentials/src/com/earth2me/essentials/Console.java @@ -1,13 +1,13 @@ package com.earth2me.essentials; import com.earth2me.essentials.api.IReplyTo; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; public final class Console implements IReplyTo { private static Console instance = new Console(); - private ICommandSender replyTo; + private CommandSender replyTo; public final static String NAME = "Console"; private Console() @@ -15,13 +15,13 @@ public final class Console implements IReplyTo } @Override - public void setReplyTo(final ICommandSender user) + public void setReplyTo(final CommandSender user) { replyTo = user; } @Override - public ICommandSender getReplyTo() + public CommandSender getReplyTo() { return replyTo; } diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index c5503fdf5..ff0086dda 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -22,7 +22,7 @@ import com.earth2me.essentials.api.*; import com.earth2me.essentials.api.server.Player; import com.earth2me.essentials.api.server.IPlugin; import com.earth2me.essentials.api.server.IServer; -import com.earth2me.essentials.api.server.IWorld; +import com.earth2me.essentials.api.server.World; import com.earth2me.essentials.backup.Backup; import com.earth2me.essentials.commands.EssentialsCommandHandler; import com.earth2me.essentials.economy.Economy; @@ -43,7 +43,6 @@ import java.util.logging.Level; import java.util.logging.Logger; import lombok.Getter; import org.bukkit.Server; -import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; @@ -278,7 +277,7 @@ public class Essentials implements IEssentials } @Override - public IWorld getWorld(final String name) + public World getWorld(final String name) { if (name.matches("[0-9]+")) { diff --git a/Essentials/src/com/earth2me/essentials/api/ICommandHandler.java b/Essentials/src/com/earth2me/essentials/api/ICommandHandler.java index ec5d28af9..b515f9f38 100644 --- a/Essentials/src/com/earth2me/essentials/api/ICommandHandler.java +++ b/Essentials/src/com/earth2me/essentials/api/ICommandHandler.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.api; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import java.util.Map; import org.bukkit.command.Command; import org.bukkit.plugin.Plugin; @@ -14,7 +14,7 @@ public interface ICommandHandler extends IReload public void addPlugin(Plugin plugin); - boolean handleCommand(ICommandSender sender, Command command, String commandLabel, String[] args); + boolean handleCommand(CommandSender sender, Command command, String commandLabel, String[] args); - void showCommandError(ICommandSender sender, String commandLabel, Throwable exception); + void showCommandError(CommandSender sender, String commandLabel, Throwable exception); } diff --git a/Essentials/src/com/earth2me/essentials/api/IEssentials.java b/Essentials/src/com/earth2me/essentials/api/IEssentials.java index b662030cf..2a3b21147 100644 --- a/Essentials/src/com/earth2me/essentials/api/IEssentials.java +++ b/Essentials/src/com/earth2me/essentials/api/IEssentials.java @@ -3,7 +3,7 @@ package com.earth2me.essentials.api; import com.earth2me.essentials.api.server.Player; import com.earth2me.essentials.api.server.IPlugin; import com.earth2me.essentials.api.server.IServer; -import com.earth2me.essentials.api.server.IWorld; +import com.earth2me.essentials.api.server.World; import com.earth2me.essentials.economy.register.Methods; import com.earth2me.essentials.listener.TntExplodeListener; import java.util.logging.Logger; @@ -39,7 +39,7 @@ public interface IEssentials extends IComponent ICommandHandler getCommandHandler(); - IWorld getWorld(String name); + World getWorld(String name); Methods getPaymentMethod(); diff --git a/Essentials/src/com/earth2me/essentials/api/IPermission.java b/Essentials/src/com/earth2me/essentials/api/IPermission.java index 7a14bd1be..d20e900fd 100644 --- a/Essentials/src/com/earth2me/essentials/api/IPermission.java +++ b/Essentials/src/com/earth2me/essentials/api/IPermission.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.api; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.api.server.Permission; @@ -8,7 +8,7 @@ public interface IPermission { String getPermissionName(); - boolean isAuthorized(ICommandSender sender); + boolean isAuthorized(CommandSender sender); Permission getPermission(); diff --git a/Essentials/src/com/earth2me/essentials/api/IReplyTo.java b/Essentials/src/com/earth2me/essentials/api/IReplyTo.java index 415c1f4fb..ec07139cb 100644 --- a/Essentials/src/com/earth2me/essentials/api/IReplyTo.java +++ b/Essentials/src/com/earth2me/essentials/api/IReplyTo.java @@ -1,11 +1,11 @@ package com.earth2me.essentials.api; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; public interface IReplyTo { - void setReplyTo(ICommandSender user); + void setReplyTo(CommandSender user); - ICommandSender getReplyTo(); + CommandSender getReplyTo(); } diff --git a/Essentials/src/com/earth2me/essentials/api/IUser.java b/Essentials/src/com/earth2me/essentials/api/IUser.java index 945483758..928dc41b2 100644 --- a/Essentials/src/com/earth2me/essentials/api/IUser.java +++ b/Essentials/src/com/earth2me/essentials/api/IUser.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.api; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.api.server.Player; import com.earth2me.essentials.api.server.ItemStack; import com.earth2me.essentials.api.server.Location; @@ -18,11 +18,11 @@ public interface IUser extends Player, IStorageObjectHolder<UserData>, IReload, void takeMoney(double value); - void takeMoney(double value, ICommandSender initiator); + void takeMoney(double value, CommandSender initiator); void giveMoney(double value); - void giveMoney(double value, ICommandSender initiator); + void giveMoney(double value, CommandSender initiator); void giveItems(ItemStack itemStack, Boolean canSpew) throws ChargeException; diff --git a/Essentials/src/com/earth2me/essentials/api/IUserMap.java b/Essentials/src/com/earth2me/essentials/api/IUserMap.java index 394f23a97..bdbf084c7 100644 --- a/Essentials/src/com/earth2me/essentials/api/IUserMap.java +++ b/Essentials/src/com/earth2me/essentials/api/IUserMap.java @@ -1,7 +1,9 @@ package com.earth2me.essentials.api; import com.earth2me.essentials.api.server.Player; +import com.earth2me.essentials.user.TooManyMatchesException; import java.io.File; +import java.util.List; import java.util.Set; @@ -20,4 +22,8 @@ public interface IUserMap extends IReload int getUniqueUsers(); File getUserFile(final String name) throws InvalidNameException; + + IUser matchUser(final String name, final boolean includeHidden, final boolean onlineOnly) throws TooManyMatchesException; + + Set<IUser> matchUsers(final String name, final boolean includeHidden, final boolean onlineOnly); } diff --git a/Essentials/src/com/earth2me/essentials/api/server/ICommandSender.java b/Essentials/src/com/earth2me/essentials/api/server/CommandSender.java index 6f03a5f9b..37f9c0e1a 100644 --- a/Essentials/src/com/earth2me/essentials/api/server/ICommandSender.java +++ b/Essentials/src/com/earth2me/essentials/api/server/CommandSender.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.api.server; -public interface ICommandSender { +public interface CommandSender { boolean isPlayer(); void sendMessage(String message); diff --git a/Essentials/src/com/earth2me/essentials/api/server/IServer.java b/Essentials/src/com/earth2me/essentials/api/server/IServer.java index 455805796..f83518116 100644 --- a/Essentials/src/com/earth2me/essentials/api/server/IServer.java +++ b/Essentials/src/com/earth2me/essentials/api/server/IServer.java @@ -6,17 +6,17 @@ import java.util.List; public interface IServer { - List<IWorld> getWorlds(); + List<World> getWorlds(); - IWorld getWorld(String name); + World getWorld(String name); int broadcastMessage(String message); Collection<Player> getOnlinePlayers(); - ICommandSender getConsoleSender(); + CommandSender getConsoleSender(); - void dispatchCommand(ICommandSender sender, String command); + void dispatchCommand(CommandSender sender, String command); void banIP(String ip); diff --git a/Essentials/src/com/earth2me/essentials/api/server/IWorld.java b/Essentials/src/com/earth2me/essentials/api/server/IWorld.java deleted file mode 100644 index b457460da..000000000 --- a/Essentials/src/com/earth2me/essentials/api/server/IWorld.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.earth2me.essentials.api.server; - -import java.util.UUID; -import org.bukkit.TreeType; - -public interface IWorld { - String getName(); - - public boolean generateTree(Location safeLocation, TreeType tree); - - public int getHighestBlockYAt(int topX, int topZ); - - public ItemStack dropItem(Location loc, ItemStack stack); - - public UUID getUID(); - - public Location getSpawnLocation(); - - public void dropItemNaturally(Location location, ItemStack overflowStack); - - public void setStorm(boolean b); - - public void setWeatherDuration(int i); -} diff --git a/Essentials/src/com/earth2me/essentials/api/server/Location.java b/Essentials/src/com/earth2me/essentials/api/server/Location.java index f5ca8599d..39cc71ca5 100644 --- a/Essentials/src/com/earth2me/essentials/api/server/Location.java +++ b/Essentials/src/com/earth2me/essentials/api/server/Location.java @@ -5,7 +5,7 @@ public abstract class Location { public interface LocationFactory { Location create(String worldName, double x, double y, double z, double yaw, double pitch); - Location create(IWorld world, double x, double y, double z, double yaw, double pitch); + Location create(World world, double x, double y, double z, double yaw, double pitch); } private static LocationFactory factory; @@ -21,11 +21,11 @@ public abstract class Location return factory.create(worldName, x, y, z, yaw, pitch); } - public static Location create(IWorld world, double x, double y, double z) { + public static Location create(World world, double x, double y, double z) { return factory.create(world, x, y, z, 0, 0); } - public static Location create(IWorld world, double x, double y, double z, double yaw, double pitch) { + public static Location create(World world, double x, double y, double z, double yaw, double pitch) { return factory.create(world, x, y, z, yaw, pitch); } @@ -46,7 +46,7 @@ public abstract class Location public abstract int getBlockZ(); - public abstract IWorld getWorld(); + public abstract World getWorld(); public abstract double distanceSquared(Location location); } diff --git a/Essentials/src/com/earth2me/essentials/api/server/Player.java b/Essentials/src/com/earth2me/essentials/api/server/Player.java index 7c188aefd..7da3b80fc 100644 --- a/Essentials/src/com/earth2me/essentials/api/server/Player.java +++ b/Essentials/src/com/earth2me/essentials/api/server/Player.java @@ -3,7 +3,7 @@ package com.earth2me.essentials.api.server; import com.earth2me.essentials.api.IUser; -public interface Player extends ICommandSender +public interface Player extends CommandSender { IUser getUser(); @@ -17,7 +17,7 @@ public interface Player extends ICommandSender void kickPlayer(String reason); - IWorld getWorld(); + World getWorld(); Location getLocation(); diff --git a/Essentials/src/com/earth2me/essentials/api/server/World.java b/Essentials/src/com/earth2me/essentials/api/server/World.java new file mode 100644 index 000000000..ca3bb04c5 --- /dev/null +++ b/Essentials/src/com/earth2me/essentials/api/server/World.java @@ -0,0 +1,26 @@ +package com.earth2me.essentials.api.server; + +import java.util.UUID; +import org.bukkit.TreeType; + +public interface World { + String getName(); + + boolean generateTree(Location safeLocation, TreeType tree); + + int getHighestBlockYAt(int topX, int topZ); + + ItemStack dropItem(Location loc, ItemStack stack); + + UUID getUID(); + + Location getSpawnLocation(); + + void dropItemNaturally(Location location, ItemStack overflowStack); + + void setStorm(boolean b); + + void setWeatherDuration(int i); + + long getTime(); +} diff --git a/Essentials/src/com/earth2me/essentials/backup/Backup.java b/Essentials/src/com/earth2me/essentials/backup/Backup.java index 965a71566..68eca4566 100644 --- a/Essentials/src/com/earth2me/essentials/backup/Backup.java +++ b/Essentials/src/com/earth2me/essentials/backup/Backup.java @@ -4,23 +4,18 @@ import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IBackup; import com.earth2me.essentials.api.IEssentials; import com.earth2me.essentials.api.ISettings; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.api.server.IServer; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.concurrent.atomic.AtomicBoolean; import java.util.logging.Level; -import java.util.logging.Logger; import lombok.Cleanup; -import org.bukkit.Bukkit; -import org.bukkit.Server; -import org.bukkit.command.CommandSender; public class Backup implements Runnable, IBackup { - private static final Logger LOGGER = Bukkit.getLogger(); private transient final IServer server; private transient final IEssentials ess; private transient final AtomicBoolean running = new AtomicBoolean(false); @@ -70,8 +65,8 @@ public class Backup implements Runnable, IBackup { return; } - LOGGER.log(Level.INFO, _("backupStarted")); - final ICommandSender consoleSender = server.getConsoleSender(); + ess.getLogger().log(Level.INFO, _("backupStarted")); + final CommandSender consoleSender = server.getConsoleSender(); server.dispatchCommand(consoleSender, "save-all"); server.dispatchCommand(consoleSender, "save-off"); @@ -107,7 +102,7 @@ public class Backup implements Runnable, IBackup line = reader.readLine(); if (line != null) { - LOGGER.log(Level.INFO, line); + ess.getLogger().log(Level.INFO, line); } } while (line != null); @@ -119,11 +114,11 @@ public class Backup implements Runnable, IBackup } catch (InterruptedException ex) { - LOGGER.log(Level.SEVERE, null, ex); + ess.getLogger().log(Level.SEVERE, null, ex); } catch (IOException ex) { - LOGGER.log(Level.SEVERE, null, ex); + ess.getLogger().log(Level.SEVERE, null, ex); } finally { @@ -149,7 +144,7 @@ public class Backup implements Runnable, IBackup } active.set(false); - LOGGER.log(Level.INFO, _("backupFinished")); + ess.getLogger().log(Level.INFO, _("backupFinished")); } } } diff --git a/Essentials/src/com/earth2me/essentials/bukkit/CommandSender.java b/Essentials/src/com/earth2me/essentials/bukkit/BukkitCommandSender.java index a06c308c3..70e209691 100644 --- a/Essentials/src/com/earth2me/essentials/bukkit/CommandSender.java +++ b/Essentials/src/com/earth2me/essentials/bukkit/BukkitCommandSender.java @@ -1,18 +1,18 @@ package com.earth2me.essentials.bukkit; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.api.server.Permission; import lombok.Delegate; import lombok.Getter; -public class CommandSender implements ICommandSender +public class BukkitCommandSender implements CommandSender { @Delegate @Getter private org.bukkit.command.CommandSender commandSender; - public CommandSender(org.bukkit.command.CommandSender commandSender) + public BukkitCommandSender(org.bukkit.command.CommandSender commandSender) { this.commandSender = commandSender; } diff --git a/Essentials/src/com/earth2me/essentials/bukkit/BukkitLocation.java b/Essentials/src/com/earth2me/essentials/bukkit/BukkitLocation.java index 046522e09..c948bb442 100644 --- a/Essentials/src/com/earth2me/essentials/bukkit/BukkitLocation.java +++ b/Essentials/src/com/earth2me/essentials/bukkit/BukkitLocation.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.bukkit; -import com.earth2me.essentials.api.server.IWorld; +import com.earth2me.essentials.api.server.World; import com.earth2me.essentials.api.server.Location; import lombok.Delegate; import lombok.Getter; @@ -25,9 +25,9 @@ public class BukkitLocation extends Location } @Override - public Location create(IWorld world, double x, double y, double z, double yaw, double pitch) + public Location create(World world, double x, double y, double z, double yaw, double pitch) { - return new BukkitLocation(new org.bukkit.Location(((World)world).getBukkitWorld(), x, y, z, (float)yaw, (float)pitch)); + return new BukkitLocation(new org.bukkit.Location(((BukkitWorld)world).getBukkitWorld(), x, y, z, (float)yaw, (float)pitch)); } } @@ -49,9 +49,9 @@ public class BukkitLocation extends Location } @Override - public IWorld getWorld() + public World getWorld() { - return new World(bukkitLocation.getWorld()); + return new BukkitWorld(bukkitLocation.getWorld()); } @Override diff --git a/Essentials/src/com/earth2me/essentials/bukkit/BukkitPlayer.java b/Essentials/src/com/earth2me/essentials/bukkit/BukkitPlayer.java index e66ae2f07..5ca9d1da0 100644 --- a/Essentials/src/com/earth2me/essentials/bukkit/BukkitPlayer.java +++ b/Essentials/src/com/earth2me/essentials/bukkit/BukkitPlayer.java @@ -8,7 +8,7 @@ import org.bukkit.OfflinePlayer; import org.bukkit.entity.LivingEntity; -public class BukkitPlayer extends CommandSender implements Player +public class BukkitPlayer extends BukkitCommandSender implements Player { private interface Excludes { @@ -92,7 +92,7 @@ public class BukkitPlayer extends CommandSender implements Player } @Override - public IWorld getWorld() + public World getWorld() { return server.getWorld(onlinePlayer.getWorld().getName()); } diff --git a/Essentials/src/com/earth2me/essentials/bukkit/World.java b/Essentials/src/com/earth2me/essentials/bukkit/BukkitWorld.java index 9cead97f7..883be669a 100644 --- a/Essentials/src/com/earth2me/essentials/bukkit/World.java +++ b/Essentials/src/com/earth2me/essentials/bukkit/BukkitWorld.java @@ -1,20 +1,21 @@ package com.earth2me.essentials.bukkit; -import com.earth2me.essentials.api.server.IWorld; +import com.earth2me.essentials.api.server.World; import com.earth2me.essentials.api.server.ItemStack; import com.earth2me.essentials.api.server.Location; import lombok.Delegate; import lombok.Getter; import org.bukkit.TreeType; -public class World implements IWorld { +public class BukkitWorld implements World { @Delegate @Getter private final org.bukkit.World bukkitWorld; - public World(final org.bukkit.World world) + public BukkitWorld(final org.bukkit.World world) { this.bukkitWorld = world; + world.getT } @Override diff --git a/Essentials/src/com/earth2me/essentials/bukkit/EssentialsPlugin.java b/Essentials/src/com/earth2me/essentials/bukkit/EssentialsPlugin.java index 533720254..7e3dde434 100644 --- a/Essentials/src/com/earth2me/essentials/bukkit/EssentialsPlugin.java +++ b/Essentials/src/com/earth2me/essentials/bukkit/EssentialsPlugin.java @@ -84,11 +84,11 @@ public class EssentialsPlugin extends JavaPlugin @Override public boolean onCommand(final org.bukkit.command.CommandSender sender, final Command command, final String label, final String[] args) { - ICommandSender commandSender; + CommandSender commandSender; if (sender instanceof org.bukkit.entity.Player) { commandSender = ((Server)ess.getServer()).getPlayer((org.bukkit.entity.Player)sender); } else { - commandSender = new CommandSender(sender); + commandSender = new BukkitCommandSender(sender); } return ess.getCommandHandler().handleCommand(commandSender, command, label, args); } diff --git a/Essentials/src/com/earth2me/essentials/bukkit/Server.java b/Essentials/src/com/earth2me/essentials/bukkit/Server.java index 06d53522c..b673b2dae 100644 --- a/Essentials/src/com/earth2me/essentials/bukkit/Server.java +++ b/Essentials/src/com/earth2me/essentials/bukkit/Server.java @@ -1,10 +1,10 @@ package com.earth2me.essentials.bukkit; import com.earth2me.essentials.api.IEssentials; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.api.server.Player; import com.earth2me.essentials.api.server.IServer; -import com.earth2me.essentials.api.server.IWorld; +import com.earth2me.essentials.api.server.World; import java.util.*; import lombok.Delegate; import lombok.Getter; @@ -29,33 +29,33 @@ public class Server implements IServer, Listener org.bukkit.entity.Player[] getOnlinePlayers(); - CommandSender getConsoleSender(); + BukkitCommandSender getConsoleSender(); } @Delegate(excludes = Excludes.class) private final org.bukkit.Server server; @Getter - private List<IWorld> worlds; - private Map<String, IWorld> worldsMap; + private List<World> worlds; + private Map<String, World> worldsMap; @Getter private Collection<Player> onlinePlayers; private Map<org.bukkit.entity.Player, Player> onlinePlayersMap; @Getter - private ICommandSender consoleSender; + private CommandSender consoleSender; public Server(final org.bukkit.Server server) { this.server = server; - consoleSender = new CommandSender(server.getConsoleSender()); + consoleSender = new BukkitCommandSender(server.getConsoleSender()); updateWorlds(); } private void updateWorlds() { - final ArrayList<IWorld> lworlds = new ArrayList<IWorld>(server.getWorlds().size()); - final HashMap<String, IWorld> lworldsMap = new HashMap<String, IWorld>(); + final ArrayList<World> lworlds = new ArrayList<World>(server.getWorlds().size()); + final HashMap<String, World> lworldsMap = new HashMap<String, World>(); for (org.bukkit.World world : server.getWorlds()) { - final World w = new World(world); + final BukkitWorld w = new BukkitWorld(world); lworlds.add(w); lworldsMap.put(world.getName(), w); lworldsMap.put(world.getName().toLowerCase(Locale.ENGLISH), w); @@ -97,9 +97,9 @@ public class Server implements IServer, Listener } @Override - public IWorld getWorld(final String name) + public World getWorld(final String name) { - final IWorld world = worldsMap.get(name); + final World world = worldsMap.get(name); if (world == null) { return worldsMap.get(name.toLowerCase(Locale.ENGLISH)); @@ -108,9 +108,9 @@ public class Server implements IServer, Listener } @Override - public void dispatchCommand(final ICommandSender sender, final String command) + public void dispatchCommand(final CommandSender sender, final String command) { - server.dispatchCommand(((CommandSender)sender).getCommandSender(), command); + server.dispatchCommand(((BukkitCommandSender)sender).getCommandSender(), command); } @Override diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbackup.java b/Essentials/src/com/earth2me/essentials/commands/Commandbackup.java index 2f7a69662..ab749f9ee 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbackup.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbackup.java @@ -2,14 +2,14 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IBackup; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import org.bukkit.command.CommandSender; public class Commandbackup extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { final IBackup backup = ess.getBackup(); backup.run(); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java b/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java index b8b12d086..957536832 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbalance.java @@ -3,7 +3,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.utils.Util; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.permissions.Permissions; import org.bukkit.command.CommandSender; @@ -11,7 +11,7 @@ import org.bukkit.command.CommandSender; public class Commandbalance extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java b/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java index 0345eb712..4f0f0b9b3 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbalancetop.java @@ -3,7 +3,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.utils.Util; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.utils.textreader.ArrayListInput; import com.earth2me.essentials.utils.textreader.TextPager; import java.text.DateFormat; @@ -22,7 +22,7 @@ public class Commandbalancetop extends EssentialsCommand private static ReentrantReadWriteLock lock = new ReentrantReadWriteLock(); @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { int page = 0; boolean force = false; @@ -72,7 +72,7 @@ public class Commandbalancetop extends EssentialsCommand } - private static void outputCache(final ICommandSender sender, int page) + private static void outputCache(final CommandSender sender, int page) { final Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(cacheage); @@ -147,11 +147,11 @@ public class Commandbalancetop extends EssentialsCommand private class Viewer implements Runnable { - private final transient ICommandSender sender; + private final transient CommandSender sender; private final transient int page; private final transient boolean force; - public Viewer(final ICommandSender sender, final int page, final boolean force) + public Viewer(final CommandSender sender, final int page, final boolean force) { this.sender = sender; this.page = page; diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandban.java b/Essentials/src/com/earth2me/essentials/commands/Commandban.java index 87ce58422..f26f1e0eb 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandban.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandban.java @@ -3,7 +3,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.Console; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.api.server.Player; import com.earth2me.essentials.permissions.Permissions; import com.earth2me.essentials.user.Ban; @@ -15,7 +15,7 @@ import org.bukkit.entity.Player; public class Commandban extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java b/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java index f9b49525c..e5ede1e91 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbanip.java @@ -2,7 +2,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import lombok.Cleanup; import org.bukkit.command.CommandSender; @@ -10,7 +10,7 @@ import org.bukkit.command.CommandSender; public class Commandbanip extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbroadcast.java b/Essentials/src/com/earth2me/essentials/commands/Commandbroadcast.java index fb3faabb1..fe757c99b 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbroadcast.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbroadcast.java @@ -1,14 +1,14 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import org.bukkit.command.CommandSender; public class Commandbroadcast extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandburn.java b/Essentials/src/com/earth2me/essentials/commands/Commandburn.java index fefd61bea..e98cc1c48 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandburn.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandburn.java @@ -1,14 +1,14 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import org.bukkit.entity.Player; public class Commandburn extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 2) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandclearinventory.java b/Essentials/src/com/earth2me/essentials/commands/Commandclearinventory.java index 09084fee3..6be785b33 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandclearinventory.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandclearinventory.java @@ -2,7 +2,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.permissions.Permissions; import java.util.List; import org.bukkit.entity.Player; @@ -54,7 +54,7 @@ public class Commandclearinventory extends EssentialsCommand } @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commanddelhome.java b/Essentials/src/com/earth2me/essentials/commands/Commanddelhome.java index aa7024d3d..a6f8816f0 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commanddelhome.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commanddelhome.java @@ -2,7 +2,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.permissions.Permissions; import java.util.Locale; import lombok.Cleanup; @@ -13,7 +13,7 @@ import org.bukkit.entity.Player; public class Commanddelhome extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commanddeljail.java b/Essentials/src/com/earth2me/essentials/commands/Commanddeljail.java index 0621bbec5..08649acc3 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commanddeljail.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commanddeljail.java @@ -1,14 +1,14 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import org.bukkit.command.CommandSender; public class Commanddeljail extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commanddelwarp.java b/Essentials/src/com/earth2me/essentials/commands/Commanddelwarp.java index 672a069cd..f22c60949 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commanddelwarp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commanddelwarp.java @@ -1,14 +1,14 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import org.bukkit.command.CommandSender; public class Commanddelwarp extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandeco.java b/Essentials/src/com/earth2me/essentials/commands/Commandeco.java index 664bcd188..5e350bd87 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandeco.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandeco.java @@ -3,7 +3,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.api.ISettings; import com.earth2me.essentials.api.IUser; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.api.server.Player; import java.util.Locale; import lombok.Cleanup; @@ -14,7 +14,7 @@ import org.bukkit.entity.Player; public class Commandeco extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 2) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java index 57fbfba1b..fa449be12 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.api.server.Player; import java.util.HashMap; import java.util.Map; @@ -18,7 +18,7 @@ public class Commandessentials extends EssentialsCommand private final transient Map<Player, Block> noteBlocks = new HashMap<Player, Block>(); @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length == 0) { @@ -42,7 +42,7 @@ public class Commandessentials extends EssentialsCommand } } - private void run_disabled(final ICommandSender sender, final String[] args) throws Exception + private void run_disabled(final CommandSender sender, final String[] args) throws Exception { sender.sendMessage("Essentials " + ess.getPlugin().getVersion()); sender.sendMessage("/<command> <reload/debug>"); @@ -59,19 +59,19 @@ public class Commandessentials extends EssentialsCommand sender.sendMessage(disabledCommands.toString()); } - private void run_debug(final ICommandSender sender, 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.getPlugin().getVersion() + " debug mode " + (ess.getSettings().isDebug() ? "enabled" : "disabled")); } - private void run_reload(final ICommandSender sender, final String[] args) throws Exception + private void run_reload(final CommandSender sender, final String[] args) throws Exception { ess.reload(); sender.sendMessage(_("essentialsReload", ess.getPlugin().getVersion())); } - private void run_nya(final ICommandSender sender, 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); @@ -162,7 +162,7 @@ public class Commandessentials extends EssentialsCommand noteBlocks.clear(); } - private void run_moo(final ICommandSender sender, final String args[]) + private void run_moo(final CommandSender sender, final String args[]) { if(sender == ess.getServer().getConsoleSender()) sender.sendMessage(new String[]{" (__)", " (oo)", " /------\\/", " / | ||", " * /\\---/\\", " ~~ ~~", "....\"Have you mooed today?\"..." } ); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandext.java b/Essentials/src/com/earth2me/essentials/commands/Commandext.java index ee8e17de4..50d6a7d5c 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandext.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandext.java @@ -2,14 +2,14 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import org.bukkit.entity.Player; public class Commandext extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { @@ -32,7 +32,7 @@ public class Commandext extends EssentialsCommand extinguishPlayers(user, args[0]); } - private void extinguishPlayers(final ICommandSender sender, final String name) throws Exception + private void extinguishPlayers(final CommandSender sender, final String name) throws Exception { for (Player matchPlayer : server.matchPlayer(name)) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java b/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java index f68b8d7d4..10a976c1e 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java @@ -2,7 +2,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.permissions.Permissions; import java.util.Locale; import org.bukkit.GameMode; @@ -13,7 +13,7 @@ import org.bukkit.entity.Player; public class Commandgamemode extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { @@ -36,7 +36,7 @@ public class Commandgamemode extends EssentialsCommand user.sendMessage(_("gameMode", _(user.getGameMode().toString().toLowerCase(Locale.ENGLISH)), user.getDisplayName())); } - private void gamemodeOtherPlayers(final ICommandSender sender, final String name) + private void gamemodeOtherPlayers(final CommandSender sender, final String name) { for (Player matchPlayer : server.matchPlayer(name)) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgc.java b/Essentials/src/com/earth2me/essentials/commands/Commandgc.java index fe23768ba..92a128d9e 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandgc.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandgc.java @@ -1,8 +1,8 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.api.server.ICommandSender; -import com.earth2me.essentials.api.server.IWorld; +import com.earth2me.essentials.api.server.CommandSender; +import com.earth2me.essentials.api.server.World; import org.bukkit.World; import org.bukkit.command.CommandSender; @@ -10,13 +10,13 @@ import org.bukkit.command.CommandSender; public class Commandgc extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { sender.sendMessage(_("gcmax", (Runtime.getRuntime().maxMemory() / 1024 / 1024))); sender.sendMessage(_("gctotal", (Runtime.getRuntime().totalMemory() / 1024 / 1024))); sender.sendMessage(_("gcfree", (Runtime.getRuntime().freeMemory() / 1024 / 1024))); - for (IWorld w : server.getWorlds()) + for (World w : server.getWorlds()) { sender.sendMessage( (w.getEnvironment() == World.Environment.NETHER ? "Nether" : "World") + " \"" + w.getName() + "\": " diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgetpos.java b/Essentials/src/com/earth2me/essentials/commands/Commandgetpos.java index c518507ae..e50e1e39d 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandgetpos.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandgetpos.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.permissions.Permissions; import org.bukkit.Location; import org.bukkit.command.CommandSender; @@ -24,7 +24,7 @@ public class Commandgetpos extends EssentialsCommand } @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgive.java b/Essentials/src/com/earth2me/essentials/commands/Commandgive.java index b841716b9..5612c35f6 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandgive.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandgive.java @@ -3,7 +3,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.permissions.GivePermissions; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import java.util.Locale; import org.bukkit.ChatColor; import org.bukkit.Material; @@ -17,7 +17,7 @@ public class Commandgive extends EssentialsCommand { //TODO: move these messages to message file @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 2) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgod.java b/Essentials/src/com/earth2me/essentials/commands/Commandgod.java index 32dafae14..9bfc74fca 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandgod.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandgod.java @@ -2,7 +2,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.permissions.Permissions; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -11,7 +11,7 @@ import org.bukkit.entity.Player; public class Commandgod extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandheal.java b/Essentials/src/com/earth2me/essentials/commands/Commandheal.java index b6f3199ce..06fe3de3c 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandheal.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandheal.java @@ -2,7 +2,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.permissions.Permissions; import com.earth2me.essentials.user.UserData.TimestampType; import java.util.List; @@ -31,7 +31,7 @@ public class Commandheal extends EssentialsCommand } @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { @@ -41,7 +41,7 @@ public class Commandheal extends EssentialsCommand healOtherPlayers(sender, args[0]); } - private void healOtherPlayers(final ICommandSender sender, final String name) + private void healOtherPlayers(final CommandSender sender, final String name) { final List<Player> players = server.matchPlayer(name); if (players.isEmpty()) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java b/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java index a0987dd07..fa32ceada 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java @@ -8,7 +8,7 @@ import com.earth2me.essentials.utils.textreader.KeywordReplacer; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.utils.Util; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import org.bukkit.command.CommandSender; @@ -44,7 +44,7 @@ public class Commandhelp extends EssentialsCommand } @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { sender.sendMessage(_("helpConsole")); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandinfo.java b/Essentials/src/com/earth2me/essentials/commands/Commandinfo.java index 89adaf487..2188a9296 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandinfo.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandinfo.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.utils.textreader.IText; import com.earth2me.essentials.utils.textreader.KeywordReplacer; import com.earth2me.essentials.utils.textreader.TextInput; @@ -11,7 +11,7 @@ import org.bukkit.command.CommandSender; public class Commandinfo extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { final IText input = new TextInput(sender, "info", true, ess); final IText output = new KeywordReplacer(input, sender, ess); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commanditemdb.java b/Essentials/src/com/earth2me/essentials/commands/Commanditemdb.java index 1456b4067..205cdf072 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commanditemdb.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commanditemdb.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -9,7 +9,7 @@ import org.bukkit.inventory.ItemStack; public class Commanditemdb extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { ItemStack itemStack = null; if (args.length < 1) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandjails.java b/Essentials/src/com/earth2me/essentials/commands/Commandjails.java index cd28a0520..b1563d799 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandjails.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandjails.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.utils.Util; import org.bukkit.command.CommandSender; @@ -8,7 +8,7 @@ import org.bukkit.command.CommandSender; public class Commandjails extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { sender.sendMessage("§7" + Util.joinList(" ", ess.getJails().getList())); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkick.java b/Essentials/src/com/earth2me/essentials/commands/Commandkick.java index bcaad7649..2b149a6d6 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkick.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkick.java @@ -3,7 +3,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.Console; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.api.server.Player; import com.earth2me.essentials.permissions.Permissions; import org.bukkit.entity.Player; @@ -12,7 +12,7 @@ import org.bukkit.entity.Player; public class Commandkick extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkickall.java b/Essentials/src/com/earth2me/essentials/commands/Commandkickall.java index 54b5cb27c..8556f58ff 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkickall.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkickall.java @@ -1,14 +1,14 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.api.server.Player; public class Commandkickall extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { for (Player onlinePlayer : server.getOnlinePlayers()) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkill.java b/Essentials/src/com/earth2me/essentials/commands/Commandkill.java index 43735d34d..1a0ba3965 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkill.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkill.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.event.entity.EntityDamageEvent; @@ -10,7 +10,7 @@ import org.bukkit.event.entity.EntityDamageEvent; public class Commandkill extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java b/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java index 762c9d736..2b2fc2c3b 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkillall.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.bukkit.Mob; import java.util.Collections; import java.util.Locale; @@ -16,7 +16,7 @@ public class Commandkillall extends EssentialsCommand { //TODO: Tidy - missed this during command cleanup @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { String type = "all"; int radius = -1; diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java b/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java index 6bc3bc428..82ae1b720 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandlightning.java @@ -3,7 +3,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.ISettings; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.permissions.Permissions; import lombok.Cleanup; import org.bukkit.command.CommandSender; @@ -14,7 +14,7 @@ import org.bukkit.entity.Player; public class Commandlightning extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { IUser user = null; diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandlist.java b/Essentials/src/com/earth2me/essentials/commands/Commandlist.java index 1772cde69..7525b68cc 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandlist.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandlist.java @@ -4,7 +4,7 @@ import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.utils.Util; import com.earth2me.essentials.api.ISettings; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.api.server.Player; import com.earth2me.essentials.permissions.Permissions; import java.util.*; @@ -15,7 +15,7 @@ import org.bukkit.entity.Player; public class Commandlist extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { boolean showhidden = false; if (Permissions.LIST_HIDDEN.isAuthorized(sender)) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmail.java b/Essentials/src/com/earth2me/essentials/commands/Commandmail.java index baf087f7b..95abc5b46 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandmail.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandmail.java @@ -3,7 +3,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.utils.Util; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.permissions.Permissions; import java.util.List; import org.bukkit.entity.Player; @@ -80,7 +80,7 @@ public class Commandmail extends EssentialsCommand } @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length >= 1 && "read".equalsIgnoreCase(args[0])) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmotd.java b/Essentials/src/com/earth2me/essentials/commands/Commandmotd.java index 766c84f6b..daf30e8cc 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandmotd.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandmotd.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.utils.textreader.IText; import com.earth2me.essentials.utils.textreader.KeywordReplacer; import com.earth2me.essentials.utils.textreader.TextInput; @@ -11,7 +11,7 @@ import org.bukkit.command.CommandSender; public class Commandmotd extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { final IText input = new TextInput(sender, "motd", true, ess); final IText output = new KeywordReplacer(input, sender, ess); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java b/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java index 61539db46..2b1d12561 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandmsg.java @@ -5,7 +5,7 @@ import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.utils.Util; import com.earth2me.essentials.api.IReplyTo; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.permissions.Permissions; import java.util.List; import lombok.Cleanup; @@ -16,7 +16,7 @@ import org.bukkit.entity.Player; public class Commandmsg extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 2 || args[0].trim().isEmpty() || args[1].trim().isEmpty()) { @@ -55,7 +55,7 @@ public class Commandmsg extends EssentialsCommand if (args[0].equalsIgnoreCase(Console.NAME)) { sender.sendMessage(_("msgFormat", translatedMe, Console.NAME, message)); - ICommandSender cs = server.getConsoleSender(); + CommandSender cs = server.getConsoleSender(); cs.sendMessage(_("msgFormat", senderName, translatedMe, message)); replyTo.setReplyTo(cs); Console.getConsoleReplyTo().setReplyTo(sender); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmute.java b/Essentials/src/com/earth2me/essentials/commands/Commandmute.java index f4dfff6e6..2426df151 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandmute.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandmute.java @@ -3,7 +3,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.utils.Util; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.permissions.Permissions; import com.earth2me.essentials.user.UserData.TimestampType; import com.earth2me.essentials.utils.DateUtil; @@ -14,7 +14,7 @@ import org.bukkit.command.CommandSender; public class Commandmute extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandnear.java b/Essentials/src/com/earth2me/essentials/commands/Commandnear.java index c6aa2fc85..f5cd7a777 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandnear.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandnear.java @@ -2,7 +2,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.permissions.Permissions; import org.bukkit.Location; import org.bukkit.World; @@ -57,7 +57,7 @@ public class Commandnear extends EssentialsCommand } @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length == 0) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandnick.java b/Essentials/src/com/earth2me/essentials/commands/Commandnick.java index fae568aba..1ff098e2c 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandnick.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandnick.java @@ -4,7 +4,7 @@ import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.utils.Util; import com.earth2me.essentials.api.ISettings; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.permissions.Permissions; import java.util.Locale; import lombok.Cleanup; @@ -43,7 +43,7 @@ public class Commandnick extends EssentialsCommand } @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 2) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java b/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java index 643e73be6..ec7bc54aa 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -15,7 +15,7 @@ import org.bukkit.entity.TNTPrimed; public class Commandnuke extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws NoSuchFieldException, NotEnoughArgumentsException + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws NoSuchFieldException, NotEnoughArgumentsException { List<Player> targets; if (args.length > 0) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandptime.java b/Essentials/src/com/earth2me/essentials/commands/Commandptime.java index 3127f4893..35c1a1595 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandptime.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandptime.java @@ -3,7 +3,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.utils.DescParseTickFormat; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.permissions.Permissions; import java.util.*; import org.bukkit.World; @@ -24,7 +24,7 @@ public class Commandptime extends EssentialsCommand } @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { // Which Players(s) / Users(s) are we interested in? String userSelector = null; diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandr.java b/Essentials/src/com/earth2me/essentials/commands/Commandr.java index acbae2540..d8bed8769 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandr.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandr.java @@ -5,7 +5,7 @@ import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.utils.Util; import com.earth2me.essentials.api.IReplyTo; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.permissions.Permissions; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -14,7 +14,7 @@ import org.bukkit.entity.Player; public class Commandr extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { @@ -46,7 +46,7 @@ public class Commandr extends EssentialsCommand senderName = Console.NAME; } - final ICommandSender target = replyTo.getReplyTo(); + final CommandSender target = replyTo.getReplyTo(); final String targetName = target instanceof Player ? ((Player)target).getDisplayName() : Console.NAME; if (target == null || ((target instanceof Player) && !((Player)target).isOnline())) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java b/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java index 355d7b904..8c088b044 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandrealname.java @@ -4,7 +4,7 @@ import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.utils.Util; import com.earth2me.essentials.api.ISettings; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import java.util.Locale; import lombok.Cleanup; import org.bukkit.command.CommandSender; @@ -14,7 +14,7 @@ import org.bukkit.entity.Player; public class Commandrealname extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandremove.java b/Essentials/src/com/earth2me/essentials/commands/Commandremove.java index 86faedf4e..0a513ff74 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandremove.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandremove.java @@ -2,7 +2,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import java.util.Locale; import org.bukkit.Chunk; import org.bukkit.World; @@ -58,7 +58,7 @@ public class Commandremove extends EssentialsCommand } @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 2) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandrules.java b/Essentials/src/com/earth2me/essentials/commands/Commandrules.java index 6d7655693..dce0b9b00 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandrules.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandrules.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.commands; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.utils.textreader.IText; import com.earth2me.essentials.utils.textreader.KeywordReplacer; import com.earth2me.essentials.utils.textreader.TextInput; @@ -11,7 +11,7 @@ import org.bukkit.command.CommandSender; public class Commandrules extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { final IText input = new TextInput(sender, "rules", true, ess); final IText output = new KeywordReplacer(input, sender, ess); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java index 7ad9b42f4..40b8898cf 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java @@ -3,7 +3,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.utils.Util; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.permissions.Permissions; import com.earth2me.essentials.user.UserData.TimestampType; import com.earth2me.essentials.utils.DateUtil; @@ -14,7 +14,7 @@ import org.bukkit.command.CommandSender; public class Commandseen extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { seen(sender,args,true); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java b/Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java index 11ab47433..5c41af83a 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsetworth.java @@ -2,7 +2,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import org.bukkit.command.CommandSender; import org.bukkit.inventory.ItemStack; @@ -36,7 +36,7 @@ public class Commandsetworth extends EssentialsCommand } @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 2) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawn.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawn.java index 7dbe51dab..f2ced2336 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawn.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawn.java @@ -3,7 +3,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.economy.Trade; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.permissions.Permissions; import com.earth2me.essentials.settings.SpawnsHolder; import org.bukkit.Location; @@ -35,7 +35,7 @@ public class Commandspawn extends EssentialsCommand } @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java b/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java index 456cdc192..e7bc50c7e 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsudo.java @@ -2,14 +2,14 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.permissions.Permissions; public class Commandsudo extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 2) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java b/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java index 352a5364f..774f6957b 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java @@ -4,7 +4,7 @@ import com.earth2me.essentials.Console; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.utils.Util; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.permissions.Permissions; import com.earth2me.essentials.user.Ban; import com.earth2me.essentials.utils.DateUtil; @@ -16,7 +16,7 @@ import org.bukkit.entity.Player; public class Commandtempban extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 2) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtime.java b/Essentials/src/com/earth2me/essentials/commands/Commandtime.java index 0155f0e08..43ba15ac2 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtime.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtime.java @@ -3,7 +3,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.utils.DescParseTickFormat; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.permissions.Permissions; import java.util.*; import org.bukkit.World; @@ -14,7 +14,7 @@ import org.bukkit.entity.Player; public class Commandtime extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { // Which World(s) are we interested in? String worldSelector = null; diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java b/Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java index 8c975e506..e2b011c5f 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtogglejail.java @@ -3,7 +3,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.utils.Util; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.permissions.Permissions; import com.earth2me.essentials.user.UserData.TimestampType; import com.earth2me.essentials.utils.DateUtil; @@ -15,7 +15,7 @@ import org.bukkit.command.CommandSender; public class Commandtogglejail extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java index c5f0ba687..a0fe7e8b4 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java @@ -4,7 +4,7 @@ import com.earth2me.essentials.Console; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.economy.Trade; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.permissions.Permissions; import lombok.Cleanup; import org.bukkit.command.CommandSender; @@ -50,7 +50,7 @@ public class Commandtp extends EssentialsCommand } @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 2) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpaall.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpaall.java index 182165b42..70b55bc41 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpaall.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpaall.java @@ -3,7 +3,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.ISettings; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import lombok.Cleanup; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -12,7 +12,7 @@ import org.bukkit.entity.Player; public class Commandtpaall extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java index b1f70b8b2..b34f042a7 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java @@ -2,7 +2,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; @@ -11,7 +11,7 @@ import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; public class Commandtpall extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandunban.java b/Essentials/src/com/earth2me/essentials/commands/Commandunban.java index 202bd8971..0aa627ff5 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandunban.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandunban.java @@ -2,7 +2,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import lombok.Cleanup; import org.bukkit.command.CommandSender; @@ -10,7 +10,7 @@ import org.bukkit.command.CommandSender; public class Commandunban extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java b/Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java index 7e43603d5..8cbb5c9b8 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java @@ -2,7 +2,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import lombok.Cleanup; import org.bukkit.command.CommandSender; @@ -10,7 +10,7 @@ import org.bukkit.command.CommandSender; public class Commandunbanip extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandwarp.java b/Essentials/src/com/earth2me/essentials/commands/Commandwarp.java index d81ed4839..58a716fce 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandwarp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandwarp.java @@ -5,7 +5,7 @@ import com.earth2me.essentials.economy.Trade; import com.earth2me.essentials.utils.Util; import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.api.IWarps; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.permissions.Permissions; import com.earth2me.essentials.permissions.WarpPermissions; import java.util.ArrayList; @@ -51,7 +51,7 @@ public class Commandwarp extends EssentialsCommand } @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 2 || args[0].matches("[0-9]+")) { @@ -69,7 +69,7 @@ public class Commandwarp extends EssentialsCommand } //TODO: Use one of the new text classes, like /help ? - private void warpList(final ICommandSender sender, final String[] args) throws Exception + private void warpList(final CommandSender sender, final String[] args) throws Exception { final IWarps warps = ess.getWarps(); if (warps.isEmpty()) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandweather.java b/Essentials/src/com/earth2me/essentials/commands/Commandweather.java index 6671bfee3..64f24645a 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandweather.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandweather.java @@ -2,8 +2,8 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; -import com.earth2me.essentials.api.server.IWorld; +import com.earth2me.essentials.api.server.CommandSender; +import com.earth2me.essentials.api.server.World; public class Commandweather extends EssentialsCommand @@ -18,7 +18,7 @@ public class Commandweather extends EssentialsCommand } final boolean isStorm = args[0].equalsIgnoreCase("storm"); - final IWorld world = user.getWorld(); + final World world = user.getWorld(); if (args.length > 1) { @@ -39,7 +39,7 @@ public class Commandweather extends EssentialsCommand //TODO: Translate these @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 2) //running from console means inserting a world arg before other args { @@ -47,7 +47,7 @@ public class Commandweather extends EssentialsCommand } final boolean isStorm = args[1].equalsIgnoreCase("storm"); - final IWorld world = server.getWorld(args[0]); + final World world = server.getWorld(args[0]); if (world == null) { throw new Exception("World named " + args[0] + " not found!"); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java b/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java index 85b1e9a7b..b1811b947 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java @@ -4,7 +4,7 @@ import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.utils.Util; import com.earth2me.essentials.api.ISettings; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.api.server.Player; import com.earth2me.essentials.permissions.Permissions; import com.earth2me.essentials.user.UserData; @@ -17,7 +17,7 @@ import lombok.Cleanup; public class Commandwhois extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandworld.java b/Essentials/src/com/earth2me/essentials/commands/Commandworld.java index edc019850..063ca33e3 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandworld.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandworld.java @@ -3,7 +3,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.economy.Trade; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.IWorld; +import com.earth2me.essentials.api.server.World; import com.earth2me.essentials.api.server.Location; import com.earth2me.essentials.permissions.WorldPermissions; import java.util.List; @@ -15,15 +15,15 @@ public class Commandworld extends EssentialsCommand @Override protected void run(final IUser user, final String commandLabel, final String[] args) throws Exception { - IWorld world; + World world; if (args.length < 1) { - IWorld nether = null; + World nether = null; - final List<IWorld> worlds = server.getWorlds(); + final List<World> worlds = server.getWorlds(); - for (IWorld world2 : worlds) + for (World world2 : worlds) { if (world2.getEnvironment() == World.Environment.NETHER) { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandworth.java b/Essentials/src/com/earth2me/essentials/commands/Commandworth.java index c5cab92ef..990bfe5a6 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandworth.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandworth.java @@ -3,7 +3,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.utils.Util; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.api.server.ItemStack; import java.util.Locale; import org.bukkit.command.CommandSender; @@ -57,7 +57,7 @@ public class Commandworth extends EssentialsCommand } @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { diff --git a/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java b/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java index 02cc6e7d9..a7deaac71 100644 --- a/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java +++ b/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java @@ -4,7 +4,7 @@ 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.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.api.server.IServer; import com.earth2me.essentials.api.server.Player; import com.earth2me.essentials.economy.Trade; @@ -94,16 +94,16 @@ public abstract class EssentialsCommand extends AbstractSuperpermsPermission imp protected void run(final IUser user, final String commandLabel, final String[] args) throws Exception { - run((ICommandSender)user, commandLabel, args); + run((CommandSender)user, commandLabel, args); } @Override - public final void run(final ICommandSender sender, final Command cmd, final String commandLabel, final String[] args) throws Exception + public final void run(final CommandSender sender, final Command cmd, final String commandLabel, final String[] args) throws Exception { run(sender, commandLabel, args); } - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { throw new Exception(_("onlyPlayers", commandName)); } diff --git a/Essentials/src/com/earth2me/essentials/commands/EssentialsCommandHandler.java b/Essentials/src/com/earth2me/essentials/commands/EssentialsCommandHandler.java index aa20fd1e2..0971b764a 100644 --- a/Essentials/src/com/earth2me/essentials/commands/EssentialsCommandHandler.java +++ b/Essentials/src/com/earth2me/essentials/commands/EssentialsCommandHandler.java @@ -2,7 +2,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.*; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.commands.EssentialsCommand; import com.earth2me.essentials.commands.IEssentialsCommand; import com.earth2me.essentials.commands.NoChargeException; @@ -54,7 +54,7 @@ public class EssentialsCommandHandler implements ICommandHandler } @Override - public boolean handleCommand(final ICommandSender sender, final Command command, final String commandLabel, final String[] args) + public boolean handleCommand(final CommandSender sender, final Command command, final String commandLabel, final String[] args) { boolean disabled = false; boolean overridden = false; @@ -194,7 +194,7 @@ public class EssentialsCommandHandler implements ICommandHandler } @Override - public void showCommandError(final ICommandSender sender, final String commandLabel, final Throwable exception) + public void showCommandError(final CommandSender sender, final String commandLabel, final Throwable exception) { sender.sendMessage(_("errorWithMessage", exception.getMessage())); if (ess.getSettings().isDebug()) diff --git a/Essentials/src/com/earth2me/essentials/commands/IEssentialsCommand.java b/Essentials/src/com/earth2me/essentials/commands/IEssentialsCommand.java index d7d40775a..97b5f2767 100644 --- a/Essentials/src/com/earth2me/essentials/commands/IEssentialsCommand.java +++ b/Essentials/src/com/earth2me/essentials/commands/IEssentialsCommand.java @@ -4,7 +4,7 @@ import com.earth2me.essentials.api.IEssentials; import com.earth2me.essentials.api.IEssentialsModule; import com.earth2me.essentials.api.IPermission; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import org.bukkit.command.Command; @@ -13,7 +13,7 @@ public interface IEssentialsCommand extends IPermission void run(IUser user, Command cmd, String commandLabel, String[] args) throws Exception; - void run(ICommandSender sender, Command cmd, String commandLabel, String[] args) + void run(CommandSender sender, Command cmd, String commandLabel, String[] args) throws Exception; void init(IEssentials ess, String commandLabel); diff --git a/Essentials/src/com/earth2me/essentials/permissions/AbstractSuperpermsPermission.java b/Essentials/src/com/earth2me/essentials/permissions/AbstractSuperpermsPermission.java index 31a55b50f..66aba8f9c 100644 --- a/Essentials/src/com/earth2me/essentials/permissions/AbstractSuperpermsPermission.java +++ b/Essentials/src/com/earth2me/essentials/permissions/AbstractSuperpermsPermission.java @@ -2,7 +2,7 @@ package com.earth2me.essentials.permissions; import com.earth2me.essentials.utils.Util; import com.earth2me.essentials.api.IPermission; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.api.server.Permission; @@ -34,7 +34,7 @@ public abstract class AbstractSuperpermsPermission implements IPermission } @Override - public boolean isAuthorized(final ICommandSender sender) + public boolean isAuthorized(final CommandSender sender) { return sender.hasPermission(getPermission()); } diff --git a/Essentials/src/com/earth2me/essentials/permissions/Permissions.java b/Essentials/src/com/earth2me/essentials/permissions/Permissions.java index 5c9c29a92..a9df9e04a 100644 --- a/Essentials/src/com/earth2me/essentials/permissions/Permissions.java +++ b/Essentials/src/com/earth2me/essentials/permissions/Permissions.java @@ -2,7 +2,7 @@ package com.earth2me.essentials.permissions; import com.earth2me.essentials.utils.Util; import com.earth2me.essentials.api.IPermission; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.api.server.Permission; import java.util.Locale; @@ -116,7 +116,7 @@ public enum Permissions implements IPermission } @Override - public boolean isAuthorized(ICommandSender sender) + public boolean isAuthorized(CommandSender sender) { return sender.hasPermission(getPermission()); } diff --git a/Essentials/src/com/earth2me/essentials/storage/StoredLocation.java b/Essentials/src/com/earth2me/essentials/storage/StoredLocation.java index 7c817de87..d1c188b74 100644 --- a/Essentials/src/com/earth2me/essentials/storage/StoredLocation.java +++ b/Essentials/src/com/earth2me/essentials/storage/StoredLocation.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.storage; -import com.earth2me.essentials.api.server.IWorld; +import com.earth2me.essentials.api.server.World; import com.earth2me.essentials.api.server.Location; import java.lang.ref.WeakReference; import java.util.UUID; @@ -55,7 +55,7 @@ public class StoredLocation Location loc = location == null ? null : location.get(); if (loc == null) { - IWorld world = null; + World world = null; if (worldUID != null) { world = Bukkit.getWorld(worldUID); diff --git a/Essentials/src/com/earth2me/essentials/user/TooManyMatchesException.java b/Essentials/src/com/earth2me/essentials/user/TooManyMatchesException.java new file mode 100644 index 000000000..61e266958 --- /dev/null +++ b/Essentials/src/com/earth2me/essentials/user/TooManyMatchesException.java @@ -0,0 +1,5 @@ +package com.earth2me.essentials.user; + +public class TooManyMatchesException extends Exception { + +} diff --git a/Essentials/src/com/earth2me/essentials/user/User.java b/Essentials/src/com/earth2me/essentials/user/User.java index 5873e3790..4120e4bdf 100644 --- a/Essentials/src/com/earth2me/essentials/user/User.java +++ b/Essentials/src/com/earth2me/essentials/user/User.java @@ -21,7 +21,7 @@ import lombok.Setter; public class User extends UserBase implements IUser { - private ICommandSender replyTo = null; + private CommandSender replyTo = null; @Getter private transient IUser teleportRequester; @Getter @@ -89,7 +89,7 @@ public class User extends UserBase implements IUser } @Override - public void giveMoney(final double value, final ICommandSender initiator) + public void giveMoney(final double value, final CommandSender initiator) { if (value == 0) @@ -139,7 +139,7 @@ public class User extends UserBase implements IUser } @Override - public void takeMoney(final double value, final ICommandSender initiator) + public void takeMoney(final double value, final CommandSender initiator) { if (value == 0) { @@ -556,13 +556,13 @@ public class User extends UserBase implements IUser } @Override - public void setReplyTo(ICommandSender user) + public void setReplyTo(CommandSender user) { replyTo = user; } @Override - public ICommandSender getReplyTo() + public CommandSender getReplyTo() { return replyTo; } diff --git a/Essentials/src/com/earth2me/essentials/user/UserMap.java b/Essentials/src/com/earth2me/essentials/user/UserMap.java index 2591b2522..d3ab7e17e 100644 --- a/Essentials/src/com/earth2me/essentials/user/UserMap.java +++ b/Essentials/src/com/earth2me/essentials/user/UserMap.java @@ -6,11 +6,14 @@ import com.earth2me.essentials.api.IUserMap; import com.earth2me.essentials.api.InvalidNameException; import com.earth2me.essentials.api.server.Player; import com.earth2me.essentials.storage.StorageObjectMap; +import com.earth2me.essentials.utils.Util; import java.io.File; +import java.util.Collections; +import java.util.LinkedHashSet; +import java.util.List; import java.util.Locale; import java.util.Set; import org.bukkit.Bukkit; -import org.bukkit.entity.Player; public class UserMap extends StorageObjectMap<IUser> implements IUserMap @@ -95,4 +98,158 @@ public class UserMap extends StorageObjectMap<IUser> implements IUserMap } return user; } + + @Override + public IUser matchUser(final String name, final boolean includeHidden, final boolean includeOffline) throws TooManyMatchesException + { + final Set<IUser> users = matchUsers(name, includeHidden, includeOffline); + if (users == null || users.isEmpty()) + { + return null; + } + else + { + if (users.size() > 1) + { + throw new TooManyMatchesException(); + } + else + { + return users.iterator().next(); + } + } + } + + @Override + public Set<IUser> matchUsers(final String name, final boolean includeHidden, final boolean includeOffline) + { + final String colorlessName = Util.stripColor(name); + final String[] search = colorlessName.split(","); + final boolean multisearch = search.length > 1; + final Set<IUser> result = new LinkedHashSet<IUser>(); + final String nicknamePrefix = Util.stripColor(getNickNamePrefix()); + for (String searchString : search) + { + if (searchString.isEmpty()) + { + continue; + } + + if (searchString.startsWith(nicknamePrefix)) + { + searchString = searchString.substring(nicknamePrefix.length()); + } + searchString = searchString.toLowerCase(Locale.ENGLISH); + final boolean multimatching = searchString.endsWith("*"); + if (multimatching) + { + searchString = searchString.substring(0, searchString.length() - 1); + } + Player match = null; + for (Player player : ess.getServer().getOnlinePlayers()) + { + if (player.getName().equalsIgnoreCase(searchString) + && (includeHidden || (includeOffline && player.getUser().isHidden()))) + { + match = player; + break; + } + } + if (match != null) + { + if (multimatching || multisearch) + { + result.add(match.getUser()); + } + else + { + return Collections.singleton(match.getUser()); + } + } + for (Player player : ess.getServer().getOnlinePlayers()) + { + final String nickname = player.getUser().getData().getNickname(); + if (nickname != null && !nickname.isEmpty() + && nickname.equalsIgnoreCase(searchString) + && (includeHidden || (includeOffline && player.getUser().isHidden()))) + { + if (multimatching || multisearch) + { + result.add(player.getUser()); + } + else + { + return Collections.singleton(player.getUser()); + } + } + } + if (includeOffline) + { + for (String playerName : getAllUniqueUsers()) + { + if (playerName.equals(searchString)) + { + match = getUser(playerName); + break; + } + } + if (match != null) + { + if (multimatching || multisearch) + { + result.add(match.getUser()); + } + else + { + return Collections.singleton(match.getUser()); + } + } + } + if (multimatching || match == null) + { + for (Player player : ess.getServer().getOnlinePlayers()) + { + if (player.getName().toLowerCase(Locale.ENGLISH).startsWith(searchString) + && (includeHidden || (includeOffline && player.getUser().isHidden()))) + { + result.add(player.getUser()); + break; + } + final String nickname = player.getUser().getData().getNickname(); + if (nickname != null && !nickname.isEmpty() + && nickname.toLowerCase(Locale.ENGLISH).startsWith(searchString) + && (includeHidden || (includeOffline && player.getUser().isHidden()))) + { + result.add(player.getUser()); + break; + } + } + if (includeOffline) + { + for (String playerName : getAllUniqueUsers()) + { + if (playerName.startsWith(searchString)) + { + result.add(getUser(playerName)); + break; + } + } + } + } + } + return result; + } + + private String getNickNamePrefix() + { + ess.getSettings().acquireReadLock(); + try + { + return ess.getSettings().getData().getChat().getNicknamePrefix(); + } + finally + { + ess.getSettings().unlock(); + } + } } diff --git a/Essentials/src/com/earth2me/essentials/utils/textreader/KeywordReplacer.java b/Essentials/src/com/earth2me/essentials/utils/textreader/KeywordReplacer.java index db6849704..52309a892 100644 --- a/Essentials/src/com/earth2me/essentials/utils/textreader/KeywordReplacer.java +++ b/Essentials/src/com/earth2me/essentials/utils/textreader/KeywordReplacer.java @@ -2,9 +2,9 @@ package com.earth2me.essentials.utils.textreader; import com.earth2me.essentials.api.IEssentials; import com.earth2me.essentials.api.IUser; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.api.server.Player; -import com.earth2me.essentials.api.server.IWorld; +import com.earth2me.essentials.api.server.World; import com.earth2me.essentials.utils.DescParseTickFormat; import java.text.DateFormat; import java.util.ArrayList; @@ -21,7 +21,7 @@ public class KeywordReplacer implements IText private final transient List<String> replaced; private final transient IEssentials ess; - public KeywordReplacer(final IText input, final ICommandSender sender, final IEssentials ess) + public KeywordReplacer(final IText input, final CommandSender sender, final IEssentials ess) { this.input = input; this.replaced = new ArrayList<String>(this.input.getLines().size()); @@ -29,7 +29,7 @@ public class KeywordReplacer implements IText replaceKeywords(sender); } - private void replaceKeywords(final ICommandSender sender) + private void replaceKeywords(final CommandSender sender) { String displayName, ipAddress, balance, mails, world; String worlds, online, unique, playerlist, date, time; @@ -68,7 +68,7 @@ public class KeywordReplacer implements IText unique = Integer.toString(ess.getUserMap().getUniqueUsers()); final StringBuilder worldsBuilder = new StringBuilder(); - for (IWorld w : ess.getServer().getWorlds()) + for (World w : ess.getServer().getWorlds()) { if (worldsBuilder.length() > 0) { diff --git a/Essentials/src/com/earth2me/essentials/utils/textreader/TextInput.java b/Essentials/src/com/earth2me/essentials/utils/textreader/TextInput.java index 513cb6f4f..77e8aadb5 100644 --- a/Essentials/src/com/earth2me/essentials/utils/textreader/TextInput.java +++ b/Essentials/src/com/earth2me/essentials/utils/textreader/TextInput.java @@ -3,7 +3,7 @@ package com.earth2me.essentials.utils.textreader; import com.earth2me.essentials.api.IEssentials; import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.api.InvalidNameException; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.api.server.Player; import com.earth2me.essentials.utils.Util; import java.io.*; @@ -20,7 +20,7 @@ public class TextInput implements IText private final transient long lastChange; private final static HashMap<String, SoftReference<TextInput>> cache = new HashMap<String, SoftReference<TextInput>>(); - public TextInput(final ICommandSender sender, final String filename, final boolean createFile, final IEssentials ess) throws IOException + public TextInput(final CommandSender sender, final String filename, final boolean createFile, final IEssentials ess) throws IOException { File file = null; diff --git a/Essentials/src/com/earth2me/essentials/utils/textreader/TextPager.java b/Essentials/src/com/earth2me/essentials/utils/textreader/TextPager.java index 780f4ab1c..117d6fd3c 100644 --- a/Essentials/src/com/earth2me/essentials/utils/textreader/TextPager.java +++ b/Essentials/src/com/earth2me/essentials/utils/textreader/TextPager.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.utils.textreader; import static com.earth2me.essentials.I18n._; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import java.util.List; import java.util.Locale; import java.util.Map; @@ -24,7 +24,7 @@ public class TextPager this.onePage = onePage; } - public void showPage(final String pageStr, final String chapterPageStr, final String commandName, final ICommandSender sender) + public void showPage(final String pageStr, final String chapterPageStr, final String commandName, final CommandSender sender) { List<String> lines = text.getLines(); List<String> chapters = text.getChapters(); diff --git a/Essentials/test/com/earth2me/essentials/testserver/Player.java b/Essentials/test/com/earth2me/essentials/testserver/Player.java index 24801f52b..b10073ee9 100644 --- a/Essentials/test/com/earth2me/essentials/testserver/Player.java +++ b/Essentials/test/com/earth2me/essentials/testserver/Player.java @@ -42,7 +42,7 @@ public class Player implements Player { } @Override - public IWorld getWorld() + public World getWorld() { throw new UnsupportedOperationException("Not supported yet."); } diff --git a/Essentials/test/com/earth2me/essentials/testserver/Server.java b/Essentials/test/com/earth2me/essentials/testserver/Server.java index d1da2712b..d070abcb6 100644 --- a/Essentials/test/com/earth2me/essentials/testserver/Server.java +++ b/Essentials/test/com/earth2me/essentials/testserver/Server.java @@ -1,9 +1,9 @@ package com.earth2me.essentials.testserver; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.api.server.Player; import com.earth2me.essentials.api.server.IServer; -import com.earth2me.essentials.api.server.IWorld; +import com.earth2me.essentials.api.server.World; import java.util.Collection; import java.util.Collections; import java.util.List; @@ -17,15 +17,15 @@ public class Server implements IServer { @Override - public List<IWorld> getWorlds() + public List<World> getWorlds() { - return Collections.<IWorld>singletonList(new World()); + return Collections.<World>singletonList(new World()); } @Override - public IWorld getWorld(final String name) + public World getWorld(final String name) { - final IWorld world = getWorlds().get(0); + final World world = getWorlds().get(0); if (name.equals(world.getName())) { return world; } else { @@ -51,13 +51,13 @@ public class Server implements IServer { } @Override - public ICommandSender getConsoleSender() + public CommandSender getConsoleSender() { throw new UnsupportedOperationException("Not supported yet."); } @Override - public void dispatchCommand(ICommandSender sender, String command) + public void dispatchCommand(CommandSender sender, String command) { throw new UnsupportedOperationException("Not supported yet."); } diff --git a/Essentials/test/com/earth2me/essentials/testserver/World.java b/Essentials/test/com/earth2me/essentials/testserver/World.java index 0fe076a39..9044b302e 100644 --- a/Essentials/test/com/earth2me/essentials/testserver/World.java +++ b/Essentials/test/com/earth2me/essentials/testserver/World.java @@ -1,10 +1,10 @@ package com.earth2me.essentials.testserver; -import com.earth2me.essentials.api.server.IWorld; +import com.earth2me.essentials.api.server.World; import com.earth2me.essentials.api.server.Location; import org.bukkit.TreeType; -public class World implements IWorld { +public class World implements World { @Override public String getName() diff --git a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandxmpp.java b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandxmpp.java index 0c9e8d91c..c11e212e7 100644 --- a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandxmpp.java +++ b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandxmpp.java @@ -1,7 +1,7 @@ package com.earth2me.essentials.xmpp; import com.earth2me.essentials.Console; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.commands.EssentialsCommand; import com.earth2me.essentials.commands.NotEnoughArgumentsException; import org.bukkit.command.CommandSender; @@ -11,7 +11,7 @@ import org.bukkit.entity.Player; public class Commandxmpp extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws NotEnoughArgumentsException + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws NotEnoughArgumentsException { if (args.length < 2) { diff --git a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandxmppspy.java b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandxmppspy.java index c5f846aa2..13d152306 100644 --- a/EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandxmppspy.java +++ b/EssentialsXMPP/src/com/earth2me/essentials/xmpp/Commandxmppspy.java @@ -1,6 +1,6 @@ package com.earth2me.essentials.xmpp; -import com.earth2me.essentials.api.server.ICommandSender; +import com.earth2me.essentials.api.server.CommandSender; import com.earth2me.essentials.commands.EssentialsCommand; import com.earth2me.essentials.commands.NotEnoughArgumentsException; import java.util.List; @@ -11,7 +11,7 @@ import org.bukkit.entity.Player; public class Commandxmppspy extends EssentialsCommand { @Override - protected void run(final ICommandSender sender, final String commandLabel, final String[] args) throws NotEnoughArgumentsException + protected void run(final CommandSender sender, final String commandLabel, final String[] args) throws NotEnoughArgumentsException { if (args.length < 1) { |