mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-11 09:05:01 +02:00
Adding /tpaall - Teleport here request to all players.
This commit is contained in:
@@ -97,8 +97,7 @@ public class Commandtime extends EssentialsCommand
|
|||||||
|
|
||||||
// Inform the sender of the change
|
// Inform the sender of the change
|
||||||
sender.sendMessage("");
|
sender.sendMessage("");
|
||||||
sender.sendMessage(colorDefault + "The time was set to");
|
sender.sendMessage(colorDefault + "The time was set to " + DescParseTickFormat.format(ticks));
|
||||||
sender.sendMessage(DescParseTickFormat.format(ticks));
|
|
||||||
|
|
||||||
StringBuilder msg = new StringBuilder();
|
StringBuilder msg = new StringBuilder();
|
||||||
msg.append(colorDefault);
|
msg.append(colorDefault);
|
||||||
|
@@ -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());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -33,7 +33,7 @@ public class Commandtpaccept extends EssentialsCommand
|
|||||||
charge.isAffordableFor(p);
|
charge.isAffordableFor(p);
|
||||||
}
|
}
|
||||||
user.sendMessage(Util.i18n("requestAccepted"));
|
user.sendMessage(Util.i18n("requestAccepted"));
|
||||||
p.sendMessage(Util.i18n("requestAccepted"));
|
p.sendMessage(Util.format("requestAcceptedFrom", user.getDisplayName()));
|
||||||
|
|
||||||
if (user.isTeleportRequestHere())
|
if (user.isTeleportRequestHere())
|
||||||
{
|
{
|
||||||
|
@@ -23,7 +23,7 @@ public class Commandtpdeny extends EssentialsCommand
|
|||||||
|
|
||||||
charge(user);
|
charge(user);
|
||||||
user.sendMessage(Util.i18n("requestDenied"));
|
user.sendMessage(Util.i18n("requestDenied"));
|
||||||
p.sendMessage(Util.i18n("requestDenied"));
|
p.sendMessage(Util.format("requestDeniedFrom", user.getDisplayName()));
|
||||||
user.requestTeleport(null, false);
|
user.requestTeleport(null, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -230,7 +230,9 @@ protectionOwner = \u00a76[EssentialsProtect] Protection owner: {0}
|
|||||||
questionFormat = \u00a77[Question]\u00a7f {0}
|
questionFormat = \u00a77[Question]\u00a7f {0}
|
||||||
reloadAllPlugins = \u00a77Reloaded all plugins.
|
reloadAllPlugins = \u00a77Reloaded all plugins.
|
||||||
requestAccepted = \u00a77Teleport request accepted.
|
requestAccepted = \u00a77Teleport request accepted.
|
||||||
|
requestAcceptedFrom = \u00a77{0} accepted your teleport request.
|
||||||
requestDenied = \u00a77Teleport request denied.
|
requestDenied = \u00a77Teleport request denied.
|
||||||
|
requestDeniedFrom = \u00a77{0} denied your teleport request.
|
||||||
requestSent = \u00a77Request sent to {0}\u00a77.
|
requestSent = \u00a77Request sent to {0}\u00a77.
|
||||||
returnPlayerToJailError = Error occured when trying to return player to jail.
|
returnPlayerToJailError = Error occured when trying to return player to jail.
|
||||||
second = second
|
second = second
|
||||||
@@ -249,10 +251,11 @@ suicideMessage = \u00a77Goodbye Cruel World...
|
|||||||
suicideSuccess = \u00a77{0} took their own life
|
suicideSuccess = \u00a77{0} took their own life
|
||||||
takenFromAccount = \u00a7c{0} has been taken from your account.
|
takenFromAccount = \u00a7c{0} has been taken from your account.
|
||||||
takenFromOthersAccount = \u00a7c{0} has been taken from {1} account.
|
takenFromOthersAccount = \u00a7c{0} has been taken from {1} account.
|
||||||
|
teleportAAll = \u00a77Teleporting request sent to all players...
|
||||||
teleportAll = \u00a77Teleporting all players...
|
teleportAll = \u00a77Teleporting all players...
|
||||||
teleportAtoB = \u00a77{0}\u00a77 teleported you to {1}\u00a77.
|
teleportAtoB = \u00a77{0}\u00a77 teleported you to {1}\u00a77.
|
||||||
teleportDisabled = {0} has teleportation disabled.
|
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
|
teleportNewPlayerError = Failed to teleport new player
|
||||||
teleportRequest = \u00a7c{0}\u00a7c has requested to teleport to you.
|
teleportRequest = \u00a7c{0}\u00a7c has requested to teleport to you.
|
||||||
teleportTop = \u00a77Teleporting to top.
|
teleportTop = \u00a77Teleporting to top.
|
||||||
|
@@ -230,7 +230,9 @@ protectionOwner = \u00a76[EssentialsProtect] Protection owner: {0}
|
|||||||
questionFormat = \u00a77[Question]\u00a7f {0}
|
questionFormat = \u00a77[Question]\u00a7f {0}
|
||||||
reloadAllPlugins = \u00a77Reloaded all plugins.
|
reloadAllPlugins = \u00a77Reloaded all plugins.
|
||||||
requestAccepted = \u00a77Teleport request accepted.
|
requestAccepted = \u00a77Teleport request accepted.
|
||||||
|
requestAcceptedFrom = \u00a77{0} accepted your teleport request.
|
||||||
requestDenied = \u00a77Teleport request denied.
|
requestDenied = \u00a77Teleport request denied.
|
||||||
|
requestDeniedFrom = \u00a77{0} denied your teleport request
|
||||||
requestSent = \u00a77Request sent to {0}\u00a77.
|
requestSent = \u00a77Request sent to {0}\u00a77.
|
||||||
returnPlayerToJailError = Error occured when trying to return player to jail.
|
returnPlayerToJailError = Error occured when trying to return player to jail.
|
||||||
second = second
|
second = second
|
||||||
@@ -252,7 +254,7 @@ takenFromOthersAccount = \u00a7c{0} has been taken from {1} account.
|
|||||||
teleportAll = \u00a77Teleporting all players...
|
teleportAll = \u00a77Teleporting all players...
|
||||||
teleportAtoB = \u00a77{0}\u00a77 teleported you to {1}\u00a77.
|
teleportAtoB = \u00a77{0}\u00a77 teleported you to {1}\u00a77.
|
||||||
teleportDisabled = {0} has teleportation disabled.
|
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
|
teleportNewPlayerError = Failed to teleport new player
|
||||||
teleportRequest = \u00a7c{0}\u00a7c has requested to teleport to you.
|
teleportRequest = \u00a7c{0}\u00a7c has requested to teleport to you.
|
||||||
teleportTop = \u00a77Teleporting to top.
|
teleportTop = \u00a77Teleporting to top.
|
||||||
|
@@ -293,6 +293,9 @@ commands:
|
|||||||
tpa:
|
tpa:
|
||||||
description: Request to teleport to the specified player.
|
description: Request to teleport to the specified player.
|
||||||
usage: /<command> <player>
|
usage: /<command> <player>
|
||||||
|
tpaall:
|
||||||
|
description: Requests all players online to teleport to you.
|
||||||
|
usage: /<command> <player>
|
||||||
tpaccept:
|
tpaccept:
|
||||||
description: Accepts a teleport request.
|
description: Accepts a teleport request.
|
||||||
usage: /<command>
|
usage: /<command>
|
||||||
|
Reference in New Issue
Block a user