Search in sources :

Example 6 with RewardType

use of au.com.mineauz.minigames.minigame.reward.RewardType in project Minigames by AddstarMC.

the class MenuItemRewardGroup method onDoubleClick.

@Override
public ItemStack onDoubleClick() {
    Menu rewardMenu = new Menu(5, getName(), getContainer().getViewer());
    rewardMenu.setPreviousPage(getContainer());
    List<String> des = new ArrayList<String>();
    des.add("Click this with an item");
    des.add("to add it to rewards.");
    des.add("Click without an item");
    des.add("to add a money reward.");
    rewardMenu.addItem(new MenuItemRewardAdd("Add Item", des, Material.ITEM_FRAME, group), 43);
    rewardMenu.addItem(new MenuItemPage("Save " + getName(), Material.REDSTONE_TORCH_ON, rewardMenu.getPreviousPage()), 44);
    List<String> list = new ArrayList<String>();
    for (RewardRarity r : RewardRarity.values()) {
        list.add(r.toString());
    }
    List<MenuItem> mi = new ArrayList<MenuItem>();
    for (RewardType item : group.getItems()) {
        mi.add(item.getMenuItem());
    }
    rewardMenu.addItems(mi);
    rewardMenu.displayMenu(getContainer().getViewer());
    return null;
}
Also used : RewardType(au.com.mineauz.minigames.minigame.reward.RewardType) ArrayList(java.util.ArrayList) RewardRarity(au.com.mineauz.minigames.minigame.reward.RewardRarity)

Aggregations

RewardType (au.com.mineauz.minigames.minigame.reward.RewardType)6 RewardRarity (au.com.mineauz.minigames.minigame.reward.RewardRarity)2 Rewards (au.com.mineauz.minigames.minigame.reward.Rewards)2 ArrayList (java.util.ArrayList)2 Location (org.bukkit.Location)2 MinigameTimer (au.com.mineauz.minigames.MinigameTimer)1 InteractionInterface (au.com.mineauz.minigames.menu.InteractionInterface)1 Menu (au.com.mineauz.minigames.menu.Menu)1 MenuItem (au.com.mineauz.minigames.menu.MenuItem)1 MenuItemCustom (au.com.mineauz.minigames.menu.MenuItemCustom)1 MenuItemRewardAdd (au.com.mineauz.minigames.menu.MenuItemRewardAdd)1 MenuItemRewardGroup (au.com.mineauz.minigames.menu.MenuItemRewardGroup)1 MenuItemRewardGroupAdd (au.com.mineauz.minigames.menu.MenuItemRewardGroupAdd)1 TreasureHuntModule (au.com.mineauz.minigames.minigame.modules.TreasureHuntModule)1 ItemReward (au.com.mineauz.minigames.minigame.reward.ItemReward)1 RewardGroup (au.com.mineauz.minigames.minigame.reward.RewardGroup)1 RewardsModule (au.com.mineauz.minigames.minigame.reward.RewardsModule)1 StandardRewardScheme (au.com.mineauz.minigames.minigame.reward.scheme.StandardRewardScheme)1 List (java.util.List)1 Random (java.util.Random)1