mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2025-01-06 00:08:04 +01:00
i18n: Teleport command
This commit is contained in:
parent
216adf5fa9
commit
a9896df2a7
@ -10,6 +10,7 @@ import co.aikar.commands.annotation.Subcommand;
|
||||
import co.aikar.commands.annotation.Syntax;
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import com.onarandombox.MultiverseCore.destination.ParsedDestination;
|
||||
import com.onarandombox.MultiverseCore.utils.MVCorei18n;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandAlias("mv")
|
||||
@ -21,23 +22,23 @@ public class TeleportCommand extends MultiverseCoreCommand {
|
||||
@Subcommand("teleport|tp")
|
||||
@CommandCompletion("@players|@mvworlds:playerOnly|@destinations:playerOnly @mvworlds|@destinations")
|
||||
@Syntax("[player] <destination>")
|
||||
@Description("Allows you to the teleport to a location on your server!")
|
||||
@Description("{@@mv-core.teleport.description}")
|
||||
public void onTeleportCommand(BukkitCommandIssuer issuer,
|
||||
|
||||
@Flags("resolve=issuerAware")
|
||||
@Syntax("[player]")
|
||||
@Description("Target player to teleport.")
|
||||
@Description("{@@mv-core.teleport.player.description}")
|
||||
Player[] players,
|
||||
|
||||
@Syntax("<destination>")
|
||||
@Description("Location, can be a world name.")
|
||||
@Description("{@@mv-core.teleport.destination.description}")
|
||||
ParsedDestination<?> destination
|
||||
) {
|
||||
// TODO Add warning if teleporting too many players at once.
|
||||
for (Player player : players) {
|
||||
issuer.sendMessage("Teleporting "
|
||||
+ (issuer.getPlayer() == player ? "you" : player.getName())
|
||||
+ " to " + destination + "...");
|
||||
issuer.sendInfo(MVCorei18n.TELEPORT_SUCCESS,
|
||||
"{player}", issuer.getPlayer() == player ? "you" : player.getName(),
|
||||
"{destination}", destination.toString());
|
||||
this.plugin.getDestinationsProvider().playerTeleport(issuer, player, destination);
|
||||
}
|
||||
}
|
||||
|
@ -62,6 +62,9 @@ public enum MVCorei18n implements MessageKeyProvider {
|
||||
// root MV command
|
||||
ROOT_TITLE,
|
||||
ROOT_HELP,
|
||||
|
||||
// teleport command
|
||||
TELEPORT_SUCCESS,
|
||||
DEBUG_INFO_OFF,
|
||||
DEBUG_INFO_ON;
|
||||
|
||||
|
@ -73,6 +73,11 @@ mv-core.remove.success=World '{world}' is removed from config!
|
||||
|
||||
mv-core.root.title={name} version {version}
|
||||
mv-core.root.help=See /mv help for commands available.
|
||||
|
||||
mv-core.teleport.description=Allows you to teleport to a location on your server!
|
||||
mv-core.teleport.player.description=Target player to teleport.
|
||||
mv-core.teleport.destination.description=Location, can be a world name.
|
||||
mv-core.teleport.success=Teleporting {player} to {destination}...
|
||||
mv-core.debug.info.description=Show the current debug level.
|
||||
mv-core.debug.info.off=&fMultiverse Debug mode is &cOFF&f.
|
||||
mv-core.debug.info.on=&fMultiverse Debug mode is at &alevel {level}&f.
|
||||
|
Loading…
Reference in New Issue
Block a user