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