You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
1.3 KiB

package cx.sfy.TheBridge.menus;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import cx.sfy.TheBridge.Main;
import cx.sfy.TheBridge.utils.ItemBuilder;
public class ShopMenu {
Main plugin;
public ShopMenu(Main plugin) {
this.plugin = plugin;
}
public void openShopMenu(Player p) {
Inventory inv = Bukkit.getServer().createInventory(null, plugin.getConfig().getInt("shop.size"), plugin.getLang().get("shop.title"));
ItemStack glass = ItemBuilder.item(Material.valueOf(plugin.getConfig().getString("shop.glass.icon")), plugin.getConfig().getInt("shop.glass.amount"), (short)plugin.getConfig().getInt("shop.glass.data"), plugin.getLang().get("shop.glass.nameItem"), plugin.getLang().get("shop.glass.loreItem"));
ItemStack close = ItemBuilder.item(Material.valueOf(plugin.getConfig().getString("shop.close.icon")), plugin.getConfig().getInt("shop.close.amount"), (short)plugin.getConfig().getInt("shop.close.data"), plugin.getLang().get("shop.close.nameItem"), plugin.getLang().get("shop.close.loreItem"));
inv.setItem(plugin.getConfig().getInt("shop.glass.slot"), glass);
inv.setItem(plugin.getConfig().getInt("shop.close.slot"), close);
p.openInventory(inv);
}
}