Separate out Haunted Chest purchase condition

This commit is contained in:
cnr 2017-07-01 04:11:03 -07:00
parent cd110ddef9
commit 5a4fab5fc0

View File

@ -109,7 +109,20 @@ public class BuyChestButton implements IButton
return;
}
}
if (_chestType == TreasureType.FREEDOM || _chestType == TreasureType.HAUNTED)
if (_chestType == TreasureType.HAUNTED)
{
if (!new File("../../update/files/EnableHauntedChest.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)
{
if (!new File("../../update/files/EnableFreedomChest.dat").exists())
{