fix order of init/cleanup execution
This commit is contained in:
parent
d71d23194d
commit
b836c31658
1 changed files with 3 additions and 3 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue