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


Java SkullType類代碼示例

本文整理匯總了Java中org.bukkit.SkullType的典型用法代碼示例。如果您正苦於以下問題:Java SkullType類的具體用法?Java SkullType怎麽用?Java SkullType使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: run

import org.bukkit.SkullType; //導入依賴的package包/類
@Override
public void run() {
	if (loc == null) {
		return;
	}
	Block b = loc.getBlock();
	if (b.getType() != Material.SKULL) {
		return;
	}
	Skull skull = (Skull) b.getState();
	if (type == SkullType.PLAYER) {
		skull.setSkullType(type);
		skull.setOwner(owner);
	} else {
		skull.setSkullType(type);
	}
	skull.update();
}
 
開發者ID:jiongjionger,項目名稱:NeverLag,代碼行數:19,代碼來源:AntiDamageSkull.java

示例2: getSkullType

import org.bukkit.SkullType; //導入依賴的package包/類
static SkullType getSkullType(int id) {
    switch (id) {
        case 0:
            return SkullType.SKELETON;
        case 1:
            return SkullType.WITHER;
        case 2:
            return SkullType.ZOMBIE;
        case 3:
            return SkullType.PLAYER;
        case 4:
            return SkullType.CREEPER;
        default:
            throw new AssertionError(id);
    }
}
 
開發者ID:UraniumMC,項目名稱:Uranium,代碼行數:17,代碼來源:CraftSkull.java

示例3: setOwner

import org.bukkit.SkullType; //導入依賴的package包/類
public boolean setOwner(String name) {
    if (name == null || name.length() > MAX_OWNER_LENGTH) {
        return false;
    }

    GameProfile profile = MinecraftServer.getServer().func_152358_ax().func_152655_a (name);
    if (profile == null) {
        return false;
    }

    if (skullType != SkullType.PLAYER) {
        skullType = SkullType.PLAYER;
    }

    this.profile = profile;
    return true;
}
 
開發者ID:UraniumMC,項目名稱:Uranium,代碼行數:18,代碼來源:CraftSkull.java

示例4: update

import org.bukkit.SkullType; //導入依賴的package包/類
@Override
public boolean update(boolean force, boolean applyPhysics) {
    boolean result = super.update(force, applyPhysics);

    if (result) {
        if (skullType == SkullType.PLAYER) {
            skull.func_152106_a(profile);
        } else {
            skull.func_152107_a(getSkullType(skullType));
        }

        skull.func_145903_a(rotation);
        skull.markDirty();
    }

    return result;
}
 
開發者ID:UraniumMC,項目名稱:Uranium,代碼行數:18,代碼來源:CraftSkull.java

示例5: createPlayerHead

import org.bukkit.SkullType; //導入依賴的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

示例6: createSkullItemStack

import org.bukkit.SkullType; //導入依賴的package包/類
public static ItemStack createSkullItemStack(String uuid, String textureValue, String textureSignature) {

		WrappedGameProfile wrappedProfile = new WrappedGameProfile(UUID.fromString(uuid), null);
		wrappedProfile.getProperties().put("textures", new WrappedSignedProperty("textures", textureValue, textureSignature));

		ItemStack skull = new ItemStack(Material.SKULL_ITEM, 1, (short) SkullType.PLAYER.ordinal());
		SkullMeta sm = (SkullMeta) skull.getItemMeta();

		Field profileField = null;
		try {
			profileField = sm.getClass().getDeclaredField("profile");
			profileField.setAccessible(true);
			profileField.set(sm, wrappedProfile.getHandle());
		} catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException e1) {
			e1.printStackTrace();
		}

		skull.setItemMeta(sm);
		return skull;
	}
 
開發者ID:RoboTricker,項目名稱:Transport-Pipes,代碼行數:21,代碼來源:InventoryUtils.java

示例7: createMemberMenu

import org.bukkit.SkullType; //導入依賴的package包/類
public static List<Inventory> createMemberMenu(Clans clan){
	Clan clanProfile = new Clan(clan);
	List<Inventory> pages = new ArrayList<Inventory>();
	int page = 1;
	pages.add(Bukkit.createInventory(null, 54, "Page "+page));
	List<ca.damocles.accountsystem.Character> clansmen = clanProfile.getClansmen();
	for(ca.damocles.accountsystem.Character members : clansmen){
	       ItemStack skull = new ItemStack(Material.SKULL_ITEM, 1, (short)SkullType.PLAYER.ordinal());
	       SkullMeta meta = (SkullMeta) skull.getItemMeta();
	       meta.setOwningPlayer(Bukkit.getOfflinePlayer(members.uuid));
	         skull.setItemMeta(meta);
		if(pages.get(pages.size()-1).firstEmpty() == -1){
			page = page+1;
			pages.add(Bukkit.createInventory(null, 54, "Page "+page));
			pages.get(pages.size()-1).addItem(skull);
		}else{
			pages.get(pages.size()-1).addItem(skull);
		}
		members.getPlayer().updateInventory();
	}
	return pages;
}
 
開發者ID:DamoclesProject,項目名稱:Damocles,代碼行數:23,代碼來源:ClanMenu.java

示例8: setOwner

import org.bukkit.SkullType; //導入依賴的package包/類
public boolean setOwner(String name) {
    if (name == null || name.length() > MAX_OWNER_LENGTH) {
        return false;
    }

    GameProfile profile = MinecraftServer.getServer().getUserCache().getProfile(name);
    if (profile == null) {
        return false;
    }

    if (skullType != SkullType.PLAYER) {
        skullType = SkullType.PLAYER;
    }

    this.profile = profile;
    return true;
}
 
開發者ID:OvercastNetwork,項目名稱:CraftBukkit,代碼行數:18,代碼來源:CraftSkull.java

示例9: update

import org.bukkit.SkullType; //導入依賴的package包/類
@Override
public boolean update(boolean force, boolean applyPhysics) {
    boolean result = super.update(force, applyPhysics);

    if (result) {
        if (skullType == SkullType.PLAYER) {
            skull.setGameProfile(profile);
        } else {
            skull.setSkullType(getSkullType(skullType));
        }

        skull.setRotation(rotation);
        skull.update();
    }

    return result;
}
 
開發者ID:OvercastNetwork,項目名稱:CraftBukkit,代碼行數:18,代碼來源:CraftSkull.java


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