fix order of init/cleanup execution

This commit is contained in:
əlemi 2021-12-04 02:49:50 +01:00
parent d71d23194d
commit b836c31658

View file

@ -80,16 +80,16 @@ class Treepuncher(MinecraftClient):
self.scheduler.start(paused=True) self.scheduler.start(paused=True)
async def start(self): async def start(self):
await super().start()
self.scheduler.resume()
for m in self.modules: for m in self.modules:
await m.initialize(self) await m.initialize(self)
await super().start()
self.scheduler.resume()
async def stop(self, force:bool=False): async def stop(self, force:bool=False):
self.scheduler.pause() self.scheduler.pause()
await super().stop(force=force)
for m in self.modules: for m in self.modules:
await m.cleanup(self) await m.cleanup(self)
await super().stop(force=force)
def add(self, module:LogicModule): def add(self, module:LogicModule):
module.register(self) module.register(self)