Made it so that Demon Will will be voided if the player's tartaric gems are all full.

This commit is contained in:
WayofTime 2016-01-29 21:19:59 -05:00
parent 219b997b24
commit eaba4e6cc2
3 changed files with 31 additions and 3 deletions

View file

@ -37,6 +37,33 @@ public class PlayerDemonWillHandler
return souls;
}
/**
* Checks if the player's Tartaric gems are completely full. If so, it will
* return true.
*
*/
public static boolean isDemonWillFull(EntityPlayer player)
{
ItemStack[] inventory = player.inventory.mainInventory;
for (int i = 0; i < inventory.length; i++)
{
ItemStack stack = inventory[i];
if (stack != null)
{
if (stack.getItem() instanceof IDemonWillGem)
{
if (((IDemonWillGem) stack.getItem()).getWill(stack) < ((IDemonWillGem) stack.getItem()).getMaxWill(stack))
{
return false;
}
}
}
}
return true;
}
/**
*
* @param player