From 0611d599bd96fc4cbdc53540d7172a660d253882 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sat, 27 Jul 2024 10:28:32 +1000 Subject: [PATCH] SPIGOT-7850: Add API for Bogged shear state By: md_5 --- .../main/java/org/bukkit/entity/Bogged.java | 2 +- .../java/org/bukkit/entity/Shearable.java | 21 +++++++++++++++++++ .../main/java/org/bukkit/entity/Sheep.java | 12 +---------- 3 files changed, 23 insertions(+), 12 deletions(-) create mode 100644 paper-api/src/main/java/org/bukkit/entity/Shearable.java diff --git a/paper-api/src/main/java/org/bukkit/entity/Bogged.java b/paper-api/src/main/java/org/bukkit/entity/Bogged.java index a89f104aa2..8b75a505a5 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Bogged.java +++ b/paper-api/src/main/java/org/bukkit/entity/Bogged.java @@ -6,5 +6,5 @@ import org.jetbrains.annotations.ApiStatus; * Represents a Bogged Skeleton. */ @ApiStatus.Experimental -public interface Bogged extends AbstractSkeleton { +public interface Bogged extends AbstractSkeleton, Shearable { } diff --git a/paper-api/src/main/java/org/bukkit/entity/Shearable.java b/paper-api/src/main/java/org/bukkit/entity/Shearable.java new file mode 100644 index 0000000000..0215d20f81 --- /dev/null +++ b/paper-api/src/main/java/org/bukkit/entity/Shearable.java @@ -0,0 +1,21 @@ +package org.bukkit.entity; + +/** + * Represents an entity which can be shorn with shears. + */ +public interface Shearable { + + /** + * Gets whether the entity is in its sheared state. + * + * @return Whether the entity is sheared. + */ + boolean isSheared(); + + /** + * Sets whether the entity is in its sheared state. + * + * @param flag Whether to shear the entity + */ + void setSheared(boolean flag); +} diff --git a/paper-api/src/main/java/org/bukkit/entity/Sheep.java b/paper-api/src/main/java/org/bukkit/entity/Sheep.java index f4ce312ccd..46bc1a0ed9 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Sheep.java +++ b/paper-api/src/main/java/org/bukkit/entity/Sheep.java @@ -5,15 +5,5 @@ import org.bukkit.material.Colorable; /** * Represents a Sheep. */ -public interface Sheep extends Animals, Colorable { - - /** - * @return Whether the sheep is sheared. - */ - public boolean isSheared(); - - /** - * @param flag Whether to shear the sheep - */ - public void setSheared(boolean flag); +public interface Sheep extends Animals, Colorable, Shearable { }