summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/bukkit/entity/Skeleton.java
blob: 0019911b862a2538cd15280dad7a11c7fafc739d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package org.bukkit.entity;

/**
 * Represents a Skeleton.
 */
public interface Skeleton extends Monster {
    /**
     * Gets the current type of this skeleton.
     *
     * @return Current type
     */
    public SkeletonType getSkeletonType();

    /**
     * Sets the new type of this skeleton.
     *
     * @param type New type
     */
    public void setSkeletonType(SkeletonType type);

    /*
     * Represents the various different Skeleton types.
     */
    public enum SkeletonType {
        NORMAL(0),
        WITHER(1);

        private static final SkeletonType[] types = new SkeletonType[SkeletonType.values().length];
        private final int id;

        static {
            for (SkeletonType type : values()) {
                types[type.getId()] = type;
            }
        }

        private SkeletonType(int id) {
            this.id = id;
        }

        /**
         * Gets the ID of this skeleton type.
         *
         * @return Skeleton type ID
         * @deprecated Magic value
         */
        @Deprecated
        public int getId() {
            return id;
        }

        /**
         * Gets a skeleton type by its ID.
         *
         * @param id ID of the skeleton type to get.
         * @return Resulting skeleton type, or null if not found.
         * @deprecated Magic value
         */
        @Deprecated
        public static SkeletonType getType(int id) {
            return (id >= types.length) ? null : types[id];
        }
    }
}