- Made it so peaceful animals provide more LP by default (to encourage creating your own farm).

- Increased the effectiveness of animals for the Gathering of the Forsaken Souls ritual by a factor of 4.
- Added the framework for the Purification Altar.
This commit is contained in:
WayofTime 2016-11-05 11:14:56 -04:00
parent da4de55c2e
commit faef980e59
14 changed files with 290 additions and 31 deletions

View file

@ -0,0 +1,39 @@
package WayofTime.bloodmagic.api.util.helper;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.nbt.NBTTagCompound;
import WayofTime.bloodmagic.api.Constants;
public class PurificationHelper
{
public static double getCurrentPurity(EntityAnimal animal)
{
NBTTagCompound data = animal.getEntityData();
if (data.hasKey(Constants.NBT.CURRENT_PURITY))
{
return data.getDouble(Constants.NBT.CURRENT_PURITY);
}
return 0;
}
public static void setCurrentPurity(EntityAnimal animal, double amount)
{
NBTTagCompound data = animal.getEntityData();
data.setDouble(Constants.NBT.CURRENT_PURITY, amount);
}
public static double addPurity(EntityAnimal animal, double added, double max)
{
double currentPurity = getCurrentPurity(animal);
double newAmount = Math.min(max, currentPurity + added);
if (newAmount < max)
{
setCurrentPurity(animal, newAmount);
return newAmount - currentPurity;
}
return 0;
}
}