Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
Skeleton.java
1 package org.bukkit.entity;
2 
3 /**
4  * Represents a Skeleton.
5  */
6 public interface Skeleton extends Monster {
7 
8  /**
9  * Gets the current type of this skeleton.
10  *
11  * @return Current type
12  */
14 
15  /**
16  * Sets the new type of this skeleton.
17  *
18  * @param type New type
19  */
20  public void setSkeletonType(SkeletonType type);
21 
22  /*
23  * Represents the various different Skeleton types.
24  */
25  public enum SkeletonType {
26  NORMAL(0),
27  WITHER(1);
28 
29  private static final SkeletonType[] types = new SkeletonType[SkeletonType.values().length];
30  private final int id;
31 
32  static {
33  for (SkeletonType type : values()) {
34  types[type.getId()] = type;
35  }
36  }
37 
38  private SkeletonType(int id) {
39  this.id = id;
40  }
41 
42  /**
43  * Gets the ID of this skeleton type.
44  *
45  * @return Skeleton type ID
46  * @deprecated Magic value
47  */
48  @Deprecated
49  public int getId() {
50  return id;
51  }
52 
53  /**
54  * Gets a skeleton type by its ID.
55  *
56  * @param id ID of the skeleton type to get.
57  * @return Resulting skeleton type, or null if not found.
58  * @deprecated Magic value
59  */
60  @Deprecated
61  public static SkeletonType getType(int id) {
62  return (id >= types.length) ? null : types[id];
63  }
64  }
65 }
static SkeletonType getType(int id)
Definition: Skeleton.java:61
void setSkeletonType(SkeletonType type)
SkeletonType getSkeletonType()