mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-22 10:36:06 +01:00
Add remove command.
This commit is contained in:
parent
5483988276
commit
d494017186
@ -35,6 +35,7 @@ import com.onarandombox.MultiverseCore.api.SafeTTeleporter;
|
||||
import com.onarandombox.MultiverseCore.commands_acf.CoordCommand;
|
||||
import com.onarandombox.MultiverseCore.commands_acf.CreateCommand;
|
||||
import com.onarandombox.MultiverseCore.commands_acf.ReloadCommand;
|
||||
import com.onarandombox.MultiverseCore.commands_acf.RemoveCommand;
|
||||
import com.onarandombox.MultiverseCore.commands_acf.SpawnCommand;
|
||||
import com.onarandombox.MultiverseCore.commands_acf.UsageCommand;
|
||||
import com.onarandombox.MultiverseCore.commands_helper.CommandTools;
|
||||
@ -738,6 +739,7 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
|
||||
this.commandHandler.registerCommand(new CoordCommand(this));
|
||||
this.commandHandler.registerCommand(new SpawnCommand(this));
|
||||
this.commandHandler.registerCommand(new ReloadCommand(this));
|
||||
this.commandHandler.registerCommand(new RemoveCommand(this));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -0,0 +1,36 @@
|
||||
package com.onarandombox.MultiverseCore.commands_acf;
|
||||
|
||||
import co.aikar.commands.annotation.CommandAlias;
|
||||
import co.aikar.commands.annotation.CommandCompletion;
|
||||
import co.aikar.commands.annotation.CommandPermission;
|
||||
import co.aikar.commands.annotation.Description;
|
||||
import co.aikar.commands.annotation.Flags;
|
||||
import co.aikar.commands.annotation.Subcommand;
|
||||
import co.aikar.commands.annotation.Syntax;
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@CommandAlias("mv")
|
||||
public class RemoveCommand extends MultiverseCommand {
|
||||
|
||||
public RemoveCommand(MultiverseCore plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Subcommand("remove")
|
||||
@CommandPermission("multiverse.core.spawn.other")
|
||||
@CommandCompletion("@MVWorlds|@unloadedWorlds")
|
||||
@Syntax("<world>")
|
||||
@Description("Unloads a world from Multiverse and removes it from worlds.yml, this does NOT DELETE the world folder.")
|
||||
public void onRemoveCommand(@NotNull CommandSender sender,
|
||||
@NotNull @Flags("other") MultiverseWorld world) {
|
||||
|
||||
String resultMessage = (this.plugin.getMVWorldManager().removeWorldFromConfig(world.getName()))
|
||||
? "World removed from config!"
|
||||
: "Error trying to remove world from config!";
|
||||
|
||||
sender.sendMessage(resultMessage);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user