mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-19 03:39:17 +00:00
Make sure the multiplier isn't ever negative.
This commit is contained in:
1 parent
07836b1f3e
commit
6d1f5ed626
1 file changed
+2
-2
@@ -207,7 +207,7 @@ public final class ManaItemHandler {
|
||||
* @return The amount of mana received from the request.
|
||||
*/
|
||||
public static int requestManaForTool(ItemStack stack, EntityPlayer player, int manaToGet, boolean remove) {
|
||||
float multiplier = 1F - getFullDiscountForTools(player);
|
||||
float multiplier = Math.max(0F, 1F - getFullDiscountForTools(player));
|
||||
int cost = (int) ((float) manaToGet * multiplier);
|
||||
return (int) ((float) requestMana(stack, player, cost, remove) / multiplier);
|
||||
}
|
||||
@@ -221,7 +221,7 @@ public final class ManaItemHandler {
|
||||
* @return If the request was succesful.
|
||||
*/
|
||||
public static boolean requestManaExactForTool(ItemStack stack, EntityPlayer player, int manaToGet, boolean remove) {
|
||||
float multiplier = 1F - getFullDiscountForTools(player);
|
||||
float multiplier = Math.max(0F, 1F - getFullDiscountForTools(player));
|
||||
int cost = (int) ((float) manaToGet * multiplier);
|
||||
return requestManaExact(stack, player, cost, remove);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user