diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2022-08-17 00:31:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-17 08:31:05 +1000 |
commit | 1d23d88488f1266538275e3c069916c1fec58281 (patch) | |
tree | 328a751e36b12113d1c3a4b1eae9db82ae5617fb | |
parent | 65158242ac750931ec358e50c394171cfee490ce (diff) | |
download | NotEnoughUpdates-1d23d88488f1266538275e3c069916c1fec58281.tar.gz NotEnoughUpdates-1d23d88488f1266538275e3c069916c1fec58281.tar.bz2 NotEnoughUpdates-1d23d88488f1266538275e3c069916c1fec58281.zip |
fix the 'missing repo data' warning (#230)
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BazaarSacksProfit.java | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BazaarSacksProfit.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BazaarSacksProfit.java index 3137fb90..084fd03f 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BazaarSacksProfit.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BazaarSacksProfit.java @@ -58,13 +58,12 @@ public class BazaarSacksProfit { private final Map<String, Integer> prices = new HashMap<>(); private final Map<String, String> names = new HashMap<>(); private final List<String> invalidNames = new ArrayList<>(); + private boolean dirty = true; @SubscribeEvent public void onGuiOpen(GuiOpenEvent event) { showSellOrderPrice = false; - prices.clear(); - names.clear(); - invalidNames.clear(); + dirty = true; } @SubscribeEvent(priority = EventPriority.LOW) @@ -82,7 +81,12 @@ public class BazaarSacksProfit { } pressedShiftLast = shift; - if (prices.isEmpty()) { + if (dirty) { + dirty = false; + prices.clear(); + names.clear(); + invalidNames.clear(); + out: for (String line : ItemUtils.getLore(itemStack)) { if (line.contains("§7x ")) { @@ -146,7 +150,6 @@ public class BazaarSacksProfit { map.put("§a" + formatter.format(amount) + "§7x §f" + name + " §7for §6" + priceFormat + " coins", extraPrice); } - event.toolTip.add(4, ""); if (showSellOrderPrice) { event.toolTip.add(4, "§7Sell order price: §6" + formatter.format(totalPrice)); @@ -159,7 +162,7 @@ public class BazaarSacksProfit { int index = 4; for (String name : invalidNames) { index++; - event.toolTip.add(4, name + " §cMissing repo data!"); + event.toolTip.add(4, name + " §c[NEU] Missing Repo data!"); } for (String text : TrophyRewardOverlay.sortByValue(map).keySet()) { index++; |