當前位置: 首頁>>代碼示例>>Java>>正文


Java SkullMeta.setLore方法代碼示例

本文整理匯總了Java中org.bukkit.inventory.meta.SkullMeta.setLore方法的典型用法代碼示例。如果您正苦於以下問題:Java SkullMeta.setLore方法的具體用法?Java SkullMeta.setLore怎麽用?Java SkullMeta.setLore使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.bukkit.inventory.meta.SkullMeta的用法示例。


在下文中一共展示了SkullMeta.setLore方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createHeadPlayer

import org.bukkit.inventory.meta.SkullMeta; //導入方法依賴的package包/類
public static ItemStack createHeadPlayer(String displayname, String username, List<String> lore) {
    ItemStack playerHead = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
    SkullMeta sm = (SkullMeta)playerHead.getItemMeta();
    sm.setOwner(username);
    ArrayList<String> colorLore = new ArrayList<>();
    if (lore != null) {
        lore.forEach(str -> colorLore.add(Utils.colorize(str)));
        sm.setLore(colorLore);
    }

    sm.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS, ItemFlag.HIDE_ATTRIBUTES,
            ItemFlag.HIDE_DESTROYS, ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_PLACED_ON, ItemFlag.HIDE_UNBREAKABLE);
    sm.setDisplayName(Utils.colorize(displayname));
    playerHead.setItemMeta(sm);
    return playerHead;
}
 
開發者ID:cadox8,項目名稱:WC,代碼行數:17,代碼來源:ItemUtil.java

示例2: createPlayerHead

import org.bukkit.inventory.meta.SkullMeta; //導入方法依賴的package包/類
private ItemStack createPlayerHead(Player player)
{
    AbstractPlayerData playerData = SamaGamesAPI.get().getPlayerManager().getPlayerData(player.getUniqueId());

    ItemStack stack = new ItemStack(Material.SKULL_ITEM, 1, (short) SkullType.PLAYER.ordinal());
    SkullMeta meta = (SkullMeta) stack.getItemMeta();
    meta.setOwner(player.getName());
    meta.setDisplayName(PlayerUtils.getFullyFormattedPlayerName(player));

    List<String> lore = new ArrayList<>();
    lore.add(ChatColor.GRAY + "Pièces : " + ChatColor.GOLD + NumberUtils.format(playerData.getCoins()));
    lore.add(ChatColor.GRAY + "Perles : " + ChatColor.GREEN + NumberUtils.format(this.hub.getInteractionManager().getGraouManager().getPlayerPearls(player.getUniqueId()).size()));
    lore.add(ChatColor.GRAY + "Poussière d'" + ChatColor.AQUA + "\u272F" + ChatColor.GRAY + " : " + ChatColor.AQUA + NumberUtils.format(playerData.getPowders()));

    meta.setLore(lore);
    stack.setItemMeta(meta);

    return stack;
}
 
開發者ID:SamaGames,項目名稱:Hub,代碼行數:20,代碼來源:GuiProfile.java

示例3: createHeadPlayer

import org.bukkit.inventory.meta.SkullMeta; //導入方法依賴的package包/類
public static ItemStack createHeadPlayer(String displayname, String username, List<String> lore) {
    ItemStack playerHead = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
    SkullMeta sm = (SkullMeta) playerHead.getItemMeta();
    sm.setOwner(username);
    ArrayList<String> colorLore = new ArrayList<>();
    if (lore != null) {
        lore.forEach(str -> colorLore.add(Utils.colorize(str)));
        sm.setLore(colorLore);
    }

    sm.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS, ItemFlag.HIDE_ATTRIBUTES,
            ItemFlag.HIDE_DESTROYS, ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_PLACED_ON, ItemFlag.HIDE_UNBREAKABLE);
    sm.setDisplayName(Utils.colorize(displayname));
    playerHead.setItemMeta(sm);
    return playerHead;
}
 
開發者ID:cadox8,項目名稱:PA,代碼行數:17,代碼來源:ItemUtil.java

示例4: head

import org.bukkit.inventory.meta.SkullMeta; //導入方法依賴的package包/類
public static ItemStack head(String playerName, String displayName, String... lore) {
    ItemStack item = new ItemStack(Material.SKULL_ITEM, 1, (byte) 3);
    SkullMeta meta = (SkullMeta) item.getItemMeta();
    meta.setOwner(playerName);
    meta.setDisplayName(displayName);
    meta.setLore(Arrays.asList(lore));
    item.setItemMeta(meta);
    return item;
}
 
開發者ID:upperlevel,項目名稱:uppercore,代碼行數:10,代碼來源:GuiUtil.java

示例5: createSkull

