API 7 fix for BreedEntity, API 8 changes all of this.
Add ReadyToMate
Correct some documentation
import org.spongepowered.api.entity.Entity;
import org.spongepowered.api.entity.living.Ageable;
+import org.spongepowered.api.entity.living.animal.Animal;
import org.spongepowered.api.event.TristateResult;
+// TODO Rename this to BreedingEvent in API 8 and remove InteractEntity
+@Deprecated
+public interface BreedEntityEvent extends InteractEntityEvent {
+
/**
- * Represents an event when two {@link Ageable} entities come together
- * to attempt to produce offspring.
+ * Called when an {@link Animal} has made it known it is ready to breed.
*/
-public interface BreedEntityEvent extends InteractEntityEvent {
+ interface ReadyToMate extends BreedEntityEvent {
+
+ @Override
+ Animal getTargetEntity();
+ }
/**
- * Called when an {@link Entity} finds an {@link Entity} to mate with.
+ * Called when an {@link Animal} finds an {@link Animal} to mate with.
+ */
+ interface FindMate extends BreedEntityEvent, TristateResult {
+
+ /**
+ * Returns the {@link Animal} this entity will mate with.
*
- * <p>If {@link org.spongepowered.api.event.TristateResult.Result#ALLOW},
- * bypasses normal handling to force mate with {@link Entity}.</p>
+ * @return the mate
*/
- interface FindMate extends BreedEntityEvent, TristateResult {}
+ Animal getMatingEntity();
+ }
/**
- * Called when an {@link Entity} begins to breed with an {@link Entity}.
+ * Called when an {@link Animal} begins to breed with an {@link Animal}.
*/
interface Breed extends BreedEntityEvent {
/**
* Gets the offspring {@link Entity}.
*
- * @return the offspring entity
+ * @return the offspring
*/
Ageable getOffspringEntity();
}
-
}
