001    package org.bukkit.entity;
002    
003    /**
004     * Represents a Skeleton.
005     */
006    public interface Skeleton extends Monster {
007    
008        /**
009         * Gets the current type of this skeleton.
010         *
011         * @return Current type
012         */
013        public SkeletonType getSkeletonType();
014    
015        /**
016         * Sets the new type of this skeleton.
017         *
018         * @param type New type
019         */
020        public void setSkeletonType(SkeletonType type);
021    
022        /*
023         * Represents the various different Skeleton types.
024         */
025        public enum SkeletonType {
026            NORMAL(0),
027            WITHER(1);
028    
029            private static final SkeletonType[] types = new SkeletonType[SkeletonType.values().length];
030            private final int id;
031    
032            static {
033                for (SkeletonType type : values()) {
034                    types[type.getId()] = type;
035                }
036            }
037    
038            private SkeletonType(int id) {
039                this.id = id;
040            }
041    
042            /**
043             * Gets the ID of this skeleton type.
044             *
045             * @return Skeleton type ID
046             * @deprecated Magic value
047             */
048            @Deprecated
049            public int getId() {
050                return id;
051            }
052    
053            /**
054             * Gets a skeleton type by its ID.
055             *
056             * @param id ID of the skeleton type to get.
057             * @return Resulting skeleton type, or null if not found.
058             * @deprecated Magic value
059             */
060            @Deprecated
061            public static SkeletonType getType(int id) {
062                return (id >= types.length) ? null : types[id];
063            }
064        }
065    }