Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public VacantGUI(Cell cell, Player player) {
- List<Text> rentInfo = new ArrayList<Text>();
- rentInfo.add(deserialize("&7Rent Time: &c" + cell.getInitialTimeLeft() + " days"));
- rentInfo.add(deserialize("&7Cost per day: &c$" + cell.getPrice()));
- List<Text> rentCell = new ArrayList<Text>();
- rentCell.add(deserialize("&7Click here to rent this cell!"));
- rentCell.add(deserialize("&7InitialCost: &c$" + cell.getPrice()));
- StateContainer container = new StateContainer();
- PageBuilder vacantGUI = Page.builder().setAutoPaging(true).setTitle(deserialize(fm.getLanguage().getNode("VacantCellGUI", "Page1Title").getString()))
- .setEmptyStack(ItemStack.builder().itemType(null).build());
- for (int count = 0; count < 45; count++) {
- if (count <= 9 | count == 17) {
- vacantGUI.addElement(new Element(
- ItemStack.builder().itemType(ItemTypes.STAINED_GLASS_PANE).add(Keys.COLOR, Color.RED).build()));
- } else if ((count > 9 && count < 17) | (count < 26 && count > 18 && (count % 2 == 1))
- | (count > 28 && count < 35)) {
- vacantGUI.addElement(new Element(ItemStack.builder().itemType(ItemTypes.IRON_BARS).build()));
- } else if (count == 18 | count == 26) {
- vacantGUI.addElement(new Element(ItemStack.builder().itemType(ItemTypes.STAINED_GLASS_PANE)
- .add(Keys.COLOR, Color.GRAY).build()));
- } else if (count >= 35 | count == 27) {
- vacantGUI.addElement(new Element(ItemStack.builder().itemType(ItemTypes.STAINED_GLASS_PANE)
- .add(Keys.COLOR, Color.WHITE).build()));
- } else if (count == 20) {
- vacantGUI.addElement(new Element(ItemStack.builder().itemType(ItemTypes.BOOK)
- .add(Keys.DISPLAY_NAME, deserialize("&a&lRent Info")).add(Keys.ITEM_LORE, rentInfo).build()));
- } else if (count == 22) {
- vacantGUI.addElement(
- new ActionableElement(new RunnableAction(container, ActionType.NONE, "", context -> {
- cell.setOwner(player);
- }), ItemStack.builder().itemType(ItemTypes.CHEST)
- .add(Keys.DISPLAY_NAME, deserialize("&b&lRent Cell")).add(Keys.ITEM_LORE, rentCell)
- .build()));
- } else if (count == 24) {
- vacantGUI.addElement(
- new ActionableElement(new RunnableAction(container, ActionType.CLOSE, ""), ItemStack.builder()
- .itemType(ItemTypes.ARROW).add(Keys.DISPLAY_NAME, deserialize("&cClose GUI")).build()));
- }
- }
- container.setInitialState(vacantGUI.build("vacantGUI"));
- container.launchFor(player);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement