Add api for shear equippable logic

This commit is contained in:
Owen1212055
2025-06-06 23:36:48 -04:00
parent 1e44102532
commit adb5aefcbf
2 changed files with 63 additions and 3 deletions

View File

@@ -104,6 +104,22 @@ public interface Equippable extends BuildableDataComponent<Equippable, Equippabl
@Contract(pure = true)
boolean equipOnInteract();
/**
* Checks if the item can be sheared off an entity.
*
* @return true if can be sheared of an entity, false otherwise
*/
@Contract(pure = true)
boolean canBeSheared();
/**
* Returns the sound that is played when shearing this equipment off an entity.
*
* @return shear sound
*/
@Contract(pure = true)
Key shearSound();
/**
* Builder for {@link Equippable}.
*/
@@ -182,5 +198,23 @@ public interface Equippable extends BuildableDataComponent<Equippable, Equippabl
*/
@Contract(value = "_ -> this", mutates = "this")
Builder equipOnInteract(boolean equipOnInteract);
/**
* Sets whether the item can be sheared off an entity.
*
* @param canBeSheared true if can be sheared off an entity
* @return the builder for chaining
*/
@Contract(value = "_ -> this", mutates = "this")
Builder canBeSheared(boolean canBeSheared);
/**
* Sets the sound that is played when shearing this equipment off an entity.
*
* @param shearSound the shear sound key
* @return the builder for chaining
*/
@Contract(value = "_ -> this", mutates = "this")
Builder shearSound(Key shearSound);
}
}