diff options
author | snowleo <schneeleo@gmail.com> | 2012-01-03 02:53:57 +0100 |
---|---|---|
committer | snowleo <schneeleo@gmail.com> | 2012-01-03 02:53:57 +0100 |
commit | a552b88172a545ddd7185d66b95398e464922f29 (patch) | |
tree | 455d7c8a4d91ef1652c7beb2efed6b28ed52f7b9 /EssentialsSpawn | |
parent | 801562ac2c0c64770eeaee5cc5815954cd5af72e (diff) | |
download | Essentials-a552b88172a545ddd7185d66b95398e464922f29.tar Essentials-a552b88172a545ddd7185d66b95398e464922f29.tar.gz Essentials-a552b88172a545ddd7185d66b95398e464922f29.tar.lz Essentials-a552b88172a545ddd7185d66b95398e464922f29.tar.xz Essentials-a552b88172a545ddd7185d66b95398e464922f29.zip |
I always forget these
Diffstat (limited to 'EssentialsSpawn')
-rw-r--r-- | EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandsetspawn.java | 8 | ||||
-rw-r--r-- | EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java | 27 |
2 files changed, 12 insertions, 23 deletions
diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandsetspawn.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandsetspawn.java index b9b2a70d5..036276770 100644 --- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandsetspawn.java +++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandsetspawn.java @@ -3,18 +3,12 @@ package com.earth2me.essentials.spawn; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.commands.EssentialsCommand; -import org.bukkit.Server; public class Commandsetspawn extends EssentialsCommand { - public Commandsetspawn() - { - super("setspawn"); - } - @Override - public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception + public void run(final IUser user, final String[] args) throws Exception { final String group = args.length > 0 ? getFinalArg(args, 0) : "default"; ((SpawnStorage)module).setSpawn(user.getLocation(), group); diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java index 5b95a8e66..b70a522fb 100644 --- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java +++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java @@ -6,26 +6,20 @@ import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.commands.EssentialsCommand; import com.earth2me.essentials.commands.NotEnoughArgumentsException; import org.bukkit.Location; -import org.bukkit.Server; import org.bukkit.command.CommandSender; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; public class Commandspawn extends EssentialsCommand { - public Commandspawn() - { - super("spawn"); - } - @Override - public void run(final Server server, final IUser user, final String commandLabel, final String[] args) throws Exception - { - final Trade charge = new Trade(this.getName(), ess); + public void run(final IUser user, final String[] args) throws Exception + { + final Trade charge = new Trade(commandName, ess); charge.isAffordableFor(user); if (args.length > 0 && user.isAuthorized("essentials.spawn.others")) { - final IUser otherUser = getPlayer(server, args, 0); + final IUser otherUser = getPlayer(args, 0); respawn(otherUser, null); if (!otherUser.equals(user)) { @@ -34,27 +28,28 @@ public class Commandspawn extends EssentialsCommand } } else - { + { respawn(user, null); } } @Override - protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception + protected void run(final CommandSender sender, final String[] args) throws Exception { if (args.length < 1) { throw new NotEnoughArgumentsException(); } - final IUser user = getPlayer(server, args, 0); + final IUser user = getPlayer(args, 0); respawn(user, null); user.sendMessage(_("teleportAtoB", user.getDisplayName(), "spawn")); sender.sendMessage(_("teleporting")); } - - private void respawn (final IUser user, final Trade charge) throws Exception { + + private void respawn(final IUser user, final Trade charge) throws Exception + { final SpawnStorage spawns = (SpawnStorage)this.module; final Location spawn = spawns.getSpawn(user.getGroup()); - user.getTeleport().teleport(spawn, charge, TeleportCause.COMMAND); + user.getTeleport().teleport(spawn, charge, TeleportCause.COMMAND); } } |