mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-26 23:12:55 +00:00
Party Quest Tracking
This commit is contained in:
1 parent
7a251ad64e
commit
67d4b3bd15
16 files changed
+308
-36
No files matched your search
@@ -528,6 +528,29 @@ public class QuestItem extends QuestInterface implements IQuestItem {
|
||||
|
||||
@Override
|
||||
public String getAdditionalText() {
|
||||
if(party != null && party.getObjectiveRequirement() == EnumPartyObjectives.All) {
|
||||
List<String> incompletePlayers = new ArrayList<>();
|
||||
EnumPartyObjectives objectives = party.getObjectiveRequirement();
|
||||
for (String name : party.getPlayerNames()) {
|
||||
EntityPlayer playerMP = NoppesUtilServer.getPlayerByName(name);
|
||||
if (playerMP == null){
|
||||
incompletePlayers.add(name + ": " + "N/A");
|
||||
continue;
|
||||
}
|
||||
|
||||
int amount = 0;
|
||||
for (ItemStack is : playerMP.inventory.mainInventory) {
|
||||
if (NoppesUtilPlayer.compareItems(this.questItem, is, ignoreDamage, ignoreNBT))
|
||||
amount += is.stackSize;
|
||||
}
|
||||
|
||||
int completedSize = ValueUtil.clamp(amount, 0, this.questItem.stackSize);
|
||||
if(completedSize < this.questItem.stackSize)
|
||||
incompletePlayers.add(name + ": " + completedSize);
|
||||
}
|
||||
if(!incompletePlayers.isEmpty())
|
||||
return "[" + String.join(", ", incompletePlayers) + "]";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user