mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 08:45:11 +00:00
Proper Reformating
This commit is contained in:
1 parent
ce75880aba
commit
180d257024
1179 files changed
+59847
-61583
No files matched your search
@@ -14,133 +14,131 @@ import java.util.HashMap;
|
||||
import java.util.Vector;
|
||||
|
||||
public class QuestLogData {
|
||||
public String trackedQuestKey = "";
|
||||
public HashMap<String,Vector<String>> categories = new HashMap<String,Vector<String>>();
|
||||
public String selectedQuest = "";
|
||||
public String selectedCategory = "";
|
||||
public HashMap<String,String> questText = new HashMap<>();
|
||||
public HashMap<String,String> questAlerts = new HashMap<>();
|
||||
public HashMap<String,Vector<String>> questStatus = new HashMap<>();
|
||||
public HashMap<String,String> finish = new HashMap<>();
|
||||
public HashMap<String, Integer> partyQuests = new HashMap<>();
|
||||
public HashMap<String,Vector<String>> partyOptions = new HashMap<>();
|
||||
public String trackedQuestKey = "";
|
||||
public HashMap<String, Vector<String>> categories = new HashMap<String, Vector<String>>();
|
||||
public String selectedQuest = "";
|
||||
public String selectedCategory = "";
|
||||
public HashMap<String, String> questText = new HashMap<>();
|
||||
public HashMap<String, String> questAlerts = new HashMap<>();
|
||||
public HashMap<String, Vector<String>> questStatus = new HashMap<>();
|
||||
public HashMap<String, String> finish = new HashMap<>();
|
||||
public HashMap<String, Integer> partyQuests = new HashMap<>();
|
||||
public HashMap<String, Vector<String>> partyOptions = new HashMap<>();
|
||||
|
||||
public NBTTagCompound writeNBT(){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
compound.setTag("Categories", NBTTags.nbtVectorMap(categories));
|
||||
compound.setTag("Logs", NBTTags.nbtStringStringMap(questText));
|
||||
compound.setTag("Alerts", NBTTags.nbtStringStringMap(questAlerts));
|
||||
compound.setTag("Status", NBTTags.nbtVectorMap(questStatus));
|
||||
compound.setTag("QuestFinisher", NBTTags.nbtStringStringMap(finish));
|
||||
compound.setString("TrackedQuestID", trackedQuestKey);
|
||||
compound.setTag("PartyQuests", NBTTags.nbtStringIntegerMap(partyQuests));
|
||||
public NBTTagCompound writeNBT() {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
compound.setTag("Categories", NBTTags.nbtVectorMap(categories));
|
||||
compound.setTag("Logs", NBTTags.nbtStringStringMap(questText));
|
||||
compound.setTag("Alerts", NBTTags.nbtStringStringMap(questAlerts));
|
||||
compound.setTag("Status", NBTTags.nbtVectorMap(questStatus));
|
||||
compound.setTag("QuestFinisher", NBTTags.nbtStringStringMap(finish));
|
||||
compound.setString("TrackedQuestID", trackedQuestKey);
|
||||
compound.setTag("PartyQuests", NBTTags.nbtStringIntegerMap(partyQuests));
|
||||
compound.setTag("PartyOptions", NBTTags.nbtVectorMap(partyOptions));
|
||||
return compound;
|
||||
}
|
||||
return compound;
|
||||
}
|
||||
|
||||
public void readNBT(NBTTagCompound compound){
|
||||
categories = NBTTags.getVectorMap(compound.getTagList("Categories", 10));
|
||||
questText = NBTTags.getStringStringMap(compound.getTagList("Logs", 10));
|
||||
questAlerts = NBTTags.getStringStringMap(compound.getTagList("Alerts", 10));
|
||||
questStatus = NBTTags.getVectorMap(compound.getTagList("Status", 10));
|
||||
finish = NBTTags.getStringStringMap(compound.getTagList("QuestFinisher", 10));
|
||||
trackedQuestKey = compound.getString("TrackedQuestID");
|
||||
partyQuests = NBTTags.getStringIntegerMap(compound.getTagList("PartyQuests", 10));
|
||||
public void readNBT(NBTTagCompound compound) {
|
||||
categories = NBTTags.getVectorMap(compound.getTagList("Categories", 10));
|
||||
questText = NBTTags.getStringStringMap(compound.getTagList("Logs", 10));
|
||||
questAlerts = NBTTags.getStringStringMap(compound.getTagList("Alerts", 10));
|
||||
questStatus = NBTTags.getVectorMap(compound.getTagList("Status", 10));
|
||||
finish = NBTTags.getStringStringMap(compound.getTagList("QuestFinisher", 10));
|
||||
trackedQuestKey = compound.getString("TrackedQuestID");
|
||||
partyQuests = NBTTags.getStringIntegerMap(compound.getTagList("PartyQuests", 10));
|
||||
partyOptions = NBTTags.getVectorMap(compound.getTagList("PartyOptions", 10));
|
||||
}
|
||||
}
|
||||
|
||||
public NBTTagCompound writeTrackedQuest(){
|
||||
public NBTTagCompound writeTrackedQuest() {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
compound.setString("TrackedQuestID", trackedQuestKey);
|
||||
return compound;
|
||||
}
|
||||
|
||||
public void readTrackedQuest(NBTTagCompound compound){
|
||||
public void readTrackedQuest(NBTTagCompound compound) {
|
||||
trackedQuestKey = compound.getString("TrackedQuestID");
|
||||
}
|
||||
|
||||
public void setData(EntityPlayer player){
|
||||
PlayerData playerData = PlayerDataController.Instance.getPlayerData(player);
|
||||
public void setData(EntityPlayer player) {
|
||||
PlayerData playerData = PlayerDataController.Instance.getPlayerData(player);
|
||||
|
||||
for(Quest quest : PlayerQuestController.getActiveQuests(player))
|
||||
{
|
||||
String category = quest.category.title;
|
||||
if(!categories.containsKey(category))
|
||||
categories.put(category, new Vector<String>());
|
||||
Vector<String> list = categories.get(category);
|
||||
list.add(quest.title);
|
||||
for (Quest quest : PlayerQuestController.getActiveQuests(player)) {
|
||||
String category = quest.category.title;
|
||||
if (!categories.containsKey(category))
|
||||
categories.put(category, new Vector<String>());
|
||||
Vector<String> list = categories.get(category);
|
||||
list.add(quest.title);
|
||||
|
||||
String key = category + ":" + quest.title;
|
||||
questText.put(key, quest.logText);
|
||||
questAlerts.put(key, String.valueOf(playerData.questData.activeQuests.get(quest.id).sendAlerts));
|
||||
questStatus.put(key, quest.questInterface.getQuestLogStatus(player));
|
||||
if(quest.completion == EnumQuestCompletion.Npc && quest.questInterface.isCompleted(playerData))
|
||||
finish.put(key, quest.completerNpc);
|
||||
questText.put(key, quest.logText);
|
||||
questAlerts.put(key, String.valueOf(playerData.questData.activeQuests.get(quest.id).sendAlerts));
|
||||
questStatus.put(key, quest.questInterface.getQuestLogStatus(player));
|
||||
if (quest.completion == EnumQuestCompletion.Npc && quest.questInterface.isCompleted(playerData))
|
||||
finish.put(key, quest.completerNpc);
|
||||
|
||||
if (playerData.questData.getTrackedQuest() != null) {
|
||||
if (quest.id == playerData.questData.getTrackedQuest().getId()) {
|
||||
trackedQuestKey = key;
|
||||
}
|
||||
}
|
||||
if (playerData.questData.getTrackedQuest() != null) {
|
||||
if (quest.id == playerData.questData.getTrackedQuest().getId()) {
|
||||
trackedQuestKey = key;
|
||||
}
|
||||
}
|
||||
|
||||
if (quest.partyOptions.allowParty) {
|
||||
partyQuests.put(key, quest.id);
|
||||
if (quest.partyOptions.allowParty) {
|
||||
partyQuests.put(key, quest.id);
|
||||
partyOptions.put(key, quest.partyOptions.getPartyOptionsList());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Party party = playerData.getPlayerParty();
|
||||
if(party != null && party.getQuest() != null){
|
||||
if (party != null && party.getQuest() != null) {
|
||||
if (playerData.questData.getTrackedQuest() != null) {
|
||||
if (party.getQuest().getId() == playerData.questData.getTrackedQuest().getId()) {
|
||||
trackedQuestKey = "P" + ":" + party.getQuest().getCategory().getName() + ":" + party.getQuest().getName();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setTrackedQuestKey(EntityPlayer player){
|
||||
public void setTrackedQuestKey(EntityPlayer player) {
|
||||
PlayerData playerData = PlayerDataController.Instance.getPlayerData(player);
|
||||
|
||||
Party party = playerData.getPlayerParty();
|
||||
if(party != null && party.getQuest() != null){
|
||||
if (party != null && party.getQuest() != null) {
|
||||
if (playerData.questData.getTrackedQuest() != null) {
|
||||
if (party.getQuest().getId() == playerData.questData.getTrackedQuest().getId()) {
|
||||
trackedQuestKey = "P" + ":" + party.getQuest().getCategory().getName() + ":" + party.getQuest().getName();
|
||||
}
|
||||
}
|
||||
} else if(playerData.questData != null && playerData.questData.getTrackedQuest() != null){
|
||||
} else if (playerData.questData != null && playerData.questData.getTrackedQuest() != null) {
|
||||
IQuest quest = playerData.questData.getTrackedQuest();
|
||||
trackedQuestKey = quest.getCategory().getName() + ":" + quest.getName();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
trackedQuestKey = "";
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasSelectedQuest() {
|
||||
return !selectedQuest.isEmpty();
|
||||
}
|
||||
public boolean hasSelectedQuest() {
|
||||
return !selectedQuest.isEmpty();
|
||||
}
|
||||
|
||||
public String getQuestText() {
|
||||
return questText.get(selectedCategory + ":" + selectedQuest);
|
||||
}
|
||||
public String getQuestText() {
|
||||
return questText.get(selectedCategory + ":" + selectedQuest);
|
||||
}
|
||||
|
||||
public Boolean getQuestAlerts() {
|
||||
return Boolean.valueOf(questAlerts.get(selectedCategory+":"+selectedQuest));
|
||||
}
|
||||
public Boolean getQuestAlerts() {
|
||||
return Boolean.valueOf(questAlerts.get(selectedCategory + ":" + selectedQuest));
|
||||
}
|
||||
|
||||
public void toggleQuestAlerts() {
|
||||
questAlerts.put(selectedCategory+":"+selectedQuest,String.valueOf(!getQuestAlerts()));
|
||||
}
|
||||
public void toggleQuestAlerts() {
|
||||
questAlerts.put(selectedCategory + ":" + selectedQuest, String.valueOf(!getQuestAlerts()));
|
||||
}
|
||||
|
||||
public Vector<String> getQuestStatus() {
|
||||
return questStatus.get(selectedCategory + ":" + selectedQuest);
|
||||
}
|
||||
public Vector<String> getQuestStatus() {
|
||||
return questStatus.get(selectedCategory + ":" + selectedQuest);
|
||||
}
|
||||
|
||||
public String getComplete() {
|
||||
return finish.get(selectedCategory + ":" + selectedQuest);
|
||||
}
|
||||
public String getComplete() {
|
||||
return finish.get(selectedCategory + ":" + selectedQuest);
|
||||
}
|
||||
|
||||
public Vector<String> getPartyOptions() {
|
||||
return partyOptions.get(selectedCategory + ":" + selectedQuest);
|
||||
|
||||
Reference in new issue
Block a user