summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-04-09 00:58:41 +0000
committersnowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-04-09 00:58:41 +0000
commit8dda02da99671cc8a2305bc4119ac3d8a2354c61 (patch)
treeadfee9fcc93b9deef2d1f33b23d88b352f492528
parent76ba31d1a3ca54ffe78b9a63c80d1f6080cea688 (diff)
downloadEssentials-8dda02da99671cc8a2305bc4119ac3d8a2354c61.tar
Essentials-8dda02da99671cc8a2305bc4119ac3d8a2354c61.tar.gz
Essentials-8dda02da99671cc8a2305bc4119ac3d8a2354c61.tar.lz
Essentials-8dda02da99671cc8a2305bc4119ac3d8a2354c61.tar.xz
Essentials-8dda02da99671cc8a2305bc4119ac3d8a2354c61.zip
[trunk] tpall command
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1159 e251c2fe-e539-e718-e476-b85c1f46cddb
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtpall.java45
-rw-r--r--Essentials/src/plugin.yml3
2 files changed, 48 insertions, 0 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java
new file mode 100644
index 000000000..5793b7978
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java
@@ -0,0 +1,45 @@
+package com.earth2me.essentials.commands;
+
+import org.bukkit.Server;
+import com.earth2me.essentials.Essentials;
+import com.earth2me.essentials.User;
+import org.bukkit.entity.Player;
+
+
+public class Commandtpall extends EssentialsCommand
+{
+ public Commandtpall()
+ {
+ super("tpall");
+ }
+
+ @Override
+ public void run(Server server, Essentials parent, User user, String commandLabel, String[] args) throws Exception
+ {
+ if (args.length < 1)
+ {
+ user.charge(this);
+ user.sendMessage("§7Teleporting...");
+ for (Player player : server.getOnlinePlayers()) {
+ User p = User.get(player);
+ if (p == user) {
+ continue;
+ }
+ p.teleportToNow(user);
+ }
+ }
+ else
+ {
+ User p = getPlayer(server, args, 0);
+ user.charge(this);
+ user.sendMessage("§7Teleporting...");
+ for (Player player : server.getOnlinePlayers()) {
+ User u = User.get(player);
+ if (p == u) {
+ continue;
+ }
+ u.teleportToNow(p);
+ }
+ }
+ }
+}
diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml
index e91caeb65..8bd096375 100644
--- a/Essentials/src/plugin.yml
+++ b/Essentials/src/plugin.yml
@@ -207,6 +207,9 @@ commands:
tpahere:
description: Request that the specified player teleport to you.
usage: /<command> <player>
+ tpall:
+ desctiption: Teleport all online players to another player.
+ usage: /<command> <player>
tpdeny:
description: Reject a teleport request.
usage: /<command>