Java Code Examples for org.bukkit.inventory.meta.SkullMeta#setLore()
The following examples show how to use
org.bukkit.inventory.meta.SkullMeta#setLore() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MatchManager.java From SkyWarsReloaded with GNU General Public License v3.0 | 6 votes |
private void prepareSpectateInv(Player player, GameMap gameMap) { int slot = 9; for (Player player1: gameMap.getAlivePlayers()) { if (player1 != null) { ItemStack playerhead1 = SkyWarsReloaded.getNMS().getBlankPlayerHead(); SkullMeta meta1 = (SkullMeta)playerhead1.getItemMeta(); SkyWarsReloaded.getNMS().updateSkull(meta1, player1); meta1.setDisplayName(ChatColor.YELLOW + player1.getName()); List<String> lore = new ArrayList<>(); lore.add(new Messaging.MessageFormatter().setVariable("player", player1.getName()).format("spectate.playeritemlore")); meta1.setLore(lore); playerhead1.setItemMeta(meta1); if (player != null) { player.getInventory().setItem(slot, playerhead1); } else { break; } slot++; } } if (player != null) { player.updateInventory(); } }
Example 2
Source File: SkinsGUI.java From SkinsRestorerX with GNU General Public License v3.0 | 5 votes |
private ItemStack createSkull(String name, Object property) { ItemStack is = XMaterial.PLAYER_HEAD.parseItem(); SkullMeta sm = (SkullMeta) is.getItemMeta(); List<String> lore = new ArrayList<>(); lore.add(Locale.SKINSMENU_SELECT_SKIN.replace("&", "ยง")); sm.setDisplayName(name); sm.setLore(lore); is.setItemMeta(sm); setSkin(is, ((Property) property).getValue()); return is; }
Example 3
Source File: GuiFactionList.java From factions-top with MIT License | 5 votes |
private ItemStack getItem(FactionWorth worth, Map<String, String> placeholders, Settings settings, String owner) { String text = insertPlaceholders(settings, worth, replace(this.text, placeholders)); List<String> lore = insertPlaceholders(settings, worth, replace(this.lore, placeholders)); ItemStack item = new ItemStack(Material.SKULL_ITEM, 1, (short) 3); SkullMeta meta = (SkullMeta) item.getItemMeta(); meta.setDisplayName(text); meta.setLore(lore); meta.setOwner(owner); item.setItemMeta(meta); return item; }
Example 4
Source File: LootGUI.java From EliteMobs with GNU General Public License v3.0 | 5 votes |
private void headerConstructor(Inventory inventory) { ItemStack arrowLeft = new ItemStack(Material.SKULL_ITEM, 1, (short) 3); SkullMeta arrowLeftSkullMeta = (SkullMeta) arrowLeft.getItemMeta(); arrowLeftSkullMeta.setOwner("MHF_ArrowLeft"); arrowLeftSkullMeta.setDisplayName("Previous Item Ranks"); arrowLeft.setItemMeta(arrowLeftSkullMeta); inventory.setItem(0, arrowLeft); ItemStack arrowRight = new ItemStack(Material.SKULL_ITEM, 1, (short) 3); SkullMeta arrowRightSkullMeta = (SkullMeta) arrowRight.getItemMeta(); arrowRightSkullMeta.setOwner("MHF_ArrowRight"); arrowRightSkullMeta.setDisplayName("Next Item Ranks"); arrowRight.setItemMeta(arrowRightSkullMeta); inventory.setItem(8, arrowRight); ItemStack signature = new ItemStack(Material.SKULL_ITEM, 1, (short) 3); SkullMeta signatureSkullMeta = (SkullMeta) signature.getItemMeta(); signatureSkullMeta.setOwner("magmaguy"); signatureSkullMeta.setDisplayName("EliteMobs by MagmaGuy"); List<String> signatureList = new ArrayList<>(); signatureList.add("Support the plugins you enjoy!"); signatureSkullMeta.setLore(signatureList); signature.setItemMeta(signatureSkullMeta); inventory.setItem(4, signature); }
Example 5
Source File: ContributorsMenu.java From Slimefun4 with GNU General Public License v3.0 | 5 votes |
private static ItemStack getContributorHead(Player p, Contributor contributor) { ItemStack skull = SlimefunUtils.getCustomHead(contributor.getTexture()); SkullMeta meta = (SkullMeta) skull.getItemMeta(); meta.setDisplayName(contributor.getDisplayName()); List<String> lore = new LinkedList<>(); lore.add(""); for (Map.Entry<String, Integer> entry : contributor.getContributions()) { String info = entry.getKey(); if (!info.startsWith("&")) { String[] segments = PatternUtils.COMMA.split(info); info = SlimefunPlugin.getLocalization().getMessage(p, "guide.credits.roles." + segments[0]); if (segments.length == 2) { info += " &7(" + SlimefunPlugin.getLocalization().getMessage(p, "languages." + segments[1]) + ')'; } } if (entry.getValue() > 0) { String commits = SlimefunPlugin.getLocalization().getMessage(p, "guide.credits." + (entry.getValue() > 1 ? "commits" : "commit")); info += " &7(" + entry.getValue() + ' ' + commits + ')'; } lore.add(ChatColors.color(info)); } if (contributor.getProfile() != null) { lore.add(""); lore.add(ChatColors.color("&7\u21E8 &e") + SlimefunPlugin.getLocalization().getMessage(p, "guide.credits.profile-link")); } meta.setLore(lore); skull.setItemMeta(meta); return skull; }
Example 6
Source File: SkyBlockMenu.java From uSkyBlock with GNU General Public License v3.0 | 4 votes |
public Inventory displayPartyPlayerGUI(final Player player, final String pname) { List<String> lores = new ArrayList<>(); String emptyTitle = tr("{0} <{1}>", "", tr("Permissions")); String title = tr("{0} <{1}>", pname.substring(0, Math.min(32-emptyTitle.length(), pname.length())), tr("Permissions")); Inventory menu = Bukkit.createInventory(new UltimateHolder(player, title, MenuType.DEFAULT), 9, title); final ItemStack pHead = new ItemStack(Material.PLAYER_HEAD, 1); final SkullMeta meta3 = (SkullMeta) pHead.getItemMeta(); ItemMeta meta2 = sign.getItemMeta(); meta2.setDisplayName(tr("\u00a79Player Permissions")); addLore(lores, tr("\u00a7eClick here to return to\n\u00a7eyour island group''s info.")); meta2.setLore(lores); sign.setItemMeta(meta2); menu.addItem(sign); lores.clear(); meta3.setOwner(pname); meta3.setDisplayName(tr("\u00a7e{0}''\u00a79s Permissions", pname)); addLore(lores, tr("\u00a7eHover over an icon to view\n\u00a7ea permission. Change the\n\u00a7epermission by clicking it.")); meta3.setLore(lores); pHead.setItemMeta(meta3); menu.addItem(pHead); lores.clear(); IslandInfo islandInfo = plugin.getIslandInfo(player); boolean isLeader = islandInfo.isLeader(player); for (PartyPermissionMenuItem menuItem : permissionMenuItems) { ItemStack itemStack = menuItem.getIcon(); meta2 = itemStack.getItemMeta(); if (islandInfo.hasPerm(pname, menuItem.getPerm())) { meta2.setDisplayName("\u00a7a" + menuItem.getTitle()); lores.add(tr("\u00a7fThis player \u00a7acan")); addLore(lores, "\u00a7f", menuItem.getDescription()); if (isLeader) { addLore(lores, "\u00a7f", tr("Click here to remove this permission.")); } } else { meta2.setDisplayName("\u00a7c" + menuItem.getTitle()); lores.add(tr("\u00a7fThis player \u00a7ccannot")); addLore(lores, "\u00a7f", menuItem.getDescription()); if (isLeader) { addLore(lores, "\u00a7f", tr("Click here to grant this permission.")); } } meta2.setLore(lores); itemStack.setItemMeta(meta2); menu.addItem(itemStack); lores.clear(); } return menu; }
Example 7
Source File: SkyBlockMenu.java From uSkyBlock with GNU General Public License v3.0 | 4 votes |
public Inventory displayPartyGUI(final Player player) { List<String> lores = new ArrayList<>(); String title = "\u00a79" + tr("Island Group Members"); Inventory menu = Bukkit.createInventory(new UltimateHolder(player, title, MenuType.DEFAULT), 18, title); IslandInfo islandInfo = plugin.getIslandInfo(player); final Set<String> memberList = islandInfo.getMembers(); final ItemMeta meta2 = sign.getItemMeta(); meta2.setDisplayName("\u00a7a" + tr("Island Group Members")); lores.add(tr("Group Members: \u00a72{0}\u00a77/\u00a7e{1}", islandInfo.getPartySize(), islandInfo.getMaxPartySize())); if (islandInfo.getPartySize() < islandInfo.getMaxPartySize()) { addLore(lores, tr("\u00a7aMore players can be invited to this island.")); } else { addLore(lores, tr("\u00a7cThis island is full.")); } addLore(lores, tr("\u00a7eHover over a player''s icon to\n\u00a7eview their permissions. The\n\u00a7eleader can change permissions\n\u00a7eby clicking a player''s icon.")); meta2.setLore(lores); sign.setItemMeta(meta2); menu.addItem(sign.clone()); lores.clear(); for (String temp : memberList) { ItemStack headItem = new ItemStack(Material.PLAYER_HEAD, 1); SkullMeta meta3 = (SkullMeta) headItem.getItemMeta(); meta3.setDisplayName(tr("\u00a7e{0}''s\u00a79 Permissions", temp)); meta3.setOwner(temp); boolean isLeader = islandInfo.isLeader(temp); if (isLeader) { addLore(lores, "\u00a7a\u00a7l", tr("Leader")); } else { addLore(lores, "\u00a7e\u00a7l", tr("Member")); } for (PartyPermissionMenuItem perm : permissionMenuItems) { if (isLeader || islandInfo.hasPerm(temp, perm.getPerm())) { lores.add("\u00a7a" + tr("Can {0}", "\u00a7f" + perm.getShortDescription())); } else { lores.add("\u00a7c" + tr("Cannot {0}", "\u00a7f" + perm.getShortDescription())); } } if (islandInfo.isLeader(player.getName())) { addLore(lores, tr("\u00a7e<Click to change this player''s permissions>")); } meta3.setLore(lores); headItem.setItemMeta(meta3); menu.addItem(headItem); lores.clear(); } return menu; }