use of org.spongepowered.common.command.MinecraftCommandWrapper in project SpongeCommon by SpongePowered.
the class MixinServerCommandManager method registerCommandsList.
private void registerCommandsList(List<MinecraftCommandWrapper> cmds, Game game) {
for (Iterator<MinecraftCommandWrapper> it = cmds.iterator(); it.hasNext(); ) {
MinecraftCommandWrapper cmd = it.next();
it.remove();
game.getCommandManager().register(cmd.getOwner(), cmd, cmd.getNames());
registerDefaultPermissions(game, cmd);
}
}
use of org.spongepowered.common.command.MinecraftCommandWrapper in project SpongeForge by SpongePowered.
the class SpongeMod method onServerStopped.
@Subscribe
public void onServerStopped(FMLServerStoppedEvent event) throws IOException {
try {
CommandManager service = this.game.getCommandManager();
service.getCommands().stream().filter(mapping -> mapping.getCallable() instanceof MinecraftCommandWrapper).forEach(service::removeMapping);
((SqlServiceImpl) this.game.getServiceManager().provideUnchecked(SqlService.class)).close();
} catch (Throwable t) {
this.controller.errorOccurred(this, t);
}
// used by client
WorldManager.unregisterAllWorldSettings();
}
Aggregations