- 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:
parent
da4de55c2e
commit
faef980e59
14 changed files with 290 additions and 31 deletions
|
@ -221,7 +221,8 @@ public class BloodMagicAPI
|
|||
* @param entityClass
|
||||
* - The class of the entity to blacklist.
|
||||
* @param sacrificeValue
|
||||
* - The Amount of LP to provide per each entity sacrificed.
|
||||
* - The Amount of LP to provide per each HP of the entity
|
||||
* sacrificed.
|
||||
*/
|
||||
public static void setEntitySacrificeValue(Class<? extends EntityLivingBase> entityClass, int sacrificeValue)
|
||||
{
|
||||
|
@ -235,7 +236,8 @@ public class BloodMagicAPI
|
|||
* @param entityClassName
|
||||
* - The name of the class of the entity to blacklist.
|
||||
* @param sacrificeValue
|
||||
* - The Amount of LP to provide per each entity sacrificed.
|
||||
* - The Amount of LP to provide per each HP of the entity
|
||||
* sacrificed.
|
||||
*/
|
||||
public static void setEntitySacrificeValue(String entityClassName, int sacrificeValue)
|
||||
{
|
||||
|
|
|
@ -33,6 +33,7 @@ public class Constants
|
|||
public static final String DIRECTION = "direction";
|
||||
public static final String REAGENT_TANKS = "reagentTanks";
|
||||
public static final String CURRENT_INCENSE = "BM:CurrentIncense";
|
||||
public static final String CURRENT_PURITY = "BM:CurrentPurity";
|
||||
public static final String EMPTY = "Empty";
|
||||
public static final String OUTPUT_AMOUNT = "outputAmount";
|
||||
public static final String INPUT_AMOUNT = "inputAmount";
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
package WayofTime.bloodmagic.api.iface;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IPurificationAsh
|
||||
{
|
||||
double getTotalPurity(ItemStack stack);
|
||||
|
||||
double getMaxPurity(ItemStack stack);
|
||||
|
||||
double getPurityRate(ItemStack stack);
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue