diff options
author | Lorenz <lo.scherf@gmail.com> | 2022-09-12 18:27:56 +0200 |
---|---|---|
committer | Lorenz <lo.scherf@gmail.com> | 2022-09-12 18:27:56 +0200 |
commit | 76344b15344bafccb8ebc808a70069288c398e3d (patch) | |
tree | b6bcbf5b3f84629faeadfaddc906149511830cbe /src/main/java/io | |
parent | 0f84f9627ae7298ec34415daf087c93880c3ad4e (diff) | |
download | NotEnoughUpdates-76344b15344bafccb8ebc808a70069288c398e3d.tar.gz NotEnoughUpdates-76344b15344bafccb8ebc808a70069288c398e3d.tar.bz2 NotEnoughUpdates-76344b15344bafccb8ebc808a70069288c398e3d.zip |
fixed bug that tier 2 snow minion doesn't have their requirement achieved when tier 1 snow minion is already owned
Diffstat (limited to 'src/main/java/io')
3 files changed, 18 insertions, 12 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/MinionHelperManager.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/MinionHelperManager.java index adf3d98e..73101191 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/MinionHelperManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/MinionHelperManager.java @@ -124,7 +124,7 @@ public class MinionHelperManager { return minionName.toUpperCase().replace(" ", "_"); } - public List<Minion> getChildren(Minion minion) { + private List<Minion> getChildren(Minion minion) { List<Minion> list = new ArrayList<>(); for (Minion other : minions.values()) { if (minion == other.getParent()) { @@ -154,7 +154,19 @@ public class MinionHelperManager { ApiData apiData = api.getApiData(); if (apiData != null) { for (String minion : apiData.getCraftedMinions()) { - getMinionById(minion).setCrafted(true); + setCrafted(getMinionById(minion)); + } + } + } + + public void setCrafted(Minion minion) { + minion.setCrafted(true); + + if (minion.getCustomSource() != null) { + minion.setMeetRequirements(true); + + for (Minion child : getChildren(minion)) { + child.setMeetRequirements(true); } } } @@ -242,6 +254,8 @@ public class MinionHelperManager { Utils.addChatMessage("§6/neudevtest minion clearapi §7Clears the api data"); Utils.addChatMessage("§6/neudevtest minion maxperpage <number> §7Changes the max minions per page number"); Utils.addChatMessage("§6/neudevtest minion arrowpos <x, y> §7Changes the position of the page numbers"); + Utils.addChatMessage("§6/neudevtest minion setplayer <player-uuid> <player-profile-name> [need-for-next-slot] §7" + + "See the Minions missing of other player"); Utils.addChatMessage(""); } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/loaders/MinionHelperChatLoader.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/loaders/MinionHelperChatLoader.java index 6c46a1bb..451e6896 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/loaders/MinionHelperChatLoader.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/loaders/MinionHelperChatLoader.java @@ -85,14 +85,6 @@ public class MinionHelperChatLoader { } private void setCrafted(Minion minion) { - minion.setCrafted(true); - - if (!minion.doesMeetRequirements()) { - minion.setMeetRequirements(true); - - for (Minion child : manager.getChildren(minion)) { - child.setMeetRequirements(true); - } - } + manager.setCrafted(minion); } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/util/MinionHelperRequirementsManager.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/util/MinionHelperRequirementsManager.java index bd3b4d1a..e638c819 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/util/MinionHelperRequirementsManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/util/MinionHelperRequirementsManager.java @@ -110,7 +110,7 @@ public class MinionHelperRequirementsManager { return false; } } else if (requirement instanceof CustomRequirement) { - return minion.isCrafted(); + return minion.doesMeetRequirements(); } return false; |