Update game time changing (triggers quests and updates properly)

This commit is contained in:
KingRainbow44
2023-05-04 21:41:41 -04:00
parent 0b87485bdf
commit 48e233eb9b
5 changed files with 28 additions and 10 deletions

View File

@@ -331,6 +331,11 @@ public class Player {
if (this.playerGameTime == gameTime) return;
this.playerGameTime = gameTime;
// If the player is the host of the world, update the game time as well.
if (this.getWorld().getHost() == this) {
this.getWorld().changeTime(gameTime);
}
// Trigger the script event for game time update.
var questManager = this.getQuestManager();
questManager.queueEvent(QuestCond.QUEST_COND_IS_DAYTIME);