Requested PR changes

This commit is contained in:
Spencer 2018-01-07 09:03:08 -05:00 committed by Alexander Meech
parent e7b67ae7d6
commit d10920329d
5 changed files with 17 additions and 12 deletions

View File

@ -37,8 +37,6 @@ public class SupportPage extends ShopPageBase<CustomerSupport, SupportShop>
{ {
super(plugin, shop, plugin.getClientManager(), plugin.getDonationManager(), name + " - " + target.getName(), player); super(plugin, shop, plugin.getClientManager(), plugin.getDonationManager(), name + " - " + target.getName(), player);
assert name.length() < 13;
_target = target; _target = target;
_donor = getPlugin().getDonationManager().Get(_target.getUniqueId()); _donor = getPlugin().getDonationManager().Get(_target.getUniqueId());
_previousPage = previousPage; _previousPage = previousPage;

View File

@ -44,11 +44,13 @@ public class SupportShop extends ShopBase<CustomerSupport>
// Who cares if they fail to load, the barrier // Who cares if they fail to load, the barrier
// button will just be there since the HomePage // button will just be there since the HomePage
// knows not to put it in. // knows not to put it in.
loadBonusLog(caller, target.getAccountId(), (bS) -> UtilServer.runAsync(() ->
loadPowerPlay(caller, target.getAccountId(), (ppcS) -> loadBonusLog(caller, target.getAccountId(), (bS) ->
loadPetClient(caller, target, (petS) -> loadPowerPlay(caller, target.getAccountId(), (ppcS) ->
loadBonusData(caller, target.getAccountId(), (bonusS) -> loadPetClient(caller, target, (petS) ->
openPageForPlayer(caller, new SupportHomePage(getPlugin(), this, caller, target)) loadBonusData(caller, target.getAccountId(), (bonusS) ->
UtilServer.runSync(() -> openPageForPlayer(caller, new SupportHomePage(getPlugin(), this, caller, target)))
)
) )
) )
) )

View File

@ -31,7 +31,8 @@ public class SupportCurrencyPage extends SupportPage
addButton(slot, 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), 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) if (success)
{ {
playSuccess(); playSuccess();

View File

@ -44,7 +44,8 @@ public abstract class SupportGiveItemPage extends SupportPage
{ {
addButton(minusSlot, addButton(minusSlot,
new ShopItem(Material.ARROW, "-1", new String[0], 1, false, true), new ShopItem(Material.ARROW, "-1", new String[0], 1, false, true),
(p, c) -> { (p, c) ->
{
_count--; _count--;
refresh(); refresh();
}); });
@ -59,7 +60,8 @@ public abstract class SupportGiveItemPage extends SupportPage
{ {
addButton(plusSlot, addButton(plusSlot,
new ShopItem(Material.ARROW, "+1", new String[0], 1, false, true), new ShopItem(Material.ARROW, "+1", new String[0], 1, false, true),
(p, c) -> { (p, c) ->
{
_count++; _count++;
refresh(); refresh();
}); });

View File

@ -105,7 +105,8 @@ public class SupportRankListPage extends SupportPage
return; 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()); message("You have applied the rank " + group.getDisplay(true, true, true, true).toUpperCase() + C.mBody + " to " + C.cYellow + _target.getName());
_target.setPrimaryGroup(group); _target.setPrimaryGroup(group);
refresh(); refresh();
@ -122,7 +123,8 @@ public class SupportRankListPage extends SupportPage
{ {
for (Pair<TreasureType, Integer> reward : _rankBonusItems.get(group)) for (Pair<TreasureType, Integer> reward : _rankBonusItems.get(group))
{ {
getPlugin().getInventoryManager().addItemToInventoryForOffline((success) -> { getPlugin().getInventoryManager().addItemToInventoryForOffline((success) ->
{
if (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())); _player.sendMessage(F.main(getPlugin().getName(), "You gave " + C.cYellow + reward.getRight() + " " + reward.getLeft().getItemName() + C.mBody + " to " + C.cYellow + _target.getName()));