From d10920329d64c463e8677887d2f1420e1cc3e6da Mon Sep 17 00:00:00 2001 From: Spencer Date: Sun, 7 Jan 2018 09:03:08 -0500 Subject: [PATCH] Requested PR changes --- .../src/mineplex/staffServer/ui/SupportPage.java | 2 -- .../src/mineplex/staffServer/ui/SupportShop.java | 12 +++++++----- .../staffServer/ui/currency/SupportCurrencyPage.java | 3 ++- .../staffServer/ui/item/SupportGiveItemPage.java | 6 ++++-- .../staffServer/ui/rank/SupportRankListPage.java | 6 ++++-- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/SupportPage.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/SupportPage.java index 6b2ebf5b9..0bebe40e8 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/SupportPage.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/SupportPage.java @@ -37,8 +37,6 @@ public class SupportPage extends ShopPageBase { super(plugin, shop, plugin.getClientManager(), plugin.getDonationManager(), name + " - " + target.getName(), player); - assert name.length() < 13; - _target = target; _donor = getPlugin().getDonationManager().Get(_target.getUniqueId()); _previousPage = previousPage; diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/SupportShop.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/SupportShop.java index 87111ad42..c348fdf6e 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/SupportShop.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/SupportShop.java @@ -44,11 +44,13 @@ public class SupportShop extends ShopBase // Who cares if they fail to load, the barrier // button will just be there since the HomePage // knows not to put it in. - loadBonusLog(caller, target.getAccountId(), (bS) -> - loadPowerPlay(caller, target.getAccountId(), (ppcS) -> - loadPetClient(caller, target, (petS) -> - loadBonusData(caller, target.getAccountId(), (bonusS) -> - openPageForPlayer(caller, new SupportHomePage(getPlugin(), this, caller, target)) + UtilServer.runAsync(() -> + loadBonusLog(caller, target.getAccountId(), (bS) -> + loadPowerPlay(caller, target.getAccountId(), (ppcS) -> + loadPetClient(caller, target, (petS) -> + loadBonusData(caller, target.getAccountId(), (bonusS) -> + UtilServer.runSync(() -> openPageForPlayer(caller, new SupportHomePage(getPlugin(), this, caller, target))) + ) ) ) ) diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/currency/SupportCurrencyPage.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/currency/SupportCurrencyPage.java index b2d25831a..df0eeab24 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/currency/SupportCurrencyPage.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/currency/SupportCurrencyPage.java @@ -31,7 +31,8 @@ public class SupportCurrencyPage extends SupportPage addButton(slot, new ShopItem(currency.getDisplayMaterial(), currency.getColor() + C.Bold + currency.getString(amount, false), new String[] {C.mBody + "Click to award " + currency.getString(amount) }, i + 1, false, true), - (p, c) -> getPlugin().getDonationManager().rewardCurrency(currency, _target, "Support - " + getPlayer().getName(), amount, true, (success) -> { + (p, c) -> getPlugin().getDonationManager().rewardCurrency(currency, _target, "Support - " + getPlayer().getName(), amount, true, (success) -> + { if (success) { playSuccess(); diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/item/SupportGiveItemPage.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/item/SupportGiveItemPage.java index b4a6864a5..d8642ee56 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/item/SupportGiveItemPage.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/item/SupportGiveItemPage.java @@ -44,7 +44,8 @@ public abstract class SupportGiveItemPage extends SupportPage { addButton(minusSlot, new ShopItem(Material.ARROW, "-1", new String[0], 1, false, true), - (p, c) -> { + (p, c) -> + { _count--; refresh(); }); @@ -59,7 +60,8 @@ public abstract class SupportGiveItemPage extends SupportPage { addButton(plusSlot, new ShopItem(Material.ARROW, "+1", new String[0], 1, false, true), - (p, c) -> { + (p, c) -> + { _count++; refresh(); }); diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/rank/SupportRankListPage.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/rank/SupportRankListPage.java index 95934e489..5a1459a67 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/rank/SupportRankListPage.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/ui/rank/SupportRankListPage.java @@ -105,7 +105,8 @@ public class SupportRankListPage extends SupportPage return; } - getPlugin().getClientManager().setPrimaryGroup(_target.getAccountId(), group, () -> { + getPlugin().getClientManager().setPrimaryGroup(_target.getAccountId(), group, () -> + { message("You have applied the rank " + group.getDisplay(true, true, true, true).toUpperCase() + C.mBody + " to " + C.cYellow + _target.getName()); _target.setPrimaryGroup(group); refresh(); @@ -122,7 +123,8 @@ public class SupportRankListPage extends SupportPage { for (Pair reward : _rankBonusItems.get(group)) { - getPlugin().getInventoryManager().addItemToInventoryForOffline((success) -> { + getPlugin().getInventoryManager().addItemToInventoryForOffline((success) -> + { if (success) { _player.sendMessage(F.main(getPlugin().getName(), "You gave " + C.cYellow + reward.getRight() + " " + reward.getLeft().getItemName() + C.mBody + " to " + C.cYellow + _target.getName()));