mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2026-03-26 17:43:07 +01:00
Update game time changing (triggers quests and updates properly)
This commit is contained in:
@@ -171,17 +171,15 @@ public class QuestManager extends BasePlayerManager {
|
||||
var world = this.getPlayer().getWorld();
|
||||
if (world == null) return;
|
||||
|
||||
checkTimeVars();
|
||||
this.checkTimeVars();
|
||||
// trigger game time tick for quests
|
||||
queueEvent(QuestContent.QUEST_CONTENT_GAME_TIME_TICK,
|
||||
world.getGameTimeHours() , // hours
|
||||
0);
|
||||
this.queueEvent(QuestContent.QUEST_CONTENT_GAME_TIME_TICK);
|
||||
}
|
||||
|
||||
private void checkTimeVars() {
|
||||
val currentDays = player.getWorld().getTotalGameTimeDays();
|
||||
val currentHours = player.getWorld().getTotalGameTimeHours();
|
||||
boolean checkDays = currentDays != lastDayCheck;
|
||||
boolean checkDays = currentDays != lastDayCheck;
|
||||
boolean checkHours = currentHours != lastHourCheck;
|
||||
|
||||
if(!checkDays && !checkHours){
|
||||
|
||||
@@ -9,7 +9,6 @@ import lombok.val;
|
||||
|
||||
@QuestValueContent(QUEST_CONTENT_GAME_TIME_TICK)
|
||||
public class ContentGameTimeTick extends BaseContent {
|
||||
|
||||
@Override
|
||||
public boolean execute(
|
||||
GameQuest quest, QuestData.QuestContentCondition condition, String paramStr, int... params) {
|
||||
|
||||
Reference in New Issue
Block a user