diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentFinishPlot.java b/src/main/java/emu/grasscutter/game/quest/content/ContentFinishPlot.java index 32842cdbd..46a5ccf15 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentFinishPlot.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentFinishPlot.java @@ -1,21 +1,17 @@ package emu.grasscutter.game.quest.content; +import emu.grasscutter.data.excels.quest.QuestData; +import emu.grasscutter.game.quest.*; + import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_FINISH_PLOT; -import emu.grasscutter.data.binout.MainQuestData; -import emu.grasscutter.data.excels.quest.QuestData; -import emu.grasscutter.game.quest.GameQuest; -import emu.grasscutter.game.quest.QuestValueContent; - @QuestValueContent(QUEST_CONTENT_FINISH_PLOT) public class ContentFinishPlot extends BaseContent { - @Override public boolean execute( GameQuest quest, QuestData.QuestContentCondition condition, String paramStr, int... params) { - MainQuestData.TalkData talkData = - quest.getMainQuest().getTalks().get(Integer.valueOf(params[0])); - GameQuest subQuest = quest.getMainQuest().getChildQuestById(params[0]); + var talkData = quest.getMainQuest().getTalks().get(params[0]); + var subQuest = quest.getMainQuest().getChildQuestById(params[0]); return (talkData != null && subQuest != null || condition.getParamStr().equals(paramStr)) && condition.getParam()[0] == params[0]; } diff --git a/src/main/java/emu/grasscutter/game/quest/content/ContentNotFinishPlot.java b/src/main/java/emu/grasscutter/game/quest/content/ContentNotFinishPlot.java index 3b610ea35..157b65337 100644 --- a/src/main/java/emu/grasscutter/game/quest/content/ContentNotFinishPlot.java +++ b/src/main/java/emu/grasscutter/game/quest/content/ContentNotFinishPlot.java @@ -1,24 +1,18 @@ package emu.grasscutter.game.quest.content; +import emu.grasscutter.data.excels.quest.QuestData; +import emu.grasscutter.game.quest.*; + import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_NOT_FINISH_PLOT; -import emu.grasscutter.data.excels.quest.QuestData; -import emu.grasscutter.game.quest.GameQuest; -import emu.grasscutter.game.quest.QuestValueContent; -import lombok.val; - @QuestValueContent(QUEST_CONTENT_NOT_FINISH_PLOT) public class ContentNotFinishPlot extends BaseContent { - @Override public boolean execute( GameQuest quest, QuestData.QuestContentCondition condition, String paramStr, int... params) { - val talkId = condition.getParam()[0]; - val checkMainQuest = quest.getOwner().getQuestManager().getMainQuestByTalkId(talkId); - if (checkMainQuest == null) { - return true; - } - val talkData = checkMainQuest.getTalks().get(talkId); - return talkData == null; + var talkData = quest.getMainQuest().getTalks().get(params[0]); + var subQuest = quest.getMainQuest().getChildQuestById(params[0]); + return (talkData == null && subQuest != null || condition.getParamStr().equals(paramStr)) + && condition.getParam()[0] == params[0]; } }