Created fillWill method for the tartaric gem.

This commit is contained in:
WayofTime 2016-02-19 08:03:33 -05:00
parent b818939a9c
commit a88d7f43b8
5 changed files with 29 additions and 20 deletions

View file

@ -81,10 +81,10 @@ public class TileDemonCrucible extends TileInventory implements ITickable, IDemo
if (willMap.containsKey(type))
{
double current = willMap.get(type);
double fillAmount = Math.min(gemDrainRate, Math.min(current, gemItem.getMaxWill(type, stack) - gemItem.getWill(type, stack)));
double fillAmount = Math.min(gemDrainRate, current);
if (fillAmount > 0)
{
gemItem.setWill(type, stack, fillAmount + gemItem.getWill(type, stack));
fillAmount = gemItem.fillWill(type, stack, fillAmount);
if (willMap.get(type) - fillAmount <= 0)
{
willMap.remove(type);

View file

@ -266,16 +266,7 @@ public class TileSoulForge extends TileInventory implements ITickable, IDemonWil
return Math.min(maxWill - current, amount);
}
double filled = maxWill - current;
if (amount < filled)
{
willGem.setWill(type, stack, current + amount);
filled = amount;
} else
{
willGem.setWill(type, stack, maxWill);
}
double filled = willGem.fillWill(type, stack, amount);
return filled;
}