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


Java SkullType.WITHER屬性代碼示例

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


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

示例1: getSkullType

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,代碼行數:16,代碼來源:CraftSkull.java

示例2: getSkullType

static SkullType getSkullType(int id) {
    switch (id) {
        default:
        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;
        case 5:
            return SkullType.DRAGON;
    }
}
 
開發者ID:bergerkiller,項目名稱:SpigotSource,代碼行數:17,代碼來源:CraftSkull.java

示例3: convert

@Override
@Nullable
public ItemType convert(final Object o) {
	final SkullType type;
	if (o instanceof Skeleton || o instanceof SkeletonData) {
		if (o instanceof SkeletonData ? ((SkeletonData) o).isWither() : ((Skeleton) o).getSkeletonType() == SkeletonType.WITHER) {
			type = SkullType.WITHER;
		} else {
			type = SkullType.SKELETON;
		}
	} else if (o instanceof Zombie || o instanceof EntityData && Zombie.class.isAssignableFrom(((EntityData<?>) o).getType())) {
		type = SkullType.ZOMBIE;
	} else if (o instanceof OfflinePlayer || o instanceof PlayerData) {
		type = SkullType.PLAYER;
	} else if (o instanceof Creeper || o instanceof CreeperData) {
		type = SkullType.CREEPER;
	} else {
		return null;
	}
	@SuppressWarnings("deprecation")
	final ItemType i = new ItemType(Material.SKULL_ITEM.getId(), (short) type.ordinal());
	if (o instanceof OfflinePlayer) {
		final SkullMeta s = (SkullMeta) Bukkit.getItemFactory().getItemMeta(Material.SKULL_ITEM);
		s.setOwner(((OfflinePlayer) o).getName());
		i.setItemMeta(s);
	}
	return i;
}
 
開發者ID:nfell2009,項目名稱:Skript,代碼行數:28,代碼來源:ExprSkull.java

示例4: getSkullType

static SkullType getSkullType(int id) {
    switch (id) {
        default:
        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;
    }
}
 
開發者ID:tgnmc,項目名稱:Craftbukkit,代碼行數:15,代碼來源:CraftSkull.java


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