Created fillWill method for the tartaric gem.
This commit is contained in:
parent
b818939a9c
commit
a88d7f43b8
5 changed files with 29 additions and 20 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue