package com.dunerealms.menus; import org.bukkit.Material; import org.bukkit.entity.Player; /** 3 rows. Left to right: your item, what it needs, the result. Click the result to refit at once. */ final class EquipmentMenu extends Menu { EquipmentMenu(DuneMenusPlugin plugin, Player p, Menu parent) { super(plugin, p, parent); } String id() { return "equipment"; } Skin skin() { return Skin.FORGE; } String title() { return "Quartermaster · Refit"; } String subtitle() { return "“Good gear can be made whole again.”"; } int rows() { return 3; } void draw() { backdrop(Material.BLACK_STAINED_GLASS_PANE); for (int s : new int[]{11, 12, 14, 15}) put(s, Ui.pane(Material.LIGHT_BLUE_STAINED_GLASS_PANE)); back(18); load(backend().refitQuote(player), q -> { put(10, Ui.item(q.icon(), "" + q.itemName(), "Your original item")); put(13, Ui.item(Material.IRON_INGOT, "Needs", q.costs().stream().map(c -> "" + c).toArray(String[]::new))); if (q.possible()) put(16, Ui.glow(Ui.item(Material.SMITHING_TABLE, "Refit now", "" + q.note())), t -> act(backend().refit(player))); else put(16, Ui.item(Material.BARRIER, "Can't refit yet", "" + q.note())); }); } }