mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2025-01-07 16:57:50 +01:00
Fix teleport and set spawn command.
This commit is contained in:
parent
7b2a14c31f
commit
28304baa6e
@ -1,5 +1,6 @@
|
||||
package com.onarandombox.MultiverseCore.commands_acf;
|
||||
|
||||
import co.aikar.commands.BaseCommand;
|
||||
import co.aikar.commands.annotation.CommandAlias;
|
||||
import co.aikar.commands.annotation.CommandCompletion;
|
||||
import co.aikar.commands.annotation.CommandPermission;
|
||||
@ -24,29 +25,35 @@ public class SetSpawnCommand extends MultiverseCommand {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
//TODO: For some reason this doesnt work with coord args.
|
||||
@CommandAlias("mvsetspawn")
|
||||
@CommandPermission("multiverse.core.spawn.set")
|
||||
@Syntax("[world x y z [yaw pitch]]")
|
||||
@CommandCompletion("@MVWorlds")
|
||||
@Description("Sets the spawn for the current world.")
|
||||
public void onAliasSetSpawnCommand(@NotNull CommandSender sender,
|
||||
@NotNull @Flags("other,defaultself,fallbackself") Location location) {
|
||||
@CommandAlias("mv")
|
||||
public class SetSpawn extends BaseCommand {
|
||||
|
||||
doSpawnSet(sender, location);
|
||||
@Subcommand("setspawn")
|
||||
@CommandPermission("multiverse.core.spawn.set")
|
||||
@Syntax("[world x y z [yaw pitch]]")
|
||||
//TODO: Location tab complete doesnt work.
|
||||
@CommandCompletion("@MVWorlds")
|
||||
@Description("Sets the spawn for the current world.")
|
||||
public void onSetSpawnCommand(@NotNull CommandSender sender,
|
||||
@NotNull @Flags("other,defaultself,fallbackself") Location location) {
|
||||
|
||||
doSpawnSet(sender, location);
|
||||
}
|
||||
}
|
||||
|
||||
@CommandAlias("mv")
|
||||
@Subcommand("setspawn")
|
||||
@CommandPermission("multiverse.core.spawn.set")
|
||||
@Syntax("[world x y z [yaw pitch]]")
|
||||
//TODO: Location tab complete doesnt work.
|
||||
@CommandCompletion("@MVWorlds")
|
||||
@Description("Sets the spawn for the current world.")
|
||||
public void onSetSpawnCommand(@NotNull CommandSender sender,
|
||||
@NotNull @Flags("other,defaultself,fallbackself") Location location) {
|
||||
|
||||
doSpawnSet(sender, location);
|
||||
public class AliasSetSpawn extends BaseCommand {
|
||||
|
||||
@CommandAlias("mvsetspawn")
|
||||
@CommandPermission("multiverse.core.spawn.set")
|
||||
@Syntax("[world x y z [yaw pitch]]")
|
||||
@CommandCompletion("@MVWorlds")
|
||||
@Description("Sets the spawn for the current world.")
|
||||
public void onAliasSetSpawnCommand(@NotNull CommandSender sender,
|
||||
@NotNull @Flags("other,defaultself,fallbackself") Location location) {
|
||||
|
||||
doSpawnSet(sender, location);
|
||||
}
|
||||
}
|
||||
|
||||
private void doSpawnSet(@NotNull CommandSender sender, @NotNull Location location) {
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.onarandombox.MultiverseCore.commands_acf;
|
||||
|
||||
import co.aikar.commands.BaseCommand;
|
||||
import co.aikar.commands.annotation.CommandAlias;
|
||||
import co.aikar.commands.annotation.CommandCompletion;
|
||||
import co.aikar.commands.annotation.Description;
|
||||
@ -34,27 +35,33 @@ public class TeleportCommand extends MultiverseCommand {
|
||||
this.playerTeleporter = this.plugin.getSafeTTeleporter();
|
||||
}
|
||||
|
||||
@CommandAlias("mvtp")
|
||||
@Syntax("[player] <destination>")
|
||||
@CommandCompletion("@players|@MVWorlds @MVWorlds")
|
||||
@Description("Alias for /mv tp")
|
||||
public void doTeleportCommand(@NotNull CommandSender sender,
|
||||
@NotNull @Flags("other,defaultself,fallbackself") Player player,
|
||||
@NotNull @Single String destinationName) {
|
||||
@CommandAlias("mv")
|
||||
public class Teleport extends BaseCommand {
|
||||
@Subcommand("tp|teleport")
|
||||
@Syntax("[player] <destination>")
|
||||
@CommandCompletion("@players|@MVWorlds @MVWorlds")
|
||||
@Description("Allows you to the teleport to a location on your server!")
|
||||
public void doSameTeleportCommand(@NotNull CommandSender sender,
|
||||
@NotNull @Flags("other,defaultself,fallbackself") Player player,
|
||||
@NotNull @Single String destinationName) {
|
||||
|
||||
doTeleport(sender, player, destinationName);
|
||||
doTeleport(sender, player, destinationName);
|
||||
}
|
||||
}
|
||||
|
||||
@CommandAlias("mv")
|
||||
@Subcommand("tp|teleport")
|
||||
@Syntax("[player] <destination>")
|
||||
@CommandCompletion("@players|@MVWorlds @MVWorlds")
|
||||
@Description("Allows you to the teleport to a location on your server!")
|
||||
public void doSameTeleportCommand(@NotNull CommandSender sender,
|
||||
public class AliasTeleport extends BaseCommand {
|
||||
|
||||
@CommandAlias("mvtp")
|
||||
@Syntax("[player] <destination>")
|
||||
//TODO: playerOnly flag
|
||||
@CommandCompletion("@players|@MVWorlds @MVWorlds")
|
||||
@Description("Alias for /mv tp")
|
||||
public void doTeleportCommand(@NotNull CommandSender sender,
|
||||
@NotNull @Flags("other,defaultself,fallbackself") Player player,
|
||||
@NotNull @Single String destinationName) {
|
||||
|
||||
doTeleport(sender, player, destinationName);
|
||||
doTeleport(sender, player, destinationName);
|
||||
}
|
||||
}
|
||||
|
||||
private void doTeleport(@NotNull CommandSender teleporter,
|
||||
|
Loading…
Reference in New Issue
Block a user