001
002 package org.bukkit.entity;
003
004 /**
005 * A wild tameable cat
006 */
007 public interface Ocelot extends Animals, Tameable {
008
009 /**
010 * Gets the current type of this cat.
011 *
012 * @return Type of the cat.
013 */
014 public Type getCatType();
015
016 /**
017 * Sets the current type of this cat.
018 *
019 * @param type New type of this cat.
020 */
021 public void setCatType(Type type);
022
023 /**
024 * Checks if this ocelot is sitting
025 *
026 * @return true if sitting
027 */
028 public boolean isSitting();
029
030 /**
031 * Sets if this ocelot is sitting. Will remove any path that the ocelot
032 * was following beforehand.
033 *
034 * @param sitting true if sitting
035 */
036 public void setSitting(boolean sitting);
037
038 /**
039 * Represents the various different cat types there are.
040 */
041 public enum Type {
042 WILD_OCELOT(0),
043 BLACK_CAT(1),
044 RED_CAT(2),
045 SIAMESE_CAT(3);
046
047 private static final Type[] types = new Type[Type.values().length];
048 private final int id;
049
050 static {
051 for (Type type : values()) {
052 types[type.getId()] = type;
053 }
054 }
055
056 private Type(int id) {
057 this.id = id;
058 }
059
060 /**
061 * Gets the ID of this cat type.
062 *
063 * @return Type ID.
064 * @deprecated Magic value
065 */
066 @Deprecated
067 public int getId() {
068 return id;
069 }
070
071 /**
072 * Gets a cat type by its ID.
073 *
074 * @param id ID of the cat type to get.
075 * @return Resulting type, or null if not found.
076 * @deprecated Magic value
077 */
078 @Deprecated
079 public static Type getType(int id) {
080 return (id >= types.length) ? null : types[id];
081 }
082 }
083 }