import org.bukkit.inventory.meta.SkullMeta; //導入方法依賴的package包/類
public static ItemStack createSkull(String name, List<String> lore, String owner) {
	ItemStack i = new ItemStack(397, 1, (byte) 3);
	i = applyItemFlags(i);
	SkullMeta im = (SkullMeta) i.getItemMeta();
	try {
		im.setOwner(ChatColor.stripColor(owner));
	} catch (Exception ignored) {
	}
	im.setDisplayName(name);
	im.setLore(lore);
	i.setItemMeta(im);
	return i;
}
 
開發者ID:jusjus112,項目名稱:OnlineChecker-Spigot-SQL-Support,代碼行數:14,代碼來源:UtilItem.java

示例6: getPlayerSkull

import org.bukkit.inventory.meta.SkullMeta; //導入方法依賴的package包/類
public static ItemStack getPlayerSkull(String Display,int Stack, List<String> Lore, String PlayerName) {
	ItemStack i = new ItemStack(Material.SKULL_ITEM, Stack);
	i.setDurability((short)3);
	SkullMeta meta = (SkullMeta)i.getItemMeta();
	meta.setOwner(PlayerName);
	meta.setDisplayName(Display);
	meta.setLore(Lore);
	i.setItemMeta(meta);
	return i;
}
 
開發者ID:SkyLightQP,項目名稱:ArmorPlus,代碼行數:11,代碼來源:Util.java

示例7: toItemStack

import org.bukkit.inventory.meta.SkullMeta; //導入方法依賴的package包/類
/**
 * @return the box
 */
public ItemStack toItemStack(int amount) {
    ItemStack itemStack = new ItemStack(Material.SKULL_ITEM, amount, (short) 3);
    SkullMeta meta = (SkullMeta) itemStack.getItemMeta();
    meta.setDisplayName(config.getBoxName());
    meta.setOwner("MHF_Chest");
    meta.setLore(Arrays.asList(item.getIdLore()));
    itemStack.setItemMeta(meta);
    return itemStack;
}
 
開發者ID:DRE2N,項目名稱:ItemsXL,代碼行數:13,代碼來源:ItemBox.java

示例8: getItem

import org.bukkit.inventory.meta.SkullMeta; //導入方法依賴的package包/類
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;
}
 
開發者ID:novucs,項目名稱:factions-top,代碼行數:16,代碼來源:GuiFactionList.java

示例9: getItemStackRaw

import org.bukkit.inventory.meta.SkullMeta; //導入方法依賴的package包/類
@Override
protected ItemStack getItemStackRaw()
{
	String name = getName();
	ItemStack is = new ItemStack(Material.SKULL_ITEM);
	SkullType st = SkullType.parse(name);
	SkullMeta sm = (SkullMeta) is.getItemMeta();
	if (st == null)
	{
		is.setDurability((short) 3);
		sm.setOwner(name);
		sm.setDisplayName(MessageType.EQUIPMENT_PLAYERSKULLNAME.getTranslation().getValue(name));
	}
	else
	{
		name = st.getFormattedName();
		
		is.setDurability(st.getData());
		
		if(st.hasSkullTag())
			sm.setOwner(st.getSkullTag());
		
		sm.setDisplayName(MessageType.EQUIPMENT_SKULLNAME.getTranslation().getValue(name));
	}
	List<String> lore = new ArrayList<String>();
	lore.add(MessageType.EQUIPMENT_SKULLOWNER.getTranslation().getValue(name));
	sm.setLore(lore);
	is.setItemMeta(sm);
	return is;
}
 
開發者ID:Limeth,項目名稱:Breakpoint,代碼行數:31,代碼來源:BPSkull.java

示例10: buildHead

import org.bukkit.inventory.meta.SkullMeta; //導入方法依賴的package包/類
public static ItemStack buildHead(String name, String owner, List<String> lore, int amount) {
    ItemStack stack = new ItemStack(Material.SKULL_ITEM, amount, (short) SkullType.PLAYER.ordinal());
    SkullMeta meta = (SkullMeta) stack.getItemMeta();
    if(name != null) meta.setDisplayName(name);
    if(owner != null) meta.setOwner(owner);
    if(lore != null) meta.setLore(lore
            .stream()
            .map(item -> ChatColor.GRAY + item)
            .collect(Collectors.toList()));
    stack.setItemMeta(meta);
    return stack;
}
 
開發者ID:WesJD,項目名稱:OvercastMapPacker,代碼行數:13,代碼來源:Items.java

示例11: createSkull

