Fixed spring chests being purchasable even if locked or if player had all the items

This commit is contained in:
LCastr0 2017-04-04 17:29:45 -03:00
parent 957004f97a
commit 424e0fe0a4

View File

@ -83,6 +83,19 @@ public class BuyChestButton implements IButton
return;
}
}
if (_chestType == TreasureType.SPRING)
{
if (!new File("../../update/files/EnableSpringChest.dat").exists())
{
player.sendMessage(F.main("Treasure", "That chest is no longer available for purchase!"));
return;
}
if (!_page.getPlugin().hasItemsToGivePlayer(_chestType.getRewardPool(), player))
{
player.sendMessage(F.main("Treasure", "You seem to have all treasures for this chest unlocked already!"));
return;
}
}
if (_chestType == TreasureType.FREEDOM || _chestType == TreasureType.HAUNTED)
{
if (!_page.getPlugin().hasItemsToGivePlayer(_chestType.getRewardPool(), player))