mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-10 18:38:18 +01:00
[trunk] tpall command
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1159 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
parent
76ba31d1a3
commit
8dda02da99
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -207,6 +207,9 @@ commands:
|
|||||||
tpahere:
|
tpahere:
|
||||||
description: Request that the specified player teleport to you.
|
description: Request that the specified player teleport to you.
|
||||||
usage: /<command> <player>
|
usage: /<command> <player>
|
||||||
|
tpall:
|
||||||
|
desctiption: Teleport all online players to another player.
|
||||||
|
usage: /<command> <player>
|
||||||
tpdeny:
|
tpdeny:
|
||||||
description: Reject a teleport request.
|
description: Reject a teleport request.
|
||||||
usage: /<command>
|
usage: /<command>
|
||||||
|
Loading…
Reference in New Issue
Block a user