Commits

md_5 authored 3019b6a70c0
SPIGOT-1622: Add drop chance methods for off hand.
No tags

src/main/java/org/bukkit/inventory/EntityEquipment.java

Modified
130 130 * @param items The items to set the armor as
131 131 */
132 132 void setArmorContents(ItemStack[] items);
133 133
134 134 /**
135 135 * Clears the entity of all armor and held items
136 136 */
137 137 void clear();
138 138
139 139 /**
140 - * Gets the chance of the currently held item being dropped upon this
141 - * creature's death.
142 - *
140 + * @deprecated entities can duel wield now use the methods for the specific
141 + * hand instead
142 + * @see #getItemInMainHandDropChance(ItemStack)
143 + * @see #getItemInOffHandDropChance(ItemStack)
144 + * @return drop chance
145 + */
146 + @Deprecated
147 + float getItemInHandDropChance();
148 +
149 + /**
150 + * @deprecated entities can duel wield now use the methods for the specific
151 + * hand instead
152 + * @see #setItemInMainHandDropChance(ItemStack)
153 + * @see #setItemInOffHandDropChance(ItemStack)
154 + * @param chance drop chance
155 + */
156 + @Deprecated
157 + void setItemInHandDropChance(float chance);
158 +
159 + /**
160 + * Gets the chance of the main hand item being dropped upon this creature's
161 + * death.
162 + *
143 163 * <ul>
144 164 * <li>A drop chance of 0F will never drop
145 165 * <li>A drop chance of 1F will always drop
146 166 * </ul>
147 167 *
148 168 * @return chance of the currently held item being dropped (1 for players)
149 169 */
150 - float getItemInHandDropChance();
170 + float getItemInMainHandDropChance();
151 171
152 172 /**
153 - * Sets the chance of the item this creature is currently holding being
154 - * dropped upon this creature's death.
155 - *
173 + * Sets the chance of the item this creature is currently holding in their
174 + * main hand being dropped upon this creature's death.
175 + *
156 176 * <ul>
157 177 * <li>A drop chance of 0F will never drop
158 178 * <li>A drop chance of 1F will always drop
159 179 * </ul>
160 180 *
161 - * @param chance the chance of the currently held item being dropped
181 + * @param chance the chance of the main hand item being dropped
162 182 * @throws UnsupportedOperationException when called on players
163 183 */
164 - void setItemInHandDropChance(float chance);
184 + void setItemInMainHandDropChance(float chance);
185 +
186 + /**
187 + * Gets the chance of the off hand item being dropped upon this creature's
188 + * death.
189 + *
190 + * <ul>
191 + * <li>A drop chance of 0F will never drop
192 + * <li>A drop chance of 1F will always drop
193 + * </ul>
194 + *
195 + * @return chance of the off hand item being dropped (1 for players)
196 + */
197 + float getItemInOffHandDropChance();
198 +
199 + /**
200 + * Sets the chance of the off hand item being dropped upon this creature's
201 + * death.
202 + *
203 + * <ul>
204 + * <li>A drop chance of 0F will never drop
205 + * <li>A drop chance of 1F will always drop
206 + * </ul>
207 + *
208 + * @param chance the chance of off hand item being dropped
209 + * @throws UnsupportedOperationException when called on players
210 + */
211 + void setItemInOffHandDropChance(float chance);
165 212
166 213 /**
167 214 * Gets the chance of the helmet being dropped upon this creature's death.
168 - *
215 + *
169 216 * <ul>
170 217 * <li>A drop chance of 0F will never drop
171 218 * <li>A drop chance of 1F will always drop
172 219 * </ul>
173 220 *
174 221 * @return the chance of the helmet being dropped (1 for players)
175 222 */
176 223 float getHelmetDropChance();
177 224
178 225 /**

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut