summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2011-08-17 13:46:27 +0100
committerKHobbits <rob@khobbits.co.uk>2011-08-17 14:19:47 +0100
commit8ff405f2fee0fa7171008c8237bb16123b309977 (patch)
treebf67f6211ca010dd16ce9601afdc0e0b7e15420e
parent376d206d2b93a4181e2b56b47c268f9672b46474 (diff)
downloadEssentials-8ff405f2fee0fa7171008c8237bb16123b309977.tar
Essentials-8ff405f2fee0fa7171008c8237bb16123b309977.tar.gz
Essentials-8ff405f2fee0fa7171008c8237bb16123b309977.tar.lz
Essentials-8ff405f2fee0fa7171008c8237bb16123b309977.tar.xz
Essentials-8ff405f2fee0fa7171008c8237bb16123b309977.zip
Adding /tpaall - Teleport here request to all players.
-rwxr-xr-xEssentials/src/com/earth2me/essentials/commands/Commandtime.java3
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtpaall.java61
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtpdeny.java2
-rw-r--r--Essentials/src/messages.properties5
-rw-r--r--Essentials/src/messages_en.properties4
-rw-r--r--Essentials/src/plugin.yml3
7 files changed, 74 insertions, 6 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtime.java b/Essentials/src/com/earth2me/essentials/commands/Commandtime.java
index 23f9138a9..331fff019 100755
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtime.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtime.java
@@ -97,8 +97,7 @@ public class Commandtime extends EssentialsCommand
// Inform the sender of the change
sender.sendMessage("");
- sender.sendMessage(colorDefault + "The time was set to");
- sender.sendMessage(DescParseTickFormat.format(ticks));
+ sender.sendMessage(colorDefault + "The time was set to " + DescParseTickFormat.format(ticks));
StringBuilder msg = new StringBuilder();
msg.append(colorDefault);
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpaall.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpaall.java
new file mode 100644
index 000000000..780e75e1f
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpaall.java
@@ -0,0 +1,61 @@
+package com.earth2me.essentials.commands;
+
+import org.bukkit.Server;
+import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+
+
+public class Commandtpaall extends EssentialsCommand
+{
+ public Commandtpaall()
+ {
+ super("tpaall");
+ }
+
+ @Override
+ public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
+ {
+ if (args.length < 1)
+ {
+ if (sender instanceof Player)
+ {
+ charge(sender);
+ teleportAAllPlayers(server, sender, ess.getUser(sender));
+ return;
+ }
+ throw new NotEnoughArgumentsException();
+ }
+
+ User p = getPlayer(server, args, 0);
+ charge(sender);
+ teleportAAllPlayers(server, sender, p);
+ }
+
+ private void teleportAAllPlayers(Server server, CommandSender sender, User p)
+ {
+ sender.sendMessage(Util.i18n("teleportAAll"));
+ for (Player player : server.getOnlinePlayers())
+ {
+ User u = ess.getUser(player);
+ if (p == u)
+ {
+ continue;
+ }
+ if (!u.isTeleportEnabled())
+ {
+ continue;
+ }
+ try
+ {
+ u.requestTeleport(p, true);
+ u.sendMessage(Util.format("teleportHereRequest", p.getDisplayName()));
+ }
+ catch (Exception ex)
+ {
+ ess.showError(sender, ex, getName());
+ }
+ }
+ }
+}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java
index 0cba80020..043f23172 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java
@@ -33,7 +33,7 @@ public class Commandtpaccept extends EssentialsCommand
charge.isAffordableFor(p);
}
user.sendMessage(Util.i18n("requestAccepted"));
- p.sendMessage(Util.i18n("requestAccepted"));
+ p.sendMessage(Util.format("requestAcceptedFrom", user.getDisplayName()));
if (user.isTeleportRequestHere())
{
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpdeny.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpdeny.java
index 097ea1fdd..e31d7ae3c 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtpdeny.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpdeny.java
@@ -23,7 +23,7 @@ public class Commandtpdeny extends EssentialsCommand
charge(user);
user.sendMessage(Util.i18n("requestDenied"));
- p.sendMessage(Util.i18n("requestDenied"));
+ p.sendMessage(Util.format("requestDeniedFrom", user.getDisplayName()));
user.requestTeleport(null, false);
}
}
diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties
index bdb2d45a8..9bbcd7a87 100644
--- a/Essentials/src/messages.properties
+++ b/Essentials/src/messages.properties
@@ -230,7 +230,9 @@ protectionOwner = \u00a76[EssentialsProtect] Protection owner: {0}
questionFormat = \u00a77[Question]\u00a7f {0}
reloadAllPlugins = \u00a77Reloaded all plugins.
requestAccepted = \u00a77Teleport request accepted.
+requestAcceptedFrom = \u00a77{0} accepted your teleport request.
requestDenied = \u00a77Teleport request denied.
+requestDeniedFrom = \u00a77{0} denied your teleport request.
requestSent = \u00a77Request sent to {0}\u00a77.
returnPlayerToJailError = Error occured when trying to return player to jail.
second = second
@@ -249,10 +251,11 @@ suicideMessage = \u00a77Goodbye Cruel World...
suicideSuccess = \u00a77{0} took their own life
takenFromAccount = \u00a7c{0} has been taken from your account.
takenFromOthersAccount = \u00a7c{0} has been taken from {1} account.
+teleportAAll = \u00a77Teleporting request sent to all players...
teleportAll = \u00a77Teleporting all players...
teleportAtoB = \u00a77{0}\u00a77 teleported you to {1}\u00a77.
teleportDisabled = {0} has teleportation disabled.
-teleportHereRequest = \u00a7c{0}\u00a7c has requested that you teleport to him/her.
+teleportHereRequest = \u00a7c{0}\u00a7c has requested that you teleport to them.
teleportNewPlayerError = Failed to teleport new player
teleportRequest = \u00a7c{0}\u00a7c has requested to teleport to you.
teleportTop = \u00a77Teleporting to top.
diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties
index 1da3bc4a5..84a843dc7 100644
--- a/Essentials/src/messages_en.properties
+++ b/Essentials/src/messages_en.properties
@@ -230,7 +230,9 @@ protectionOwner = \u00a76[EssentialsProtect] Protection owner: {0}
questionFormat = \u00a77[Question]\u00a7f {0}
reloadAllPlugins = \u00a77Reloaded all plugins.
requestAccepted = \u00a77Teleport request accepted.
+requestAcceptedFrom = \u00a77{0} accepted your teleport request.
requestDenied = \u00a77Teleport request denied.
+requestDeniedFrom = \u00a77{0} denied your teleport request
requestSent = \u00a77Request sent to {0}\u00a77.
returnPlayerToJailError = Error occured when trying to return player to jail.
second = second
@@ -252,7 +254,7 @@ takenFromOthersAccount = \u00a7c{0} has been taken from {1} account.
teleportAll = \u00a77Teleporting all players...
teleportAtoB = \u00a77{0}\u00a77 teleported you to {1}\u00a77.
teleportDisabled = {0} has teleportation disabled.
-teleportHereRequest = \u00a7c{0}\u00a7c has requested that you teleport to him/her.
+teleportHereRequest = \u00a7c{0}\u00a7c has requested that you teleport to them.
teleportNewPlayerError = Failed to teleport new player
teleportRequest = \u00a7c{0}\u00a7c has requested to teleport to you.
teleportTop = \u00a77Teleporting to top.
diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml
index 9c0d51d71..4712203f6 100644
--- a/Essentials/src/plugin.yml
+++ b/Essentials/src/plugin.yml
@@ -293,6 +293,9 @@ commands:
tpa:
description: Request to teleport to the specified player.
usage: /<command> <player>
+ tpaall:
+ description: Requests all players online to teleport to you.
+ usage: /<command> <player>
tpaccept:
description: Accepts a teleport request.
usage: /<command>