Example #1
0
 public void save(QuestIO io) {
   io.set(
       "玩家資料." + owner.getUniqueId() + ".任務進度." + quest.getInternalID() + ".QuestStage",
       CurrentStage);
   int t = 0;
   int value = 0;
   for (QuestObjectProgress qop : objlist) {
     if (qop.isFinished()) {
       if (qop.getObject() instanceof QuestObjectTalkToNPC
           || qop.getObject() instanceof QuestObjectReachLocation) value = 1;
       else if (qop.getObject() instanceof NumerableObject)
         value = ((NumerableObject) qop.getObject()).getAmount();
     } else value = qop.getProgress();
     io.set(
         "玩家資料."
             + owner.getUniqueId()
             + ".任務進度."
             + quest.getInternalID()
             + ".QuestObjectProgress."
             + t,
         value);
     t++;
   }
 }
Example #2
0
 public void checkIfnextStage() {
   for (QuestObjectProgress o : objlist) {
     if (!o.isFinished()) return;
   }
   nextStage();
 }