mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 07:59:08 +00:00
Added current quest info to the party menu.
This commit is contained in:
1 parent
e46b78ff71
commit
1044269f5e
3 files changed
+137
-29
No files matched your search
@@ -38,6 +38,7 @@ public class Party {
|
||||
|
||||
//Client-sided
|
||||
private String partyLeaderName;
|
||||
private Quest quest;
|
||||
|
||||
public Party() {
|
||||
this.partyUUID = UUID.randomUUID();
|
||||
@@ -68,7 +69,11 @@ public class Party {
|
||||
}
|
||||
|
||||
public IQuest getQuest() {
|
||||
return QuestController.Instance.get(this.currentQuestID);
|
||||
if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) {
|
||||
return QuestController.Instance.get(this.currentQuestID);
|
||||
} else {
|
||||
return this.quest;
|
||||
}
|
||||
}
|
||||
|
||||
public int getCurrentQuestID() {
|
||||
@@ -295,11 +300,16 @@ public class Party {
|
||||
|
||||
public void readFromNBT(NBTTagCompound compound) {
|
||||
this.partyLeaderName = compound.getString("PartyLeader");
|
||||
this.currentQuestID = compound.getInteger("PartyQuestID");
|
||||
this.currentQuestName = compound.getString("PartyQuestName");
|
||||
this.friendlyFire = compound.getBoolean("FriendlyFire");
|
||||
this.partyLocked = compound.getBoolean("PartyLocked");
|
||||
|
||||
this.currentQuestID = compound.getInteger("PartyQuestID");
|
||||
if (compound.hasKey("QuestNBT")) {
|
||||
this.quest = new Quest();
|
||||
this.quest.readNBT(compound.getCompoundTag("QuestNBT"));
|
||||
}
|
||||
|
||||
NBTTagList list = compound.getTagList("PartyMembers", 10);
|
||||
for (int i = 0; i < list.tagCount(); i++) {
|
||||
NBTTagCompound tagCompound = list.getCompoundTagAt(i);
|
||||
@@ -314,11 +324,16 @@ public class Party {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
|
||||
compound.setString("PartyUUID", this.partyUUID.toString());
|
||||
compound.setInteger("PartyQuestID", this.currentQuestID);
|
||||
compound.setString("PartyQuestName", this.currentQuestName);
|
||||
compound.setBoolean("FriendlyFire", this.friendlyFire);
|
||||
compound.setBoolean("PartyLocked", this.partyLocked);
|
||||
|
||||
compound.setInteger("PartyQuestID", this.currentQuestID);
|
||||
if (this.getQuest() != null) {
|
||||
Quest quest = (Quest) this.getQuest();
|
||||
compound.setTag("QuestNBT", quest.writeToNBT(new NBTTagCompound()));
|
||||
}
|
||||
|
||||
NBTTagList list = new NBTTagList();
|
||||
for (UUID uuid : this.partyOrder) {
|
||||
NBTTagCompound uuidCompound = new NBTTagCompound();
|
||||
|
||||
Reference in new issue
Block a user