More work on the Item Experience Book. Changed the names of the Sanguimancy rituals to be more... majestic.

This commit is contained in:
WayofTime 2016-04-02 18:45:52 -04:00
parent 1d14692a93
commit 7a119adaf9
3 changed files with 36 additions and 2 deletions

View file

@ -58,6 +58,26 @@ public class ItemExperienceBook extends Item implements IVariantProvider
return ret;
}
public void absorbOneLevelExpFromPlayer(ItemStack stack, EntityPlayer player)
{
float progress = player.experience;
if (progress > 0)
{
double expDeduction = getExperienceAcquiredToNext(player.experienceLevel, player.experience);
player.experience = 0;
player.experienceTotal -= (int) (expDeduction);
addExperience(stack, expDeduction);
} else
{
player.experienceLevel--;
int expDeduction = getExperienceForNextLevel(player.experienceLevel - 1);
player.experienceTotal -= expDeduction;
addExperience(stack, expDeduction);
}
}
public static void setStoredExperience(ItemStack stack, double exp)
{
NBTHelper.checkNBT(stack);