Format code [skip actions]

This commit is contained in:
github-actions 2023-09-10 23:21:44 +00:00
parent fbe2b138ee
commit 8de281d4da
6 changed files with 21 additions and 9 deletions

View File

@ -159,7 +159,10 @@ public class GameQuest {
// TODO improve // TODO improve
var oldState = state; var oldState = state;
if (questData.getAcceptCond() != null && questData.getAcceptCond().size() != 0) { if (questData.getAcceptCond() != null && questData.getAcceptCond().size() != 0) {
this.getMainQuest().getQuestManager().getAcceptProgressLists().put(this.getSubQuestId(), new int[questData.getAcceptCond().size()]); this.getMainQuest()
.getQuestManager()
.getAcceptProgressLists()
.put(this.getSubQuestId(), new int[questData.getAcceptCond().size()]);
} }
if (questData.getFinishCond() != null && questData.getFinishCond().size() != 0) { if (questData.getFinishCond() != null && questData.getFinishCond().size() != 0) {

View File

@ -512,7 +512,9 @@ public final class QuestManager extends BasePlayerManager {
} }
} }
boolean shouldAccept = LogicType.calculate(questData.getAcceptCondComb(), acceptProgressLists.get(questData.getId())); boolean shouldAccept =
LogicType.calculate(
questData.getAcceptCondComb(), acceptProgressLists.get(questData.getId()));
if (this.loggedQuests.contains(questData.getId())) { if (this.loggedQuests.contains(questData.getId())) {
Grasscutter.getLogger() Grasscutter.getLogger()
.debug( .debug(
@ -540,8 +542,7 @@ public final class QuestManager extends BasePlayerManager {
if (shouldAccept) { if (shouldAccept) {
GameQuest quest = owner.getQuestManager().addQuest(questData); GameQuest quest = owner.getQuestManager().addQuest(questData);
Grasscutter.getLogger() Grasscutter.getLogger().debug("Added quest {}", questData.getSubId());
.debug("Added quest {}", questData.getSubId());
} }
}); });
} }

View File

@ -15,6 +15,7 @@ public class ConditionItemGivingFinished extends BaseCondition {
QuestData.QuestAcceptCondition condition, QuestData.QuestAcceptCondition condition,
String paramStr, String paramStr,
int... params) { int... params) {
return condition.getParam()[0] == params[0] && (condition.getParam()[1] == 0 || condition.getParam()[1] == params[1]); return condition.getParam()[0] == params[0]
&& (condition.getParam()[1] == 0 || condition.getParam()[1] == params[1]);
} }
} }

View File

@ -9,6 +9,7 @@ public final class ContentFinishItemGiving extends BaseContent {
@Override @Override
public boolean execute( public boolean execute(
GameQuest quest, QuestData.QuestContentCondition condition, String paramStr, int... params) { GameQuest quest, QuestData.QuestContentCondition condition, String paramStr, int... params) {
return condition.getParam()[0] == params[0] && (condition.getParam()[1] == 0 || condition.getParam()[1] == params[1]); return condition.getParam()[0] == params[0]
&& (condition.getParam()[1] == 0 || condition.getParam()[1] == params[1]);
} }
} }

View File

@ -541,7 +541,11 @@ public class Scene {
if (target instanceof EntityGadget gadget) { if (target instanceof EntityGadget gadget) {
if (gadget.getMetaGadget() != null) { if (gadget.getMetaGadget() != null) {
world.getServer().getDropSystem().handleChestDrop(gadget.getMetaGadget().drop_id, gadget.getMetaGadget().drop_count, gadget); world
.getServer()
.getDropSystem()
.handleChestDrop(
gadget.getMetaGadget().drop_id, gadget.getMetaGadget().drop_count, gadget);
} }
} }

View File

@ -99,8 +99,10 @@ public final class HandlerItemGivingReq extends PacketHandler {
// Mark the giving action as completed. // Mark the giving action as completed.
questManager.markCompleted(giveId); questManager.markCompleted(giveId);
// Queue the content and condition actions. // Queue the content and condition actions.
questManager.queueEvent(QuestContent.QUEST_CONTENT_FINISH_ITEM_GIVING, giveId, matchedGroups.get(0)); questManager.queueEvent(
questManager.queueEvent(QuestCond.QUEST_COND_ITEM_GIVING_FINISHED, giveId, matchedGroups.get(0)); QuestContent.QUEST_CONTENT_FINISH_ITEM_GIVING, giveId, matchedGroups.get(0));
questManager.queueEvent(
QuestCond.QUEST_COND_ITEM_GIVING_FINISHED, giveId, matchedGroups.get(0));
} }
} }
} }