当前位置: 首页>>代码示例>>Java>>正文


Java SkullType.SKELETON属性代码示例

本文整理汇总了Java中org.bukkit.SkullType.SKELETON属性的典型用法代码示例。如果您正苦于以下问题:Java SkullType.SKELETON属性的具体用法?Java SkullType.SKELETON怎么用?Java SkullType.SKELETON使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.bukkit.SkullType的用法示例。


在下文中一共展示了SkullType.SKELETON属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: fixSkull

private void fixSkull(Block block) {
	if (block != null && Material.SKULL == block.getType()) {
		Skull skull = (Skull) block.getState();
		if (skull.getSkullType() != SkullType.SKELETON) {
			final FixSkullTask task = new FixSkullTask(block.getLocation(), skull.getSkullType(), skull.getOwner());
			Bukkit.getServer().getScheduler().runTaskLater(NeverLag.getInstance(), task, 1L);
		}
	}
}
 
开发者ID:jiongjionger,项目名称:NeverLag,代码行数:9,代码来源:AntiDamageSkull.java

示例4: 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

示例5: 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.SKELETON属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。