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
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue