More work on the Item Experience Book. Changed the names of the Sanguimancy rituals to be more... majestic.
This commit is contained in:
parent
1d14692a93
commit
7a119adaf9
3 changed files with 36 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue