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

@ -200,4 +200,26 @@ public class ItemSoulGem extends Item implements IDemonWillGem
tag.setString(Constants.NBT.WILL_TYPE, type.toString());
}
@Override
public double fillWill(EnumDemonWillType type, ItemStack stack, double fillAmount)
{
if (!type.equals(getCurrentType(stack)))
{
return 0;
}
double current = this.getWill(type, stack);
double maxWill = this.getMaxWill(type, stack);
double filled = Math.min(fillAmount, maxWill - current);
if (filled > 0)
{
this.setWill(type, stack, filled + current);
return filled;
}
return 0;
}
}