mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-22 10:36:06 +01:00
Cleanup to various commands.
This commit is contained in:
parent
532469145d
commit
42f0965eca
@ -25,7 +25,7 @@ public class ConfigCommand extends MultiverseCommand {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Subcommand("show")
|
||||
@Subcommand("list")
|
||||
@Description("Show multiverse config values.")
|
||||
public void onShowCommand(@NotNull CommandSender sender) {
|
||||
List<String> configList = new ArrayList<>();
|
||||
|
@ -23,14 +23,14 @@ public class CoordCommand extends MultiverseCommand {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Subcommand("coord")
|
||||
@Subcommand("coord|coordinate")
|
||||
@CommandPermission("multiverse.core.coord.self")
|
||||
@Description("Detailed information on the your where abouts.")
|
||||
public void onOtherCoordCommand(@NotNull Player player) {
|
||||
showCoordInfo(player, player);
|
||||
}
|
||||
|
||||
@Subcommand("coord")
|
||||
@Subcommand("coord|coordinate")
|
||||
@CommandPermission("multiverse.core.coord.other")
|
||||
@Syntax("[player]")
|
||||
@CommandCompletion("@players")
|
||||
@ -44,7 +44,7 @@ public class CoordCommand extends MultiverseCommand {
|
||||
private void showCoordInfo(@NotNull CommandSender sender,
|
||||
@NotNull Player player) {
|
||||
|
||||
//TODO: Should somehow clean this up
|
||||
//TODO: Possible to move to CommandContext or something?
|
||||
MultiverseWorld world = this.plugin.getMVWorldManager().getMVWorld(player.getWorld());
|
||||
if (world == null) {
|
||||
this.plugin.showNotMVWorldMessage(sender, player.getWorld().getName());
|
||||
|
@ -29,7 +29,6 @@ public class CreateCommand extends MultiverseCommand {
|
||||
@CommandCompletion(" @environments")
|
||||
@Description("Creates a new world and loads it.")
|
||||
public void onCreateCommand(@NotNull CommandSender sender,
|
||||
//TODO: Cleanup/fix conditions here
|
||||
@NotNull @Flags("trim") @Conditions("creatableWorldName") String worldName,
|
||||
@NotNull World.Environment environment,
|
||||
@NotNull WorldFlags flags) {
|
||||
|
@ -16,6 +16,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@CommandAlias("mv")
|
||||
@Subcommand("gamerule")
|
||||
public class GameRuleCommand extends MultiverseCommand {
|
||||
|
||||
public GameRuleCommand(MultiverseCore plugin) {
|
||||
@ -23,7 +24,7 @@ public class GameRuleCommand extends MultiverseCommand {
|
||||
}
|
||||
|
||||
//TODO: Should it be `gamerule list` instead?
|
||||
@Subcommand("gamerules")
|
||||
@Subcommand("list")
|
||||
@CommandPermission("multiverse.core.gamerule.list")
|
||||
@Syntax("[world]")
|
||||
@CommandCompletion("@MVWorlds")
|
||||
@ -51,7 +52,7 @@ public class GameRuleCommand extends MultiverseCommand {
|
||||
}
|
||||
|
||||
//TODO: Should it be `gamerule set` instead?
|
||||
@Subcommand("gamerule")
|
||||
@Subcommand("set")
|
||||
@CommandPermission("multiverse.core.gamerule.set")
|
||||
@Syntax("<rule> <value> [world]")
|
||||
@CommandCompletion("@gameRules")
|
||||
|
@ -27,7 +27,7 @@ public class PurgeCommand extends MultiverseCommand {
|
||||
}
|
||||
|
||||
@Subcommand("purgeall")
|
||||
@CommandPermission("multiverse.core.purge")
|
||||
@CommandPermission("multiverse.core.purge.all")
|
||||
@Syntax("<all|animals|monsters|mobname>")
|
||||
@CommandCompletion("all|animals|monsters|@livingEntities")
|
||||
@Description("Removed the specified type of mob from all worlds.")
|
||||
|
@ -41,7 +41,6 @@ public class SetSpawnCommand extends MultiverseCommand {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class AliasSetSpawn extends BaseCommand {
|
||||
|
||||
@CommandAlias("mvsetspawn")
|
||||
|
@ -35,7 +35,7 @@ public class MVCommandCompletions extends PaperCommandCompletions {
|
||||
registerAsyncCompletion("MVWorlds", this::suggestMVWorlds);
|
||||
registerAsyncCompletion("unloadedWorlds", this::suggestUnloadedWorlds);
|
||||
registerAsyncCompletion("potentialWorlds", this::suggestPotentialWorlds);
|
||||
registerCompletion("location", this::suggestLocation);
|
||||
registerAsyncCompletion("location", this::suggestLocation);
|
||||
registerAsyncCompletion("MVConfigs", this::suggestMVConfig); //TODO: Change to static
|
||||
registerStaticCompletion("gameRules", suggestGameRules());
|
||||
registerStaticCompletion("environments", suggestEnvironments());
|
||||
|
@ -137,7 +137,7 @@ public class MVCommandContexts extends PaperCommandContexts {
|
||||
private Player derivePlayer(@NotNull BukkitCommandExecutionContext context) {
|
||||
boolean mustBeSelf = context.hasFlag("onlyself");
|
||||
String error = (mustBeSelf)
|
||||
? "You cannot run this command from console."
|
||||
? "You must be a player to run this command."
|
||||
: "You need to specify a player from console.";
|
||||
|
||||
if (mustBeSelf || !context.hasFlag("other")) {
|
||||
|
Loading…
Reference in New Issue
Block a user