Upgrade cloud & gradle, fix unregistering of plugins command

This commit is contained in:
Frank van der Heijden 2022-08-21 14:00:26 +02:00
parent f444c42a2f
commit 9e54ce35da
No known key found for this signature in database
GPG key ID: 4BC514A52A496F84
10 changed files with 29 additions and 16 deletions

View file

@ -1,6 +1,7 @@
package net.frankheijden.serverutils.bukkit;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import net.frankheijden.serverutils.bukkit.entities.BukkitPlugin;
@ -46,6 +47,7 @@ public class ServerUtils extends JavaPlugin {
public void onDisable() {
super.onDisable();
restoreBukkitPluginCommand();
RCraftServer.syncCommands(Collections.emptySet());
plugin.disable();
}

View file

@ -313,12 +313,15 @@ public class BukkitPluginManager extends AbstractPluginManager<Plugin, BukkitPlu
return;
}
for (String command : commands) {
map.remove(command);
List<Command> unregisteredCommands = new ArrayList<>();
for (String commandName : commands) {
Command command = map.remove(commandName);
if (command == null) continue;
unregisteredCommands.add(command);
}
RCommandDispatcher.removeCommands(Arrays.asList(commands));
RCraftServer.updateCommands();
unregisterExactCommands(unregisteredCommands);
}
/**