ctakan

Untitled

Apr 19th, 2021
549
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     public boolean hasFinishedQuest(EntityPlayerMP player, int id) {
  2.         PlayerQuestData data = PlayerDataController.instance.getQuestData(player.username);
  3.         return data.finishedQuests.containsKey(Integer.valueOf(id));
  4.     }
  5.  
  6.     public boolean hasActiveQuest(EntityPlayerMP player, int id) {
  7.         PlayerQuestData data = PlayerDataController.instance.getQuestData(player.username);
  8.         return data.activeQuests.containsKey(Integer.valueOf(id));
  9.     }
  10.  
  11.     public boolean hasReadDialog(EntityPlayerMP player, int id) {
  12.         PlayerDialogData data = PlayerDataController.instance.getDialogData(player.username);
  13.         return data.dialogsRead.contains(Integer.valueOf(id));
  14.     }
  15.  
  16.     public void startQuest(EntityPlayerMP player, int id) {
  17.         Quest quest = (Quest) QuestController.instance.quests.get(Integer.valueOf(id));
  18.         if (quest != null) {
  19.             PlayerQuestData data = PlayerDataController.instance.getQuestData(player.username);
  20.             QuestData questdata = new QuestData(quest);
  21.             data.activeQuests.put(Integer.valueOf(id), questdata);
  22.         }
  23.     }
  24.  
  25.     public void finishQuest(EntityPlayerMP player, int id) {
  26.         Quest quest = (Quest) QuestController.instance.quests.get(Integer.valueOf(id));
  27.         if (quest != null) {
  28.             PlayerQuestData data = PlayerDataController.instance.getQuestData(player.username);
  29.             data.finishedQuests.put(Integer.valueOf(id), Long.valueOf(System.currentTimeMillis()));
  30.         }
  31.     }
  32.  
  33.     public void stopQuest(EntityPlayerMP player, int id) {
  34.         Quest quest = (Quest) QuestController.instance.quests.get(Integer.valueOf(id));
  35.         if (quest != null) {
  36.             PlayerQuestData data = PlayerDataController.instance.getQuestData(player.username);
  37.             data.activeQuests.remove(Integer.valueOf(id));
  38.         }
  39.     }
  40.     public void removeQuest(EntityPlayerMP player, int id) {
  41.         Quest quest = (Quest) QuestController.instance.quests.get(Integer.valueOf(id));
  42.         if (quest != null) {
  43.             PlayerQuestData data = PlayerDataController.instance.getQuestData(player.username);
  44.             data.activeQuests.remove(Integer.valueOf(id));
  45.             data.finishedQuests.remove(Integer.valueOf(id));
  46.         }
  47.     }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×