mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-09 16:42:03 -07:00
Add api for shear equippable logic
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user