blob: 0005970a7f49dbc68c9b145898e630b716231de8 (
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
65
66
67
68
|
package org.bukkit.entity;
/**
* A wild tameable cat
*/
public interface Ocelot extends Animals, Tameable, Sittable {
/**
* Gets the current type of this cat.
*
* @return Type of the cat.
*/
public Type getCatType();
/**
* Sets the current type of this cat.
*
* @param type New type of this cat.
*/
public void setCatType(Type type);
/**
* Represents the various different cat types there are.
*/
public enum Type {
WILD_OCELOT(0),
BLACK_CAT(1),
RED_CAT(2),
SIAMESE_CAT(3);
private static final Type[] types = new Type[Type.values().length];
private final int id;
static {
for (Type type : values()) {
types[type.getId()] = type;
}
}
private Type(int id) {
this.id = id;
}
/**
* Gets the ID of this cat type.
*
* @return Type ID.
* @deprecated Magic value
*/
@Deprecated
public int getId() {
return id;
}
/**
* Gets a cat type by its ID.
*
* @param id ID of the cat type to get.
* @return Resulting type, or null if not found.
* @deprecated Magic value
*/
@Deprecated
public static Type getType(int id) {
return (id >= types.length) ? null : types[id];
}
}
}
|