mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-22 02:25:41 +01:00
feat: Add ACF dependency and prep command migration
This commit is contained in:
parent
9d34e5d75c
commit
3fb99bc156
@ -69,7 +69,7 @@
|
||||
<module name="TypeName"/>
|
||||
<module name="AvoidStarImport">
|
||||
<property name="severity" value="warning"/>
|
||||
<property name="excludes" value="com.onarandombox.MultiverseCore.utils,com.onarandombox.MultiverseCore.configuration,com.onarandombox.MultiverseCore.commands,com.onarandombox.MultiverseCore.destination"/>
|
||||
<property name="excludes" value="com.onarandombox.MultiverseCore.utils,com.onarandombox.MultiverseCore.configuration,com.onarandombox.MultiverseCore.commandsold,com.onarandombox.MultiverseCore.destination"/>
|
||||
</module>
|
||||
<module name="IllegalImport"/>
|
||||
<module name="RedundantImport"/>
|
||||
|
18
pom.xml
18
pom.xml
@ -34,6 +34,10 @@
|
||||
<id>minebench-repo</id>
|
||||
<url>https://repo.minebench.de/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>aikar</id>
|
||||
<url>https://repo.aikar.co/content/groups/aikar/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<pluginRepositories>
|
||||
@ -154,6 +158,7 @@
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>3.0.0-M3</version>
|
||||
<configuration>
|
||||
<skipTests>true</skipTests>
|
||||
<excludes>
|
||||
<exclude>**/TestCommandSender.java</exclude>
|
||||
<exclude>**/TestInstanceCreator.java</exclude>
|
||||
@ -251,6 +256,14 @@
|
||||
<pattern>de.themoep.idconverter</pattern>
|
||||
<shadedPattern>com.onarandombox.idconverter</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>co.aikar.commands</pattern>
|
||||
<shadedPattern>com.onarandombox.acf</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>co.aikar.locales</pattern>
|
||||
<shadedPattern>com.onarandombox.locales</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
</configuration>
|
||||
</execution>
|
||||
@ -307,6 +320,11 @@
|
||||
</dependency>
|
||||
<!-- End of Economy Dependency -->
|
||||
<!-- Start of CommandHandler Dependency -->
|
||||
<dependency>
|
||||
<groupId>co.aikar</groupId>
|
||||
<artifactId>acf-paper</artifactId>
|
||||
<version>0.5.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.pneumaticraft.commandhandler</groupId>
|
||||
<artifactId>CommandHandler</artifactId>
|
||||
|
@ -33,41 +33,42 @@ import com.onarandombox.MultiverseCore.api.MVWorldManager;
|
||||
import com.onarandombox.MultiverseCore.api.MultiverseCoreConfig;
|
||||
import com.onarandombox.MultiverseCore.api.MultiverseMessaging;
|
||||
import com.onarandombox.MultiverseCore.api.SafeTTeleporter;
|
||||
import com.onarandombox.MultiverseCore.commands.AnchorCommand;
|
||||
import com.onarandombox.MultiverseCore.commands.CheckCommand;
|
||||
import com.onarandombox.MultiverseCore.commands.CloneCommand;
|
||||
import com.onarandombox.MultiverseCore.commands.ConfigCommand;
|
||||
import com.onarandombox.MultiverseCore.commands.ConfirmCommand;
|
||||
import com.onarandombox.MultiverseCore.commands.CoordCommand;
|
||||
import com.onarandombox.MultiverseCore.commands.CreateCommand;
|
||||
import com.onarandombox.MultiverseCore.commands.DebugCommand;
|
||||
import com.onarandombox.MultiverseCore.commands.DeleteCommand;
|
||||
import com.onarandombox.MultiverseCore.commands.EnvironmentCommand;
|
||||
import com.onarandombox.MultiverseCore.commands.GameruleCommand;
|
||||
import com.onarandombox.MultiverseCore.commands.GamerulesCommand;
|
||||
import com.onarandombox.MultiverseCore.commands.GeneratorCommand;
|
||||
import com.onarandombox.MultiverseCore.commands.HelpCommand;
|
||||
import com.onarandombox.MultiverseCore.commands.ImportCommand;
|
||||
import com.onarandombox.MultiverseCore.commands.InfoCommand;
|
||||
import com.onarandombox.MultiverseCore.commands.ListCommand;
|
||||
import com.onarandombox.MultiverseCore.commands.LoadCommand;
|
||||
import com.onarandombox.MultiverseCore.commands.ModifyAddCommand;
|
||||
import com.onarandombox.MultiverseCore.commands.ModifyClearCommand;
|
||||
import com.onarandombox.MultiverseCore.commands.ModifyCommand;
|
||||
import com.onarandombox.MultiverseCore.commands.ModifyRemoveCommand;
|
||||
import com.onarandombox.MultiverseCore.commands.ModifySetCommand;
|
||||
import com.onarandombox.MultiverseCore.commands.PurgeCommand;
|
||||
import com.onarandombox.MultiverseCore.commands.RegenCommand;
|
||||
import com.onarandombox.MultiverseCore.commands.ReloadCommand;
|
||||
import com.onarandombox.MultiverseCore.commands.RemoveCommand;
|
||||
import com.onarandombox.MultiverseCore.commands.ScriptCommand;
|
||||
import com.onarandombox.MultiverseCore.commands.SetSpawnCommand;
|
||||
import com.onarandombox.MultiverseCore.commands.SilentCommand;
|
||||
import com.onarandombox.MultiverseCore.commands.SpawnCommand;
|
||||
import com.onarandombox.MultiverseCore.commands.TeleportCommand;
|
||||
import com.onarandombox.MultiverseCore.commands.UnloadCommand;
|
||||
import com.onarandombox.MultiverseCore.commands.VersionCommand;
|
||||
import com.onarandombox.MultiverseCore.commands.WhoCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.AnchorCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.CheckCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.CloneCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.ConfigCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.ConfirmCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.CoordCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.CreateCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.DeleteCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.EnvironmentCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.GameruleCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.GamerulesCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.GeneratorCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.HelpCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.ImportCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.InfoCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.ListCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.LoadCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.ModifyAddCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.ModifyClearCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.ModifyCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.ModifyRemoveCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.ModifySetCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.PurgeCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.RegenCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.ReloadCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.RemoveCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.ScriptCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.SetSpawnCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.SilentCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.SpawnCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.TeleportCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.UnloadCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.VersionCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.WhoCommand;
|
||||
import com.onarandombox.MultiverseCore.commandtools.MVCommandManager;
|
||||
import com.onarandombox.MultiverseCore.commandtools.queue.CommandQueueManager;
|
||||
import com.onarandombox.MultiverseCore.destination.AnchorDestination;
|
||||
import com.onarandombox.MultiverseCore.destination.BedDestination;
|
||||
@ -204,6 +205,7 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
|
||||
|
||||
// Setup our Map for our Commands using the CommandHandler.
|
||||
private CommandHandler commandHandler;
|
||||
private MVCommandManager commandManager;
|
||||
private CommandQueueManager commandQueueManager;
|
||||
|
||||
private static final String LOG_TAG = "[Multiverse-Core]";
|
||||
@ -287,6 +289,7 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
|
||||
|
||||
// Setup the command manager
|
||||
this.commandHandler = new CommandHandler(this, this.ph);
|
||||
this.commandManager = new MVCommandManager(this);
|
||||
this.commandQueueManager = new CommandQueueManager(this);
|
||||
// Call the Function to assign all the Commands to their Class.
|
||||
this.registerCommands();
|
||||
@ -781,13 +784,16 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
|
||||
this.commandHandler.registerCommand(new AnchorCommand(this));
|
||||
// Misc Commands
|
||||
this.commandHandler.registerCommand(new EnvironmentCommand(this));
|
||||
this.commandHandler.registerCommand(new DebugCommand(this));
|
||||
// this.commandHandler.registerCommand(new DebugCommand(this));
|
||||
this.commandHandler.registerCommand(new SilentCommand(this));
|
||||
this.commandHandler.registerCommand(new GeneratorCommand(this));
|
||||
this.commandHandler.registerCommand(new CheckCommand(this));
|
||||
this.commandHandler.registerCommand(new ScriptCommand(this));
|
||||
this.commandHandler.registerCommand(new GameruleCommand(this));
|
||||
this.commandHandler.registerCommand(new GamerulesCommand(this));
|
||||
|
||||
//**NEW ACF COMMAND HANDLER**
|
||||
this.commandManager.registerCommand(new DebugCommand(this));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -918,6 +924,14 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
|
||||
return this.commandHandler;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public MVCommandManager getCommandManager() {
|
||||
return this.commandManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
@ -8,6 +8,7 @@
|
||||
package com.onarandombox.MultiverseCore.api;
|
||||
|
||||
import buscript.Buscript;
|
||||
import com.onarandombox.MultiverseCore.commandtools.MVCommandManager;
|
||||
import com.onarandombox.MultiverseCore.commandtools.queue.CommandQueueManager;
|
||||
import com.onarandombox.MultiverseCore.destination.DestinationFactory;
|
||||
import com.onarandombox.MultiverseCore.utils.AnchorManager;
|
||||
@ -87,6 +88,14 @@ public interface Core {
|
||||
*/
|
||||
CommandHandler getCommandHandler();
|
||||
|
||||
/**
|
||||
* Multiverse uses {@link MVCommandManager} to make adding and using commands
|
||||
* a piece of cake.
|
||||
*
|
||||
* @return A non-null {@link MVCommandManager}.
|
||||
*/
|
||||
MVCommandManager getCommandManager();
|
||||
|
||||
/**
|
||||
* Manager for command that requires /mv confirm before execution.
|
||||
*
|
||||
|
@ -1,67 +1,47 @@
|
||||
/******************************************************************************
|
||||
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
|
||||
* Multiverse 2 is licensed under the BSD License. *
|
||||
* For more information please check the README.md file included *
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
|
||||
import co.aikar.commands.CommandIssuer;
|
||||
import co.aikar.commands.annotation.CommandAlias;
|
||||
import co.aikar.commands.annotation.CommandCompletion;
|
||||
import co.aikar.commands.annotation.CommandPermission;
|
||||
import co.aikar.commands.annotation.Conditions;
|
||||
import co.aikar.commands.annotation.Subcommand;
|
||||
import com.dumptruckman.minecraft.util.Logging;
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.permissions.PermissionDefault;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
|
||||
/**
|
||||
* Enables debug-information.
|
||||
*/
|
||||
@CommandAlias("mv")
|
||||
public class DebugCommand extends MultiverseCommand {
|
||||
|
||||
public DebugCommand(MultiverseCore plugin) {
|
||||
super(plugin);
|
||||
this.setName("Turn Debug on/off?");
|
||||
this.setCommandUsage("/mv debug" + ChatColor.GOLD + " [1|2|3|off|silent]");
|
||||
this.setArgRange(0, 1);
|
||||
this.addKey("mv debug");
|
||||
this.addKey("mv d");
|
||||
this.addKey("mvdebug");
|
||||
this.addCommandExample("/mv debug " + ChatColor.GOLD + "2");
|
||||
this.setPermission("multiverse.core.debug", "Spams the console a bunch.", PermissionDefault.OP);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void runCommand(CommandSender sender, List<String> args) {
|
||||
if (args.size() == 1) {
|
||||
if (args.get(0).equalsIgnoreCase("off")) {
|
||||
plugin.getMVConfig().setGlobalDebug(0);
|
||||
} else {
|
||||
try {
|
||||
int debugLevel = Integer.parseInt(args.get(0));
|
||||
if (debugLevel > 3 || debugLevel < 0) {
|
||||
throw new NumberFormatException();
|
||||
}
|
||||
plugin.getMVConfig().setGlobalDebug(debugLevel);
|
||||
} catch (NumberFormatException e) {
|
||||
sender.sendMessage(ChatColor.RED + "Error" + ChatColor.WHITE
|
||||
+ " setting debug level. Please use a number 0-3 " + ChatColor.AQUA + "(3 being many many messages!)");
|
||||
}
|
||||
}
|
||||
plugin.saveMVConfigs();
|
||||
}
|
||||
this.displayDebugMode(sender);
|
||||
@Subcommand("debug")
|
||||
@CommandPermission("multiverse.core.debug")
|
||||
public void onShowDebugCommand(@NotNull CommandIssuer issuer) {
|
||||
this.displayDebugMode(issuer);
|
||||
}
|
||||
|
||||
private void displayDebugMode(CommandSender sender) {
|
||||
final int debugLevel = plugin.getMVConfig().getGlobalDebug();
|
||||
|
||||
@Subcommand("debug")
|
||||
@CommandPermission("multiverse.core.debug")
|
||||
@CommandCompletion("@range:3")
|
||||
public void onChangeDebugCommand(@NotNull CommandIssuer issuer,
|
||||
@Conditions("debuglevel") int level) {
|
||||
|
||||
this.plugin.getMVConfig().setGlobalDebug(level);
|
||||
this.plugin.saveMVConfigs();
|
||||
this.displayDebugMode(issuer);
|
||||
}
|
||||
|
||||
private void displayDebugMode(@NotNull CommandIssuer issuer) {
|
||||
final int debugLevel = this.plugin.getMVConfig().getGlobalDebug();
|
||||
if (debugLevel == 0) {
|
||||
sender.sendMessage("Multiverse Debug mode is " + ChatColor.RED + "OFF");
|
||||
} else {
|
||||
sender.sendMessage("Multiverse Debug mode is " + ChatColor.GREEN + debugLevel);
|
||||
Logging.fine("Multiverse Debug ENABLED");
|
||||
issuer.sendMessage("§fMultiverse Debug mode is §cOFF§f.");
|
||||
return;
|
||||
}
|
||||
issuer.sendMessage("§fMultiverse Debug mode is at §alevel {level}§f.");
|
||||
Logging.fine("Multiverse Debug ENABLED.");
|
||||
}
|
||||
}
|
||||
|
@ -1,40 +1,13 @@
|
||||
/******************************************************************************
|
||||
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
|
||||
* Multiverse 2 is licensed under the BSD License. *
|
||||
* For more information please check the README.md file included *
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
|
||||
import co.aikar.commands.BaseCommand;
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import com.onarandombox.MultiverseCore.api.MultiverseMessaging;
|
||||
import com.pneumaticraft.commandhandler.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import java.util.List;
|
||||
public class MultiverseCommand extends BaseCommand {
|
||||
|
||||
/**
|
||||
* A generic Multiverse-command.
|
||||
*/
|
||||
public abstract class MultiverseCommand extends Command {
|
||||
protected final MultiverseCore plugin;
|
||||
|
||||
/**
|
||||
* The reference to the core.
|
||||
*/
|
||||
protected MultiverseCore plugin;
|
||||
/**
|
||||
* The reference to {@link MultiverseMessaging}.
|
||||
*/
|
||||
protected MultiverseMessaging messaging;
|
||||
|
||||
public MultiverseCommand(MultiverseCore plugin) {
|
||||
super(plugin);
|
||||
protected MultiverseCommand(MultiverseCore plugin) {
|
||||
this.plugin = plugin;
|
||||
this.messaging = this.plugin.getMessaging();
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract void runCommand(CommandSender sender, List<String> args);
|
||||
|
||||
}
|
||||
|
@ -1,4 +0,0 @@
|
||||
/**
|
||||
* This package contains all Commands.
|
||||
*/
|
||||
package com.onarandombox.MultiverseCore.commands;
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import org.bukkit.ChatColor;
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import com.onarandombox.MultiverseCore.api.MVDestination;
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import org.bukkit.ChatColor;
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import org.bukkit.command.CommandSender;
|
@ -5,13 +5,12 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import com.onarandombox.MultiverseCore.api.MVWorldManager;
|
||||
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import com.onarandombox.MultiverseCore.api.MVWorldManager;
|
@ -0,0 +1,66 @@
|
||||
/******************************************************************************
|
||||
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
|
||||
* Multiverse 2 is licensed under the BSD License. *
|
||||
* For more information please check the README.md file included *
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.dumptruckman.minecraft.util.Logging;
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.permissions.PermissionDefault;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Enables debug-information.
|
||||
*/
|
||||
public class DebugCommand extends MultiverseCommand {
|
||||
|
||||
public DebugCommand(MultiverseCore plugin) {
|
||||
super(plugin);
|
||||
this.setName("Turn Debug on/off?");
|
||||
this.setCommandUsage("/mv debug" + ChatColor.GOLD + " [1|2|3|off|silent]");
|
||||
this.setArgRange(0, 1);
|
||||
this.addKey("mv debug");
|
||||
this.addKey("mv d");
|
||||
this.addKey("mvdebug");
|
||||
this.addCommandExample("/mv debug " + ChatColor.GOLD + "2");
|
||||
this.setPermission("multiverse.core.debug", "Spams the console a bunch.", PermissionDefault.OP);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void runCommand(CommandSender sender, List<String> args) {
|
||||
if (args.size() == 1) {
|
||||
if (args.get(0).equalsIgnoreCase("off")) {
|
||||
plugin.getMVConfig().setGlobalDebug(0);
|
||||
} else {
|
||||
try {
|
||||
int debugLevel = Integer.parseInt(args.get(0));
|
||||
if (debugLevel > 3 || debugLevel < 0) {
|
||||
throw new NumberFormatException();
|
||||
}
|
||||
plugin.getMVConfig().setGlobalDebug(debugLevel);
|
||||
} catch (NumberFormatException e) {
|
||||
sender.sendMessage(ChatColor.RED + "Error" + ChatColor.WHITE
|
||||
+ " setting debug level. Please use a number 0-3 " + ChatColor.AQUA + "(3 being many many messages!)");
|
||||
}
|
||||
}
|
||||
plugin.saveMVConfigs();
|
||||
}
|
||||
this.displayDebugMode(sender);
|
||||
}
|
||||
|
||||
private void displayDebugMode(CommandSender sender) {
|
||||
final int debugLevel = plugin.getMVConfig().getGlobalDebug();
|
||||
if (debugLevel == 0) {
|
||||
sender.sendMessage("Multiverse Debug mode is " + ChatColor.RED + "OFF");
|
||||
} else {
|
||||
sender.sendMessage("Multiverse Debug mode is " + ChatColor.GREEN + debugLevel);
|
||||
Logging.fine("Multiverse Debug ENABLED");
|
||||
}
|
||||
}
|
||||
}
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import com.onarandombox.MultiverseCore.commandtools.queue.QueuedCommand;
|
||||
@ -14,7 +14,6 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.permissions.PermissionDefault;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import org.bukkit.ChatColor;
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import org.bukkit.Bukkit;
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import com.onarandombox.MultiverseCore.display.ColorAlternator;
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.dumptruckman.minecraft.util.Logging;
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import com.pneumaticraft.commandhandler.Command;
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import com.onarandombox.MultiverseCore.api.MVWorldManager;
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import com.onarandombox.MultiverseCore.api.FancyText;
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import org.bukkit.ChatColor;
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import com.onarandombox.MultiverseCore.api.MVWorldManager;
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import com.onarandombox.MultiverseCore.api.MVWorldManager;
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import com.onarandombox.MultiverseCore.enums.Action;
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import com.onarandombox.MultiverseCore.api.MVWorldManager;
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import com.onarandombox.MultiverseCore.api.MVWorldManager;
|
@ -0,0 +1,40 @@
|
||||
/******************************************************************************
|
||||
* Multiverse 2 Copyright (c) the Multiverse Team 2011. *
|
||||
* Multiverse 2 is licensed under the BSD License. *
|
||||
* For more information please check the README.md file included *
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import com.onarandombox.MultiverseCore.api.MultiverseMessaging;
|
||||
import com.pneumaticraft.commandhandler.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
/**
|
||||
* A generic Multiverse-command.
|
||||
*/
|
||||
public abstract class MultiverseCommand extends Command {
|
||||
|
||||
/**
|
||||
* The reference to the core.
|
||||
*/
|
||||
protected MultiverseCore plugin;
|
||||
/**
|
||||
* The reference to {@link MultiverseMessaging}.
|
||||
*/
|
||||
protected MultiverseMessaging messaging;
|
||||
|
||||
public MultiverseCommand(MultiverseCore plugin) {
|
||||
super(plugin);
|
||||
this.plugin = plugin;
|
||||
this.messaging = this.plugin.getMessaging();
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract void runCommand(CommandSender sender, List<String> args);
|
||||
|
||||
}
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.pneumaticraft.commandhandler.Command;
|
||||
import org.bukkit.command.CommandSender;
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import com.onarandombox.MultiverseCore.api.MVWorldManager;
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import com.onarandombox.MultiverseCore.commandtools.queue.QueuedCommand;
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import com.onarandombox.MultiverseCore.event.MVConfigReloadEvent;
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import org.bukkit.ChatColor;
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import org.bukkit.ChatColor;
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import com.onarandombox.MultiverseCore.api.BlockSafety;
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import org.bukkit.ChatColor;
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import org.bukkit.command.CommandSender;
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import com.onarandombox.MultiverseCore.api.MultiverseWorld;
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.dumptruckman.minecraft.util.Logging;
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
@ -28,7 +28,6 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.permissions.Permission;
|
||||
import org.bukkit.permissions.PermissionDefault;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import org.bukkit.ChatColor;
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.dumptruckman.minecraft.util.Logging;
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
@ -5,7 +5,7 @@
|
||||
* with this project. *
|
||||
******************************************************************************/
|
||||
|
||||
package com.onarandombox.MultiverseCore.commands;
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import com.onarandombox.MultiverseCore.api.MVWorldManager;
|
@ -0,0 +1,4 @@
|
||||
/**
|
||||
* This package contains all Commands.
|
||||
*/
|
||||
package com.onarandombox.MultiverseCore.commandsold;
|
@ -0,0 +1,9 @@
|
||||
package com.onarandombox.MultiverseCore.commandtools;
|
||||
|
||||
import co.aikar.commands.PaperCommandCompletions;
|
||||
|
||||
public class MVCommandCompletions extends PaperCommandCompletions {
|
||||
public MVCommandCompletions(MVCommandManager mvCommandManager) {
|
||||
super(mvCommandManager);
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package com.onarandombox.MultiverseCore.commandtools;
|
||||
|
||||
import co.aikar.commands.PaperCommandContexts;
|
||||
|
||||
public class MVCommandContexts extends PaperCommandContexts {
|
||||
public MVCommandContexts(MVCommandManager mvCommandManager) {
|
||||
super(mvCommandManager);
|
||||
}
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
package com.onarandombox.MultiverseCore.commandtools;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import co.aikar.commands.BukkitCommandCompletionContext;
|
||||
import co.aikar.commands.BukkitCommandExecutionContext;
|
||||
import co.aikar.commands.CommandCompletions;
|
||||
import co.aikar.commands.CommandContexts;
|
||||
import co.aikar.commands.PaperCommandManager;
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
|
||||
/**
|
||||
* Main class to manage permissions.
|
||||
*/
|
||||
public class MVCommandManager extends PaperCommandManager {
|
||||
|
||||
private final MultiverseCore plugin;
|
||||
|
||||
public MVCommandManager(MultiverseCore plugin) {
|
||||
super(plugin);
|
||||
this.plugin = plugin;
|
||||
|
||||
// Setup locale
|
||||
this.addSupportedLanguage(Locale.ENGLISH);
|
||||
this.locales.addMessageBundles("multiverse-core");
|
||||
this.locales.loadLanguages();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets class responsible for parsing string args into objects.
|
||||
*
|
||||
* @return A not-null {@link CommandContexts}.
|
||||
*/
|
||||
@Override
|
||||
public synchronized CommandContexts<BukkitCommandExecutionContext> getCommandContexts() {
|
||||
if (this.contexts == null) {
|
||||
this.contexts = new MVCommandContexts(this);
|
||||
}
|
||||
return this.contexts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets class responsible for tab-completion handling.
|
||||
*
|
||||
* @return A not-null {@link CommandCompletions}.
|
||||
*/
|
||||
@Override
|
||||
public synchronized CommandCompletions<BukkitCommandCompletionContext> getCommandCompletions() {
|
||||
if (this.completions == null) {
|
||||
this.completions = new MVCommandCompletions(this);
|
||||
}
|
||||
return this.completions;
|
||||
}
|
||||
}
|
@ -9,17 +9,15 @@ package com.onarandombox.MultiverseCore.destination;
|
||||
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore;
|
||||
import com.onarandombox.MultiverseCore.api.MVDestination;
|
||||
import com.onarandombox.MultiverseCore.commands.TeleportCommand;
|
||||
import com.onarandombox.MultiverseCore.commandsold.TeleportCommand;
|
||||
import com.onarandombox.MultiverseCore.utils.PermissionTools;
|
||||
import com.onarandombox.MultiverseCore.utils.PlayerFinder;
|
||||
import com.pneumaticraft.commandhandler.Command;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.permissions.Permission;
|
||||
import org.bukkit.permissions.PermissionDefault;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
|
Loading…
Reference in New Issue
Block a user