From 92b4ebfb34a7c0f9411eb0cc860d0b8df7071f1c Mon Sep 17 00:00:00 2001 From: Trixkz Date: Sun, 28 Nov 2021 11:53:57 -0500 Subject: [PATCH] t --- .../menus/shop/utilities/UtilityMenu.java | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 src/main/java/rip/tilly/bedwars/menus/shop/utilities/UtilityMenu.java diff --git a/src/main/java/rip/tilly/bedwars/menus/shop/utilities/UtilityMenu.java b/src/main/java/rip/tilly/bedwars/menus/shop/utilities/UtilityMenu.java new file mode 100644 index 0000000..4eb1f60 --- /dev/null +++ b/src/main/java/rip/tilly/bedwars/menus/shop/utilities/UtilityMenu.java @@ -0,0 +1,63 @@ +package rip.tilly.bedwars.menus.shop.utilities; + +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.entity.Player; +import rip.tilly.bedwars.BedWars; +import rip.tilly.bedwars.menus.shop.ShopButton; +import rip.tilly.bedwars.menus.shop.ShopType; +import rip.tilly.bedwars.menus.shop.ShopTypeButton; +import rip.tilly.bedwars.menus.shop.tools.ShearsButton; +import rip.tilly.bedwars.playerdata.PlayerData; +import rip.tilly.bedwars.playerdata.currentgame.PlayerCurrentGameData; +import rip.tilly.bedwars.utils.CC; +import rip.tilly.bedwars.utils.ItemBuilder; +import rip.tilly.bedwars.utils.menu.Button; +import rip.tilly.bedwars.utils.menu.Menu; + +import java.util.HashMap; +import java.util.Map; + +public class UtilityMenu extends Menu { + + private BedWars main = BedWars.getInstance(); + + @Override + public boolean isUpdateAfterClick() { + return true; + } + + @Override + public String getTitle(Player player) { + return CC.translate("&eClick a utility to purchase..."); + } + + @Override + public Map getButtons(Player player) { + Map buttons = new HashMap<>(); + + PlayerData playerData = this.main.getPlayerDataManager().getPlayerData(player.getUniqueId()); + + PlayerCurrentGameData playerCurrentGameData = playerData.getCurrentGameData(); + + for (ShopType types : ShopType.values()) { + buttons.put(types.getSlot(), new ShopTypeButton(types)); + } + + // im making the utility menu + // so, do not touch this + // lol + + buttons.put(ShopType.UTILITY.getSlot() + 9, Button.placeholder(Material.STAINED_GLASS_PANE, (byte) 5, "")); + buttons.put(19, new ShopButton("Golden Apple", Material.GOLDEN_APPLE, 0, 1, Material.GOLD_INGOT, "Gold", ChatColor.GOLD, 3, true)); + + this.fillEmptySlots(buttons, new ItemBuilder(Material.STAINED_GLASS_PANE).durability(7).name("").build()); + + return buttons; + } + + @Override + public int getSize() { + return 54; + } +}