track in-game time

This commit is contained in:
əlemi 2022-01-19 01:41:27 +01:00
parent 6ed4c8e7e1
commit 964a885552

View file

@ -38,6 +38,7 @@ class Treepuncher(MinecraftClient):
gamemode : Gamemode gamemode : Gamemode
dimension : Dimension dimension : Dimension
difficulty : Difficulty difficulty : Difficulty
join_time : datetime.datetime
hp : float hp : float
food : float food : float
@ -72,6 +73,7 @@ class Treepuncher(MinecraftClient):
self.gamemode = Gamemode.SURVIVAL self.gamemode = Gamemode.SURVIVAL
self.dimension = Dimension.OVERWORLD self.dimension = Dimension.OVERWORLD
self.difficulty = Difficulty.HARD self.difficulty = Difficulty.HARD
self.join_time = datetime.datetime(2011, 11, 18)
self.hp = 20.0 self.hp = 20.0
self.food = 20.0 self.food = 20.0
@ -207,6 +209,7 @@ class Treepuncher(MinecraftClient):
self.gamemode = Gamemode(packet.gameMode) self.gamemode = Gamemode(packet.gameMode)
self.dimension = Dimension(packet.dimension) self.dimension = Dimension(packet.dimension)
self.difficulty = Difficulty(packet.difficulty) self.difficulty = Difficulty(packet.difficulty)
self.join_time = datetime.datetime.now()
if self.difficulty != Difficulty.PEACEFUL \ if self.difficulty != Difficulty.PEACEFUL \
and self.gamemode != Gamemode.SPECTATOR: and self.gamemode != Gamemode.SPECTATOR:
self.in_game = True self.in_game = True