SPIGOT-5380, SPIGOT-6958, #772: Add some missing entity API

By: Ollie <69084614+olijeffers0n@users.noreply.github.com>
This commit is contained in:
Bukkit/Spigot 2022-07-21 21:01:23 +10:00
parent 8c38fbb68a
commit ecc4ce98ab
8 changed files with 169 additions and 3 deletions

View file

@ -78,6 +78,13 @@ public interface Fox extends Animals, Sittable {
*/
public void setSecondTrustedPlayer(@Nullable AnimalTamer player);
/**
* Gets whether the fox is faceplanting the ground
*
* @return Whether the fox is faceplanting the ground
*/
boolean isFaceplanted();
/**
* Represents the various different fox types there are.
*/

View file

@ -3,4 +3,19 @@ package org.bukkit.entity;
/**
* Represents a Ghast.
*/
public interface Ghast extends Flying {}
public interface Ghast extends Flying {
/**
* Gets whether the Ghast is charging
*
* @return Whether the Ghast is charging
*/
boolean isCharging();
/**
* Sets whether the Ghast is charging
*
* @param flag Whether the Ghast is charging
*/
void setCharging(boolean flag);
}

View file

@ -5,7 +5,7 @@ import org.jetbrains.annotations.NotNull;
/**
* Panda entity.
*/
public interface Panda extends Animals {
public interface Panda extends Animals, Sittable {
/**
* Gets this Panda's main gene.
@ -37,6 +37,76 @@ public interface Panda extends Animals {
*/
void setHiddenGene(@NotNull Gene gene);
/**
* Gets whether the Panda is rolling
*
* @return Whether the Panda is rolling
*/
boolean isRolling();
/**
* Sets whether the Panda is rolling
*
* @param flag Whether the Panda is rolling
*/
void setRolling(boolean flag);
/**
* Gets whether the Panda is sneezing
*
* @return Whether the Panda is sneezing
*/
boolean isSneezing();
/**
* Sets whether the Panda is sneezing
*
* @param flag Whether the Panda is sneezing
*/
void setSneezing(boolean flag);
/**
* Gets whether the Panda is on its back
*
* @return Whether the Panda is on its back
*/
boolean isOnBack();
/**
* Sets whether the Panda is on its back
*
* @param flag Whether the Panda is on its back
*/
void setOnBack(boolean flag);
/**
* Gets whether the Panda is eating
*
* @return Whether the Panda is eating
*/
boolean isEating();
/**
* Sets the Panda's eating status. The panda must be holding food for this to work
*
* @param flag Whether the Panda is eating
*/
void setEating(boolean flag);
/**
* Gets whether the Panda is scared
*
* @return Whether the Panda is scared
*/
boolean isScared();
/**
* Gets how many ticks the panda will be unhappy for
*
* @return The number of ticks the panda will be unhappy for
*/
int getUnhappyTicks();
public enum Gene {
NORMAL(false),

View file

@ -22,6 +22,13 @@ public interface Parrot extends Tameable, Sittable {
*/
public void setVariant(@NotNull Variant variant);
/**
* Gets whether a parrot is dancing
*
* @return Whether the parrot is dancing
*/
public boolean isDancing();
/**
* Represents the variant of a parrot - ie its color.
*/

View file

@ -3,4 +3,19 @@ package org.bukkit.entity;
/**
* Represents a turtle.
*/
public interface Turtle extends Animals { }
public interface Turtle extends Animals {
/**
* Gets whether the turtle has an egg
*
* @return Whether the turtle has an egg
*/
boolean hasEgg();
/**
* Gets whether the turtle is laying an egg
*
* @return Whether the turtle is laying an egg
*/
boolean isLayingEgg();
}

View file

@ -4,4 +4,11 @@ package org.bukkit.entity;
* Represents a Witch
*/
public interface Witch extends Raider {
/**
* Gets whether the witch is drinking a potion
*
* @return whether the witch is drinking a potion
*/
boolean isDrinkingPotion();
}

View file

@ -39,4 +39,32 @@ public interface Wolf extends Tameable, Sittable {
* @param color the color to apply
*/
public void setCollarColor(@NotNull DyeColor color);
/**
* Gets whether the wolf is wet
*
* @return Whether the wolf is wet
*/
public boolean isWet();
/**
* Gets the wolf's tail angle in radians
*
* @return The angle of the wolf's tail in radians
*/
public float getTailAngle();
/**
* Gets if the wolf is interested
*
* @return Whether the wolf is interested
*/
public boolean isInterested();
/**
* Set wolf to be interested
*
* @param interested Whether the wolf is interested
*/
public void setInterested(boolean interested);
}

View file

@ -90,4 +90,21 @@ public interface Zombie extends Monster, Ageable {
* @param time new conversion time
*/
void setConversionTime(int time);
/**
* Gets whether this zombie can break doors
*
* @return Whether this zombie can break doors
*/
boolean canBreakDoors();
/**
* Sets whether this zombie can break doors
*
* This will be ignored if the entity is a Drowned. Will also stop the action if
* the entity is currently breaking a door.
*
* @param flag Whether this zombie can break doors
*/
void setCanBreakDoors(boolean flag);
}