Refresh all player's pages when an item is purchased

This commit is contained in:
Sam 2017-11-07 22:24:35 +00:00 committed by Alexander Meech
parent ed7472f0c4
commit 43867a7018
2 changed files with 15 additions and 2 deletions

View File

@ -263,7 +263,13 @@ public class CakeResourcePage extends ShopPageBase<ArcadeManager, CakeResourceSh
player.sendMessage(F.main("Game", "You purchased " + F.name(getItemName(giveItem))) + ".");
playAcceptSound(player);
refresh();
getShop().getPageMap().values().forEach(page ->
{
if (page.getName().equals(getName()))
{
page.refresh();
}
});
}
}
}

View File

@ -15,6 +15,7 @@ import mineplex.core.common.util.UtilText;
import mineplex.core.itemstack.ItemBuilder;
import mineplex.core.recharge.Recharge;
import mineplex.core.shop.item.IButton;
import mineplex.core.shop.page.ShopPageBase;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.game.games.cakewars.shop.CakeItem;
@ -174,7 +175,13 @@ public class CakeResourceStarPage extends CakeResourcePage
}
playAcceptSound(player);
refresh();
getShop().getPageMap().values().forEach(page ->
{
if (page.getName().equals(getName()))
{
page.refresh();
}
});
}
}
}