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