summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authoraPunch <theapunch@yahoo.com>2012-03-19 14:02:10 -0500
committerEvilSeph <evilseph@gmail.com>2012-03-21 15:43:19 -0400
commit3bd599f8ab8752d70232e4113a982aafd3f8324f (patch)
tree6e18a42e05515c81d1e09519ca52a71ca05a560b /src/main/java
parent066ccf6062f47c04ed751df29160aa240612a511 (diff)
downloadbukkit-3bd599f8ab8752d70232e4113a982aafd3f8324f.tar
bukkit-3bd599f8ab8752d70232e4113a982aafd3f8324f.tar.gz
bukkit-3bd599f8ab8752d70232e4113a982aafd3f8324f.tar.lz
bukkit-3bd599f8ab8752d70232e4113a982aafd3f8324f.tar.xz
bukkit-3bd599f8ab8752d70232e4113a982aafd3f8324f.zip
[Bleeding] Added Ageable interface for Villagers and Animals to extend. Addresses BUKKIT-1232
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/bukkit/entity/Ageable.java65
-rw-r--r--src/main/java/org/bukkit/entity/Animals.java61
-rw-r--r--src/main/java/org/bukkit/entity/Villager.java2
3 files changed, 67 insertions, 61 deletions
diff --git a/src/main/java/org/bukkit/entity/Ageable.java b/src/main/java/org/bukkit/entity/Ageable.java
new file mode 100644
index 00000000..0e7472a1
--- /dev/null
+++ b/src/main/java/org/bukkit/entity/Ageable.java
@@ -0,0 +1,65 @@
+package org.bukkit.entity;
+
+/**
+ * Represents an entity that can age and breed.
+ */
+public interface Ageable extends Creature {
+ /**
+ * Gets the age of this animal.
+ *
+ * @return Age
+ */
+ public int getAge();
+
+ /**
+ * Sets the age of this animal.
+ *
+ * @param age New age
+ */
+ public void setAge(int age);
+
+ /**
+ * Lock the age of the animal, setting this will prevent the animal from maturing or getting ready for mating.
+ *
+ * @param lock new lock
+ */
+ public void setAgeLock(boolean lock);
+
+ /**
+ * Gets the current agelock.
+ *
+ * @return the current agelock
+ */
+ public boolean getAgeLock();
+
+ /**
+ * Sets the age of the animal to a baby
+ */
+ public void setBaby();
+
+ /**
+ * Sets the age of the animal to an adult
+ */
+ public void setAdult();
+
+ /**
+ * Returns true if the animal is an adult.
+ *
+ * @return return true if the animal is an adult
+ */
+ public boolean isAdult();
+
+ /**
+ * Return the ability to breed of the animal.
+ *
+ * @return the ability to breed of the animal
+ */
+ public boolean canBreed();
+
+ /**
+ * Set breedability of the animal, if the animal is a baby and set to breed it will instantly grow up.
+ *
+ * @param breed breedability of the animal
+ */
+ public void setBreed(boolean breed);
+}
diff --git a/src/main/java/org/bukkit/entity/Animals.java b/src/main/java/org/bukkit/entity/Animals.java
index a2e71029..f0dc157d 100644
--- a/src/main/java/org/bukkit/entity/Animals.java
+++ b/src/main/java/org/bukkit/entity/Animals.java
@@ -3,63 +3,4 @@ package org.bukkit.entity;
/**
* Represents an Animal.
*/
-public interface Animals extends Creature {
- /**
- * Gets the age of this animal.
- *
- * @return Age
- */
- public int getAge();
-
- /**
- * Sets the age of this animal.
- *
- * @param age New age
- */
- public void setAge(int age);
-
- /**
- * Lock the age of the animal, setting this will prevent the animal from maturing or getting ready for mating.
- *
- * @param lock new lock
- */
- public void setAgeLock(boolean lock);
-
- /**
- * Gets the current agelock.
- *
- * @return the current agelock
- */
- public boolean getAgeLock();
-
- /**
- * Sets the age of the animal to a baby
- */
- public void setBaby();
-
- /**
- * Sets the age of the animal to an adult
- */
- public void setAdult();
-
- /**
- * Returns true if the animal is an adult.
- *
- * @return return true if the animal is an adult
- */
- public boolean isAdult();
-
- /**
- * Return the ability to breed of the animal.
- *
- * @return the ability to breed of the animal
- */
- public boolean canBreed();
-
- /**
- * Set breedability of the animal, if the animal is a baby and set to breed it will instantly grow up.
- *
- * @param breed breedability of the animal
- */
- public void setBreed(boolean breed);
-}
+public interface Animals extends Ageable {}
diff --git a/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/bukkit/entity/Villager.java
index d07265ef..f6f90cc1 100644
--- a/src/main/java/org/bukkit/entity/Villager.java
+++ b/src/main/java/org/bukkit/entity/Villager.java
@@ -3,7 +3,7 @@ package org.bukkit.entity;
/**
* Represents a villager NPC
*/
-public interface Villager extends NPC {
+public interface Villager extends Ageable, NPC {
/**
* Gets the current profession of this villager.
*