Fix errors when unloading modules with listeners

This commit is contained in:
Telesphoreo 2022-03-18 14:15:05 -05:00
parent 06e51926be
commit d7cbbc8d52

View File

@ -110,7 +110,7 @@ public class ModuleManager
Plex.get().getServer().getCommandMap().getKnownCommands().remove(plexCommand.getName());
plexCommand.getAliases().forEach(alias -> Plex.get().getServer().getCommandMap().getKnownCommands().remove(alias));
});
module.getListeners().forEach(module::unregisterListener);
module.getListeners().stream().toList().forEach(module::unregisterListener);
module.disable();
});
}