mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +01:00
add get-set drop chance to EntityEquipment
This commit is contained in:
parent
6293f3ad54
commit
411f1ddea7
1 changed files with 30 additions and 0 deletions
|
@ -527,4 +527,34 @@ public interface EntityEquipment {
|
||||||
*/
|
*/
|
||||||
@NotNull // Paper
|
@NotNull // Paper
|
||||||
Entity getHolder();
|
Entity getHolder();
|
||||||
|
// Paper start
|
||||||
|
/**
|
||||||
|
* Gets the drop chance of specified slot.
|
||||||
|
*
|
||||||
|
* <ul>
|
||||||
|
* <li>A drop chance of 0.0F will never drop
|
||||||
|
* <li>A drop chance of 1.0F will always drop if killed by a player
|
||||||
|
* <li>A drop chance of greater than 1.0F will always drop if killed by anything
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* @param slot the slot to get the drop chance of
|
||||||
|
* @return the drop chance for the slot
|
||||||
|
*/
|
||||||
|
float getDropChance(@NotNull EquipmentSlot slot);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the drop chance of the specified slot.
|
||||||
|
*
|
||||||
|
* <ul>
|
||||||
|
* <li>A drop chance of 0.0F will never drop
|
||||||
|
* <li>A drop chance of 1.0F will always drop if killed by a player
|
||||||
|
* <li>A drop chance of greater than 1.0F will always drop if killed by anything
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* @param slot the slot to set the drop chance of
|
||||||
|
* @param chance the drop chance for the slot
|
||||||
|
* @throws UnsupportedOperationException when called on non-{@link Mob} entities
|
||||||
|
*/
|
||||||
|
void setDropChance(@NotNull EquipmentSlot slot, float chance);
|
||||||
|
// Paper end
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue