org.bukkit.entity.Stray Java Examples

The following examples show how to use org.bukkit.entity.Stray. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EntitySkeletonPet.java    From SonarPet with GNU General Public License v3.0 6 votes vote down vote up
@Override
@SuppressWarnings("deprecation") // We do a version check ;)
public SkeletonType getSkeletonType() {
    if (Versioning.NMS_VERSION.compareTo(NmsVersion.v1_11_R1) >= 0) {
        if (getBukkitEntity() instanceof WitherSkeleton) {
            return SkeletonType.WITHER;
        } else if (getBukkitEntity() instanceof Stray) {
            return SkeletonType.STRAY;
        } else {
            return SkeletonType.NORMAL;
        }
    } else {
        switch (getBukkitEntity().getSkeletonType()) {
            case WITHER:
                return SkeletonType.WITHER;
            case STRAY:
                return SkeletonType.STRAY;
            case NORMAL:
                return SkeletonType.NORMAL;
            default:
                throw new AssertionError("Unknown skeleton type!");
        }
    }
}