- Баллы
- 76
- Имя в Minecraft
- TheLastGapple
Код:
public static void chooseGUI(Player p) {
Inventory i = Bukkit.createInventory(null, 18, "§aAdminMenu");
for (PotionEffect pe : p.getActivePotionEffects()) {
if (pe.getType().equals(PotionEffectType.INVISIBILITY)) {
i.setItem(0, ItemUtil.create(Material.REDSTONE_BLOCK, "Вам нельзя открыть этот пункт!"));
i.setItem(9, ItemUtil.create(Material.REDSTONE_BLOCK, "Вам нельзя открыть этот пункт!"));
}
else {
i.setItem(0, ItemUtil.create(Material.WOOL, 0, (byte) 1, "§aВанишМеню", "§fЦена: §c50$", null, null, null, null));
i.setItem(9, ItemUtil.create(Material.WOOL, 0, (byte) 1, "§aВанишМеню New", null, null, null, null));
p.openInventory(i);
}
}
}
Код:
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if(cmd.getName().equalsIgnoreCase("adminmenu")) {
Player p = (Player) sender;
GUI.chooseGUI(p);
}
return true;
}