import org.bukkit.inventory.meta.SkullMeta; //導入方法依賴的package包/類
public static ItemStack createSkull(Object s, String name) {
    ItemStack is = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
    SkullMeta sm = (SkullMeta) is.getItemMeta();
    List<String> lore = new ArrayList<String>();
    lore.add(C.c(Locale.SELECT_SKIN));
    sm.setDisplayName(name);
    sm.setLore(lore);
    is.setItemMeta(sm);
    is = setSkin(is, ((Property) s).getValue());
    return is;
}
 
開發者ID:Th3Tr0LLeR,項目名稱:SkinsRestorer---Maro,代碼行數:12,代碼來源:SkinsGUI.java

示例12: getSkull

import org.bukkit.inventory.meta.SkullMeta; //導入方法依賴的package包/類
static ItemStack getSkull(int rank, Long long1, UUID player){
    if (DEBUG)
        plugin.getLogger().info("DEBUG: Getting the skull");
    String playerName = plugin.getPlayers().getName(player);
    if (DEBUG) {
        plugin.getLogger().info("DEBUG: playername = " + playerName);
        
        plugin.getLogger().info("DEBUG: second chance = " + plugin.getPlayers().getName(player));
    }
    ItemStack playerSkull = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
    if (playerName == null) return null;
    SkullMeta meta = (SkullMeta) playerSkull.getItemMeta();
    meta.setOwner(playerName);
    meta.setDisplayName((plugin.myLocale(player).topTenGuiHeading.replace("[name]", plugin.getGrid().getIslandName(player))).replace("[rank]", String.valueOf(rank)));
    //meta.setDisplayName(ChatColor.YELLOW + "" + ChatColor.BOLD + "<!> " + ChatColor.YELLOW + "Island: " + ChatColor.GOLD + ChatColor.UNDERLINE + plugin.getGrid().getIslandName(player) + ChatColor.GRAY + " (#" + rank + ")");
    List<String> lore = new ArrayList<String>();
    lore.add(ChatColor.YELLOW + plugin.myLocale(player).levelislandLevel + " " + long1);
    if (plugin.getPlayers().inTeam(player)) {
        final List<UUID> pMembers = plugin.getPlayers().getMembers(player);
        // Need to make this a vertical list, because some teams are very large and it'll go off the screen otherwise
        List<String> memberList = new ArrayList<>();
        for (UUID members : pMembers) {
            memberList.add(ChatColor.AQUA + plugin.getPlayers().getName(members));
        }
        lore.addAll(memberList);
    }
    //else lore.add(ChatColor.AQUA + playerName);
    
    meta.setLore(lore);
    playerSkull.setItemMeta(meta);
    return playerSkull;
}
 
開發者ID:tastybento,項目名稱:acidisland,代碼行數:33,代碼來源:TopTen.java

示例13: mblock

import org.bukkit.inventory.meta.SkullMeta; //導入方法依賴的package包/類
/** Quick method for adding heads. **/
public ItemStack mblock(ItemStack item, String nick, String microblock) {
	SkullMeta meta = (SkullMeta) item.getItemMeta();
	meta.setDisplayName(ChatColor.GOLD + "Microblock: " + ChatColor.WHITE + microblock);
	meta.setOwner(nick);
	meta.setLore(Arrays.asList(ChatColor.GRAY + "Smaller than a block."));
	item.setItemMeta(meta);
	return item;
}
 
開發者ID:nihilist,項目名稱:microblocks,代碼行數:10,代碼來源:MicroblockCommand.java

示例14: mblock

import org.bukkit.inventory.meta.SkullMeta; //導入方法依賴的package包/類
/** Quick method for adding heads. **/
public ItemStack mblock(ItemStack item, String nick) {
	SkullMeta meta = (SkullMeta) item.getItemMeta();
	/** Nice, correct grammar for player names that end in 's' **/
	if(nick.endsWith("s") || nick.endsWith("S")) {
		meta.setDisplayName(ChatColor.GOLD + nick + ChatColor.WHITE + "' Head");
	}else {
		meta.setDisplayName(ChatColor.GOLD + nick + ChatColor.WHITE + "'s Head");
	}
	meta.setOwner(nick);
	meta.setLore(Arrays.asList(ChatColor.GRAY + "Place it, break it, wear it as a hat!"));
	item.setItemMeta(meta);
	return item;
}
 
開發者ID:nihilist,項目名稱:microblocks,代碼行數:15,代碼來源:SkullCommand.java

示例15: displayPartyPlayerGUI

import org.bukkit.inventory.meta.SkullMeta; //導入方法依賴的package包/類
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(null, 9, title);
    final ItemStack pHead = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
    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;
}
 
開發者ID:rlf,項目名稱:uSkyBlock,代碼行數:49,代碼來源:SkyBlockMenu.java


注:本文中的org.bukkit.inventory.meta.SkullMeta.setLore方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。