diff options
author | md_5 <git@md-5.net> | 2016-03-02 17:02:52 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2016-03-02 17:03:11 +1100 |
commit | 3019b6a70c0c70d6286eb1bc6fd21aaf3205ad48 (patch) | |
tree | 27f689b8d20aea1c5feb409f1cc71d77e8b8ffed /src | |
parent | ad385cd3f6e3ab9911cfb51683ea9c4dc9cff523 (diff) | |
download | bukkit-3019b6a70c0c70d6286eb1bc6fd21aaf3205ad48.tar bukkit-3019b6a70c0c70d6286eb1bc6fd21aaf3205ad48.tar.gz bukkit-3019b6a70c0c70d6286eb1bc6fd21aaf3205ad48.tar.lz bukkit-3019b6a70c0c70d6286eb1bc6fd21aaf3205ad48.tar.xz bukkit-3019b6a70c0c70d6286eb1bc6fd21aaf3205ad48.zip |
SPIGOT-1622: Add drop chance methods for off hand.
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/bukkit/inventory/EntityEquipment.java | 67 |
1 files changed, 57 insertions, 10 deletions
diff --git a/src/main/java/org/bukkit/inventory/EntityEquipment.java b/src/main/java/org/bukkit/inventory/EntityEquipment.java index 6b0c53a0..fc1c98b3 100644 --- a/src/main/java/org/bukkit/inventory/EntityEquipment.java +++ b/src/main/java/org/bukkit/inventory/EntityEquipment.java @@ -137,9 +137,29 @@ public interface EntityEquipment { void clear(); /** - * Gets the chance of the currently held item being dropped upon this - * creature's death. - * + * @deprecated entities can duel wield now use the methods for the specific + * 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> * <li>A drop chance of 0F will never 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) */ - float getItemInHandDropChance(); + float getItemInMainHandDropChance(); /** - * Sets the chance of the item this creature is currently holding being - * dropped upon this creature's death. - * + * Sets the chance of the item this creature is currently holding in their + * main hand 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 the currently held item being dropped + * @param chance the chance of the main hand item being dropped * @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. - * + * * <ul> * <li>A drop chance of 0F will never drop * <li>A drop chance of 1F will always drop |