Added new LocalRitualStorage methods, to allow rituals to store data more fluidly.
This commit is contained in:
parent
ac5a20d5b2
commit
fd330233dd
12 changed files with 361 additions and 38 deletions
|
@ -130,7 +130,7 @@ public class AlchemicalWizardryEventHooks
|
|||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void omegaUpdateHpEvent(LivingUpdateEvent event)
|
||||
public void omegaUpdateReagentAndHpEvent(LivingUpdateEvent event)
|
||||
{
|
||||
if(event.entityLiving instanceof EntityPlayer && !event.entityLiving.worldObj.isRemote)
|
||||
{
|
||||
|
@ -183,15 +183,21 @@ public class AlchemicalWizardryEventHooks
|
|||
}
|
||||
//Consumes the amount
|
||||
float costPerTick = parad.getCostPerTickOfUse(player);
|
||||
if(reagentAmount > costPerTick)
|
||||
if(parad.doDrainReagent(player))
|
||||
{
|
||||
hasReagentChanged = true;
|
||||
reagentAmount = Math.max(0, reagentAmount - costPerTick);
|
||||
}else
|
||||
{
|
||||
hasReagentChanged = true;
|
||||
reagentAmount = 0;
|
||||
if(reagentAmount > costPerTick)
|
||||
{
|
||||
hasReagentChanged = true;
|
||||
reagentAmount = Math.max(0, reagentAmount - costPerTick);
|
||||
}else
|
||||
{
|
||||
hasReagentChanged = true;
|
||||
reagentAmount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
hasReagentChanged = true;
|
||||
}
|
||||
|
||||
if(reagentAmount <= 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue