Swap the API packages
The new one is now built for the api jar and the old one is now internal. It will slowly be moved around to sane places within the internal code. Most of the features provided in the old "api" are addon specific features which will generally rely on the main jar anyways. The new API will be specific to compatibility features, such as blacklists, recipes, and value modification.
This commit is contained in:
parent
4fbcac6aa2
commit
ddaadfbe52
421 changed files with 1006 additions and 999 deletions
|
@ -1,33 +0,0 @@
|
|||
package WayofTime.bloodmagic.api.util.helper;
|
||||
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import net.minecraft.entity.passive.EntityAnimal;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
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