Made it so that Demon Will will be voided if the player's tartaric gems are all full.
This commit is contained in:
parent
219b997b24
commit
eaba4e6cc2
3 changed files with 31 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue