join_game_event holds args inside itself

This commit is contained in:
əlemi 2022-04-19 03:36:20 +02:00
parent db01f5d5b7
commit 6d64973c54
No known key found for this signature in database
GPG key ID: BBCBFE5D7244634E
2 changed files with 6 additions and 1 deletions

View file

@ -8,3 +8,8 @@ class JoinGameEvent(BaseEvent):
dimension : Dimension dimension : Dimension
difficulty : Difficulty difficulty : Difficulty
gamemode : Gamemode gamemode : Gamemode
def __init__(self, dimension:Dimension, difficulty:Difficulty, gamemode:Gamemode):
self.gamemode = gamemode
self.difficulty = difficulty
self.dimension = dimension

View file

@ -79,7 +79,7 @@ class GameState(Scaffold):
self.difficulty.name, self.difficulty.name,
self.gamemode.name self.gamemode.name
) )
self.run_callbacks(JoinGameEvent, self.dimension, self.difficulty, self.gamemode) self.run_callbacks(JoinGameEvent(self.dimension, self.difficulty, self.gamemode))
await self.dispatcher.write( await self.dispatcher.write(
PacketSettings( PacketSettings(
self.dispatcher.proto, self.dispatcher.proto,