Cap purchase date for sampson
This commit is contained in:
parent
3e8eecdf91
commit
39f0cd79bb
@ -13,6 +13,7 @@ import mineplex.core.treasure.TreasureType;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.inventory.ClickType;
|
import org.bukkit.event.inventory.ClickType;
|
||||||
|
import java.util.Calendar;
|
||||||
|
|
||||||
public class BuyChestButton implements IButton
|
public class BuyChestButton implements IButton
|
||||||
{
|
{
|
||||||
@ -46,6 +47,14 @@ public class BuyChestButton implements IButton
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_chestType == TreasureType.TRICK_OR_TREAT)
|
||||||
|
{
|
||||||
|
if (Calendar.MONTH != Calendar.OCTOBER || Calendar.DAY_OF_WEEK < CALENDAR.FRIDAY)
|
||||||
|
{
|
||||||
|
player.sendMessage(F.main("Treasure", "That chest is no longer available for purchase!"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (_chestType == TreasureType.FREEDOM)
|
if (_chestType == TreasureType.FREEDOM)
|
||||||
{
|
{
|
||||||
if (!_page.getPlugin().hasItemsToGivePlayer(_chestType.getRewardPool(), player))
|
if (!_page.getPlugin().hasItemsToGivePlayer(_chestType.getRewardPool(), player))
|
||||||
|
Loading…
Reference in New Issue
Block a user