One of them cleanups.

This commit is contained in:
Lizbeth Rika committed 2015-01-31 00:36:06 +00:00
1 parent c8dbfdf90d
commit ff7b82ca07
118 files changed
+555 -605

No files matched your search

@@ -19,7 +19,7 @@ import net.minecraft.item.ItemStack;
public interface IAncientWillContainer {
public void addAncientWill(ItemStack stack, int will);
public boolean hasAncientWill(ItemStack stack, int will);
}
@@ -26,5 +26,5 @@ public interface IManaDiscountArmor {
* You can also return negative values to make tools cost more.
*/
public float getDiscount(ItemStack stack, int slot, EntityPlayer player);
}
@@ -197,7 +197,7 @@ public final class ManaItemHandler {
return false;
}
/**
* Requests mana from items in a given player's inventory. This version also
* checks for IManaDiscountArmor items equipped to lower the cost.
@@ -208,8 +208,8 @@ public final class ManaItemHandler {
*/
public static int requestManaForTool(ItemStack stack, EntityPlayer player, int manaToGet, boolean remove) {
float multiplier = Math.max(0F, 1F - getFullDiscountForTools(player));
int cost = (int) ((float) manaToGet * multiplier);
return (int) ((float) requestMana(stack, player, cost, remove) / multiplier);
int cost = (int) (manaToGet * multiplier);
return (int) (requestMana(stack, player, cost, remove) / multiplier);
}
/**
@@ -222,13 +222,13 @@ public final class ManaItemHandler {
*/
public static boolean requestManaExactForTool(ItemStack stack, EntityPlayer player, int manaToGet, boolean remove) {
float multiplier = Math.max(0F, 1F - getFullDiscountForTools(player));
int cost = (int) ((float) manaToGet * multiplier);
int cost = (int) (manaToGet * multiplier);
return requestManaExact(stack, player, cost, remove);
}
/**
* Gets the sum of all the discounts on IManaDiscountArmor items equipped
* on the player passed in.
* on the player passed in.
*/
public static float getFullDiscountForTools(EntityPlayer player) {
float discount = 0F;
@@ -237,7 +237,7 @@ public final class ManaItemHandler {
if(armor != null && armor.getItem() instanceof IManaDiscountArmor)
discount += ((IManaDiscountArmor) armor.getItem()).getDiscount(armor, i, player);
}
return discount;
}
}