diff --git a/paper-api/src/main/java/org/bukkit/block/Beehive.java b/paper-api/src/main/java/org/bukkit/block/Beehive.java index c1c47c246f..655fd0b598 100644 --- a/paper-api/src/main/java/org/bukkit/block/Beehive.java +++ b/paper-api/src/main/java/org/bukkit/block/Beehive.java @@ -1,12 +1,13 @@ package org.bukkit.block; import org.bukkit.Location; +import org.bukkit.entity.Bee; import org.jetbrains.annotations.Nullable; /** * Represents a captured state of a bee hive. */ -public interface Beehive extends TileState { +public interface Beehive extends EntityBlockStorage { /** * Get the hive's flower location. @@ -22,4 +23,11 @@ public interface Beehive extends TileState { * @param location or null */ void setFlower(@Nullable Location location); + + /** + * Check if the hive is sedated due to smoke from a nearby campfire. + * + * @return True if hive is sedated + */ + boolean isSedated(); } diff --git a/paper-api/src/main/java/org/bukkit/block/EntityBlockStorage.java b/paper-api/src/main/java/org/bukkit/block/EntityBlockStorage.java new file mode 100644 index 0000000000..f3f8d765d5 --- /dev/null +++ b/paper-api/src/main/java/org/bukkit/block/EntityBlockStorage.java @@ -0,0 +1,56 @@ +package org.bukkit.block; + +import java.util.List; +import org.bukkit.entity.Entity; +import org.jetbrains.annotations.NotNull; + +/** + * Represents a captured state of a block which stores entities. + * + * @param Entity this block can store + */ +public interface EntityBlockStorage extends TileState { + + /** + * Check if the block is completely full of entities. + * + * @return True if block is full + */ + boolean isFull(); + + /** + * Get the amount of entities currently in this block. + * + * @return Amount of entities currently in this block + */ + int getEntityCount(); + + /** + * Get the maximum amount of entities this block can hold. + * + * @return Maximum amount of entities this block can hold + */ + int getMaxEntities(); + + /** + * Set the maximum amount of entities this block can hold. + * + * @param max Maximum amount of entities this block can hold + */ + void setMaxEntities(int max); + + /** + * Release all the entities currently stored in the block. + * + * @return List of all entities which were released + */ + @NotNull + List releaseEntities(); + + /** + * Add an entity to the block. + * + * @param entity Entity to add to the block + */ + void addEntity(@NotNull T entity); +} diff --git a/paper-api/src/main/java/org/bukkit/entity/Bee.java b/paper-api/src/main/java/org/bukkit/entity/Bee.java index 41b23d87a1..adb20a9abb 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Bee.java +++ b/paper-api/src/main/java/org/bukkit/entity/Bee.java @@ -79,4 +79,18 @@ public interface Bee extends Animals { * @param anger new anger */ void setAnger(int anger); + + /** + * Get the amount of ticks the bee cannot enter the hive for. + * + * @return Ticks the bee cannot enter a hive for + */ + int getCannotEnterHiveTicks(); + + /** + * Set the amount of ticks the bee cannot enter a hive for. + * + * @param ticks Ticks the bee cannot enter a hive for + */ + void setCannotEnterHiveTicks(int ticks); }