Add initial cloud commands + refactors to common

This commit is contained in:
Frank van der Heijden 2021-07-24 02:02:55 +02:00
parent f21306021d
commit 6545d7ffac
No known key found for this signature in database
GPG key ID: B808721C2DD5B5B8
89 changed files with 1959 additions and 1893 deletions

View file

@ -39,7 +39,7 @@ import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.PluginLoader;
import org.bukkit.plugin.UnknownDependencyException;
public class BukkitPluginManager extends AbstractPluginManager<Plugin> {
public class BukkitPluginManager implements AbstractPluginManager<Plugin> {
private static BukkitPluginManager instance;
@ -306,6 +306,25 @@ public class BukkitPluginManager extends AbstractPluginManager<Plugin> {
RCraftServer.syncCommands();
}
/**
* Unregisters all the specified commands.
*/
public static void unregisterCommands(String... commands) {
Map<String, Command> map;
try {
map = RCommandMap.getKnownCommands(RCraftServer.getCommandMap());
} catch (Exception ex) {
ex.printStackTrace();
return;
}
for (String command : commands) {
map.remove(command);
}
RCraftServer.syncCommands();
}
/**
* Unregisters all specified commands exactly.
* @param commands The commands to unregister.