use of au.com.mineauz.minigames.menu.MenuItemPage in project Minigames by AddstarMC.
the class GameOverModule method addEditMenuOptions.
@Override
public void addEditMenuOptions(Menu menu) {
Menu m = new Menu(6, "Game Over Settings", menu.getViewer());
m.addItem(timer.getMenuItem("Time Length", Material.WATCH, 0, null));
m.addItem(invincible.getMenuItem("Invincibility", Material.ENDER_PEARL));
m.addItem(humiliation.getMenuItem("Humiliation Mode", Material.DIAMOND_SWORD, MinigameUtils.stringToList("Losers are stripped;of weapons and can't kill")));
m.addItem(interact.getMenuItem("Allow Interact", Material.STONE_PLATE));
m.addItem(new MenuItemPage("Back", Material.REDSTONE_TORCH_ON, menu), m.getSize() - 9);
menu.addItem(new MenuItemPage("Game Over Settings", Material.WOOD_DOOR, m));
}
use of au.com.mineauz.minigames.menu.MenuItemPage in project Minigames by AddstarMC.
the class InfectionModule method displayMechanicSettings.
@Override
public boolean displayMechanicSettings(Menu previous) {
Menu m = new Menu(6, "Infection Settings", previous.getViewer());
m.addItem(new MenuItemPage("Back", Material.REDSTONE_TORCH_ON, previous), m.getSize() - 9);
m.addItem(infectedPercent.getMenuItem("Infected Percent", Material.SKULL_ITEM, MinigameUtils.stringToList("The percentage of players;chosen to start as;infected"), 1, 99));
m.displayMenu(previous.getViewer());
return true;
}
use of au.com.mineauz.minigames.menu.MenuItemPage in project Minigames by AddstarMC.
the class PlayerFoodRangeCondition method displayMenu.
@Override
public boolean displayMenu(MinigamePlayer player, Menu prev) {
Menu m = new Menu(3, "XP Range", player);
m.addItem(min.getMenuItem("Min Food", Material.STEP, 0, 20));
m.addItem(max.getMenuItem("Max Food", Material.STONE, 0, 20));
m.addItem(new MenuItemPage("Back", Material.REDSTONE_TORCH_ON, prev), m.getSize() - 9);
addInvertMenuItem(m);
m.displayMenu(player);
return true;
}
use of au.com.mineauz.minigames.menu.MenuItemPage in project Minigames by AddstarMC.
the class PlayerHasItemCondition method displayMenu.
@Override
public boolean displayMenu(MinigamePlayer player, Menu prev) {
Menu m = new Menu(3, "Player Has Item", player);
m.addItem(new MenuItemPage("Back", Material.REDSTONE_TORCH_ON, prev), m.getSize() - 9);
final MinigamePlayer fply = player;
m.addItem(new MenuItemString("Item", Material.STONE, new Callback<String>() {
@Override
public void setValue(String value) {
if (Material.getMaterial(value.toUpperCase()) != null)
type.setFlag(value.toUpperCase());
else
fply.sendMessage("Invalid Item!", "error");
}
@Override
public String getValue() {
return type.getFlag();
}
}));
m.addItem(useData.getMenuItem("Match Item Data", Material.ENDER_PEARL));
m.addItem(data.getMenuItem("Data Value", Material.EYE_OF_ENDER, 0, null));
m.addItem(new MenuItemList("Search Where", Material.COMPASS, new Callback<String>() {
@Override
public void setValue(String value) {
where.setFlag(value.toUpperCase());
}
@Override
public String getValue() {
return WordUtils.capitalizeFully(where.getFlag());
}
}, Arrays.asList("Anywhere", "Hotbar", "Main", "Armor", "Slot")));
m.addItem(slot.getMenuItem("Slot", Material.DIAMOND, 0, 35));
m.addItem(new MenuItemNewLine());
m.addItem(matchName.getMenuItem("Match Display Name", Material.NAME_TAG));
MenuItemString menuItem = (MenuItemString) name.getMenuItem("Display Name", Material.NAME_TAG, MinigameUtils.stringToList("The name to match.;Use % to do a wildcard match"));
menuItem.setAllowNull(true);
m.addItem(menuItem);
m.addItem(matchLore.getMenuItem("Match Lore", Material.BOOK));
menuItem = (MenuItemString) lore.getMenuItem("Lore", Material.BOOK, MinigameUtils.stringToList("The lore to match. Separate;with semi-colons;for new lines.;Use % to do a wildcard match"));
menuItem.setAllowNull(true);
m.addItem(menuItem);
addInvertMenuItem(m);
m.displayMenu(player);
return true;
}
use of au.com.mineauz.minigames.menu.MenuItemPage in project Minigames by AddstarMC.
the class MatchBlockCondition method displayMenu.
@Override
public boolean displayMenu(MinigamePlayer player, Menu prev) {
Menu m = new Menu(3, "Match Block", player);
m.addItem(new MenuItemPage("Back", Material.REDSTONE_TORCH_ON, prev), m.getSize() - 9);
final MenuItemCustom c = new MenuItemCustom("Auto Set Block", MinigameUtils.stringToList("Click here with a;block you wish to;match to."), Material.ITEM_FRAME);
m.addItem(c, m.getSize() - 1);
final MinigamePlayer ply = m.getViewer();
final MenuItemString btype = new MenuItemString("Block Type", Material.STONE, new Callback<String>() {
@Override
public void setValue(String value) {
if (Material.matchMaterial(value.toUpperCase()) != null)
type.setFlag(value.toUpperCase());
else
ply.sendMessage("No block found by that name!", "error");
}
@Override
public String getValue() {
return type.getFlag();
}
});
m.addItem(btype);
final MenuItemBoolean busedur = (MenuItemBoolean) useDur.getMenuItem("Use Data Values", Material.ENDER_PEARL);
m.addItem(busedur);
final MenuItemInteger bdur = (MenuItemInteger) dur.getMenuItem("Data Value", Material.PAPER, 0, 16);
m.addItem(bdur);
c.setClickItem(new InteractionInterface() {
@Override
public Object interact(Object object) {
ItemStack i = (ItemStack) object;
type.setFlag(i.getType().toString());
useDur.setFlag(true);
dur.setFlag(((Short) i.getDurability()).intValue());
bdur.updateDescription();
busedur.updateDescription();
btype.updateDescription();
return c.getItem();
}
});
addInvertMenuItem(m);
m.displayMenu(player);
return true;
}
Aggregations