SPIGOT-1622: Add drop chance methods for off hand.

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot 2016-03-02 17:02:52 +11:00
parent f6425d9b9e
commit 34646e3aeb

View File

@ -137,9 +137,29 @@ public interface EntityEquipment {
void clear(); void clear();
/** /**
* Gets the chance of the currently held item being dropped upon this * @deprecated entities can duel wield now use the methods for the specific
* creature's death. * hand instead
* * @see #getItemInMainHandDropChance(ItemStack)
* @see #getItemInOffHandDropChance(ItemStack)
* @return drop chance
*/
@Deprecated
float getItemInHandDropChance();
/**
* @deprecated entities can duel wield now use the methods for the specific
* hand instead
* @see #setItemInMainHandDropChance(ItemStack)
* @see #setItemInOffHandDropChance(ItemStack)
* @param chance drop chance
*/
@Deprecated
void setItemInHandDropChance(float chance);
/**
* Gets the chance of the main hand item being dropped upon this creature's
* death.
*
* <ul> * <ul>
* <li>A drop chance of 0F will never drop * <li>A drop chance of 0F will never drop
* <li>A drop chance of 1F will always drop * <li>A drop chance of 1F will always drop
@ -147,25 +167,52 @@ public interface EntityEquipment {
* *
* @return chance of the currently held item being dropped (1 for players) * @return chance of the currently held item being dropped (1 for players)
*/ */
float getItemInHandDropChance(); float getItemInMainHandDropChance();
/** /**
* Sets the chance of the item this creature is currently holding being * Sets the chance of the item this creature is currently holding in their
* dropped upon this creature's death. * main hand being dropped upon this creature's death.
* *
* <ul> * <ul>
* <li>A drop chance of 0F will never drop * <li>A drop chance of 0F will never drop
* <li>A drop chance of 1F will always drop * <li>A drop chance of 1F will always drop
* </ul> * </ul>
* *
* @param chance the chance of the currently held item being dropped * @param chance the chance of the main hand item being dropped
* @throws UnsupportedOperationException when called on players * @throws UnsupportedOperationException when called on players
*/ */
void setItemInHandDropChance(float chance); void setItemInMainHandDropChance(float chance);
/**
* Gets the chance of the off hand item being dropped upon this creature's
* death.
*
* <ul>
* <li>A drop chance of 0F will never drop
* <li>A drop chance of 1F will always drop
* </ul>
*
* @return chance of the off hand item being dropped (1 for players)
*/
float getItemInOffHandDropChance();
/**
* Sets the chance of the off hand item being dropped upon this creature's
* death.
*
* <ul>
* <li>A drop chance of 0F will never drop
* <li>A drop chance of 1F will always drop
* </ul>
*
* @param chance the chance of off hand item being dropped
* @throws UnsupportedOperationException when called on players
*/
void setItemInOffHandDropChance(float chance);
/** /**
* Gets the chance of the helmet being dropped upon this creature's death. * Gets the chance of the helmet being dropped upon this creature's death.
* *
* <ul> * <ul>
* <li>A drop chance of 0F will never drop * <li>A drop chance of 0F will never drop
* <li>A drop chance of 1F will always drop * <li>A drop chance of 1F will always drop