fix: temporary cheap fix for weird stuff?
This commit is contained in:
parent
58ab0e0378
commit
36a2fece2f
1 changed files with 11 additions and 5 deletions
|
@ -7,7 +7,7 @@ from aiocraft.mc.proto import (
|
|||
PacketRespawn, PacketLogin, PacketUpdateHealth, PacketExperience, PacketSettings, PacketClientCommand, PacketAbilities
|
||||
)
|
||||
|
||||
from ..events import JoinGameEvent, DeathEvent, ConnectedEvent, DisconnectedEvent
|
||||
from ..events import JoinGameEvent, DeathEvent, DisconnectedEvent
|
||||
from ..scaffold import Scaffold
|
||||
|
||||
class GameState(Scaffold):
|
||||
|
@ -55,6 +55,9 @@ class GameState(Scaffold):
|
|||
@self.on_packet(PacketRespawn)
|
||||
async def on_player_respawning(packet:PacketRespawn):
|
||||
self.gamemode = Gamemode(packet.gamemode)
|
||||
if isinstance(packet.dimension, dict):
|
||||
self.dimension = Dimension.OVERWORLD # TODO wtf???
|
||||
else:
|
||||
self.dimension = Dimension(packet.dimension)
|
||||
self.difficulty = Difficulty(packet.difficulty)
|
||||
if self.difficulty != Difficulty.PEACEFUL \
|
||||
|
@ -72,6 +75,9 @@ class GameState(Scaffold):
|
|||
@self.on_packet(PacketLogin)
|
||||
async def player_joining_cb(packet:PacketLogin):
|
||||
self.gamemode = Gamemode(packet.gameMode)
|
||||
if isinstance(packet.dimension, dict):
|
||||
self.dimension = Dimension.OVERWORLD # TODO wtf???
|
||||
else:
|
||||
self.dimension = Dimension(packet.dimension)
|
||||
self.difficulty = Difficulty(packet.difficulty)
|
||||
self.join_time = datetime.datetime.now()
|
||||
|
|
Loading…
Reference in a new issue