From f9263b38bee7dc30320455f106a2d1f434c1bf97 Mon Sep 17 00:00:00 2001 From: Spencer Date: Fri, 5 Jan 2018 20:40:27 -0500 Subject: [PATCH] add predicate to getPackageOwnership, add shard purchases to chest page --- .../src/mineplex/staffServer/ui/SupportPage.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/SupportPage.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/SupportPage.java index 8256fd4fd..39d295fea 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/SupportPage.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/SupportPage.java @@ -5,6 +5,7 @@ import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.function.Predicate; import java.util.stream.Collectors; import org.bukkit.Material; @@ -53,12 +54,17 @@ public class SupportPage extends ShopPageBase return (rowIndex * 9) + columnIndex; } - protected Map getPackageOwnership(List validNames) + protected Map getPackageOwnership(List validNames, Predicate allowed) { Map ownership = new HashMap<>(); for (TransactionToken transaction : _donor.getTransactions()) { + if (!allowed.test(transaction)) + { + continue; + } + if (validNames.contains(transaction.SalesPackageName)) { ownership.putIfAbsent(transaction.SalesPackageName, 0); @@ -92,6 +98,11 @@ public class SupportPage extends ShopPageBase return ownership; } + public Map getPackageOwnership(List names) + { + return getPackageOwnership(names, (transactionToken -> transactionToken.Coins == 0 && transactionToken.Gems == 0)); + } + private List getBasicPlayerInfo() { List info = new ArrayList<>();