本文整理汇总了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);
}
}
示例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;
}
}