-Added millisToTime(long) and ticksToTime(long) functions to return time formatted strings from long values.

IPlayerQuestData:
-Added last completed time functions for repeating quests.

IQuest:
-Added repeat functions for repeating quests.

ServerCloneController:
-Fixed cloned NPCs having identical UUIDs.
This commit is contained in:
Luis C.M committed 2022-12-20 09:21:39 -06:00
1 parent 73ceeab907
commit a895c8bd24
7 files changed
+105 -1

No files matched your search

@@ -11,6 +11,7 @@ import net.minecraft.nbt.NBTTagList;
import noppes.npcs.EventHooks;
import noppes.npcs.NoppesUtilPlayer;
import noppes.npcs.Server;
import noppes.npcs.api.entity.IPlayer;
import noppes.npcs.constants.EnumPacketClient;
import noppes.npcs.constants.EnumQuestCompletion;
import noppes.npcs.constants.EnumQuestType;
@@ -213,4 +214,18 @@ public class PlayerQuestData implements IPlayerQuestData {
return (IQuest[])quests.toArray(new IQuest[0]);
}
public long getLastCompletedTime(int id) {
if (this.hasFinishedQuest(id)) {
return this.finishedQuests.get(id);
}
return 0;
}
public void setLastCompletedTime(int id,long time) {
Quest quest = QuestController.instance.quests.get(id);
if (quest == null)
return;
this.finishedQuests.put(id,time);
}
}