当前位置: 首页>>代码示例>>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;未经允许,请勿转载。