diff options
Diffstat (limited to 'Essentials/src/com/earth2me/essentials/api')
-rw-r--r-- | Essentials/src/com/earth2me/essentials/api/ICommandHandler.java | 6 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/api/IEssentials.java | 4 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/api/IPermission.java | 4 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/api/IReplyTo.java | 6 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/api/IUser.java | 6 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/api/IUserMap.java | 6 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/api/server/CommandSender.java (renamed from Essentials/src/com/earth2me/essentials/api/server/ICommandSender.java) | 2 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/api/server/IServer.java | 8 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/api/server/IWorld.java | 24 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/api/server/Location.java | 8 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/api/server/Player.java | 4 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/api/server/World.java | 26 |
12 files changed, 56 insertions, 48 deletions
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(); +} |