diff --git a/paper-api/src/main/java/org/bukkit/entity/AbstractVillager.java b/paper-api/src/main/java/org/bukkit/entity/AbstractVillager.java index 8fde1f4bbf..d2b0c08554 100644 --- a/paper-api/src/main/java/org/bukkit/entity/AbstractVillager.java +++ b/paper-api/src/main/java/org/bukkit/entity/AbstractVillager.java @@ -8,7 +8,7 @@ import org.jetbrains.annotations.NotNull; /** * Represents a villager NPC */ -public interface AbstractVillager extends Ageable, NPC, InventoryHolder, Merchant { +public interface AbstractVillager extends Breedable, NPC, InventoryHolder, Merchant { /** * Gets this villager's inventory. diff --git a/paper-api/src/main/java/org/bukkit/entity/Ageable.java b/paper-api/src/main/java/org/bukkit/entity/Ageable.java index 3756a97301..82b80a96bd 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Ageable.java +++ b/paper-api/src/main/java/org/bukkit/entity/Ageable.java @@ -1,18 +1,18 @@ package org.bukkit.entity; /** - * Represents an entity that can age and breed. + * Represents an entity that can age. */ public interface Ageable extends Creature { /** - * Gets the age of this animal. + * Gets the age of this mob. * * @return Age */ public int getAge(); /** - * Sets the age of this animal. + * Sets the age of this mob. * * @param age New age */ @@ -23,30 +23,34 @@ public interface Ageable extends Creature { * maturing or getting ready for mating. * * @param lock new lock + * @deprecated see {@link Breedable#setAgeLock(boolean)} */ + @Deprecated public void setAgeLock(boolean lock); /** * Gets the current agelock. * * @return the current agelock + * @deprecated see {@link Breedable#getAgeLock()} */ + @Deprecated public boolean getAgeLock(); /** - * Sets the age of the animal to a baby + * Sets the age of the mob to a baby */ public void setBaby(); /** - * Sets the age of the animal to an adult + * Sets the age of the mob to an adult */ public void setAdult(); /** - * Returns true if the animal is an adult. + * Returns true if the mob is an adult. * - * @return return true if the animal is an adult + * @return return true if the mob is an adult */ public boolean isAdult(); @@ -54,7 +58,9 @@ public interface Ageable extends Creature { * Return the ability to breed of the animal. * * @return the ability to breed of the animal + * @deprecated see {@link Breedable#canBreed()} */ + @Deprecated public boolean canBreed(); /** @@ -62,6 +68,8 @@ public interface Ageable extends Creature { * breed it will instantly grow up. * * @param breed breedability of the animal + * @deprecated see {@link Breedable#setBreed(boolean)} */ + @Deprecated public void setBreed(boolean breed); } diff --git a/paper-api/src/main/java/org/bukkit/entity/Animals.java b/paper-api/src/main/java/org/bukkit/entity/Animals.java index 1047481e41..9f4b36cef3 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Animals.java +++ b/paper-api/src/main/java/org/bukkit/entity/Animals.java @@ -6,7 +6,7 @@ import org.jetbrains.annotations.Nullable; /** * Represents an Animal. */ -public interface Animals extends Ageable { +public interface Animals extends Breedable { /** * Get the UUID of the entity that caused this entity to enter the diff --git a/paper-api/src/main/java/org/bukkit/entity/Breedable.java b/paper-api/src/main/java/org/bukkit/entity/Breedable.java new file mode 100644 index 0000000000..0cf8ce4978 --- /dev/null +++ b/paper-api/src/main/java/org/bukkit/entity/Breedable.java @@ -0,0 +1,38 @@ +package org.bukkit.entity; + +/** + * Represents an entity that can age and breed. + */ +public interface Breedable extends Ageable { + + /** + * 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(); + + /** + * 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/paper-api/src/main/java/org/bukkit/entity/PiglinAbstract.java b/paper-api/src/main/java/org/bukkit/entity/PiglinAbstract.java index 28631b93b0..87f4b7ad7c 100644 --- a/paper-api/src/main/java/org/bukkit/entity/PiglinAbstract.java +++ b/paper-api/src/main/java/org/bukkit/entity/PiglinAbstract.java @@ -3,7 +3,7 @@ package org.bukkit.entity; /** * Piglin / Piglin Brute. */ -public interface PiglinAbstract extends Monster { +public interface PiglinAbstract extends Monster, Ageable { /** * Gets whether the piglin is immune to zombification. @@ -53,13 +53,17 @@ public interface PiglinAbstract extends Monster { * Gets whether the piglin is a baby * * @return Whether the piglin is a baby + * @deprecated see {@link Ageable#isAdult()} */ + @Deprecated public boolean isBaby(); /** * Sets whether the piglin is a baby * * @param flag Whether the piglin is a baby + * @deprecated see {@link Ageable#setBaby()} and {@link Ageable#setAdult()} */ + @Deprecated public void setBaby(boolean flag); } diff --git a/paper-api/src/main/java/org/bukkit/entity/Zoglin.java b/paper-api/src/main/java/org/bukkit/entity/Zoglin.java index ad947d327e..ebf4ffac77 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Zoglin.java +++ b/paper-api/src/main/java/org/bukkit/entity/Zoglin.java @@ -3,19 +3,23 @@ package org.bukkit.entity; /** * Represents a Zoglin. */ -public interface Zoglin extends Monster { +public interface Zoglin extends Monster, Ageable { /** * Gets whether the zoglin is a baby * * @return Whether the zoglin is a baby + * @deprecated see {@link Ageable#isAdult()} */ + @Deprecated public boolean isBaby(); /** * Sets whether the zoglin is a baby * * @param flag Whether the zoglin is a baby + * @deprecated see {@link Ageable#setBaby()} and {@link Ageable#setAdult()} */ + @Deprecated public void setBaby(boolean flag); } diff --git a/paper-api/src/main/java/org/bukkit/entity/Zombie.java b/paper-api/src/main/java/org/bukkit/entity/Zombie.java index 6dcac97982..a5b20b0454 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Zombie.java +++ b/paper-api/src/main/java/org/bukkit/entity/Zombie.java @@ -6,20 +6,24 @@ import org.jetbrains.annotations.Nullable; /** * Represents a Zombie. */ -public interface Zombie extends Monster { +public interface Zombie extends Monster, Ageable { /** * Gets whether the zombie is a baby * * @return Whether the zombie is a baby + * @deprecated see {@link Ageable#isAdult()} */ + @Deprecated public boolean isBaby(); /** * Sets whether the zombie is a baby * * @param flag Whether the zombie is a baby + * @deprecated see {@link Ageable#setBaby()} and {@link Ageable#setAdult()} */ + @Deprecated public void setBaby(boolean flag); /**