Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.tylercreator.guichunk.ui;
- import org.bukkit.Bukkit;
- import org.bukkit.Location;
- import org.bukkit.entity.Player;
- import org.bukkit.inventory.Inventory;
- import org.bukkit.inventory.ItemStack;
- import me.tylercreator.guichunk.utilities.Utilities;
- public class gui {
- public static Inventory inv;
- public static String inventory_name;
- public static int inv_rows = 4 * 9;
- public static void initialize() {
- inventory_name = Utilities.chat("&8&l[&a&lChunkGUI&r&8&l]");
- inv = Bukkit.createInventory(null, inv_rows);
- }
- public static Inventory GUI (Player p) {
- Inventory toReturn = Bukkit.createInventory(null, inv_rows, inventory_name);
- if (p.hasPermission("chunkgui.use")) {
- Utilities.createItem(inv, 4, 1, 2, "&8[&aCoordinates&8]&r", "&9Get your actual coordinates.");
- } else {
- p.sendMessage("&cNo permissions!");
- }
- toReturn.setContents(inv.getContents());
- return toReturn;
- }
- public static void clicked(Player p, int slot, ItemStack clicked, Inventory inv) {
- if(clicked.getItemMeta().getDisplayName().equalsIgnoreCase(Utilities.chat("&8[&aCoordinates&8]&r"))) {
- Location l = p.getLocation();
- p.sendMessage("&8[&aGUIChunk&8]&f: Pos X:" + l.getX() + "Pos y:" + l.getY() + "Pos z:" + l.getZ());
- }
- }
- }
Add Comment
Please, Sign In to add comment