Run formatter
This commit is contained in:
parent
61c44a831b
commit
08258fd6ef
606 changed files with 13464 additions and 22975 deletions
src/main/java/WayofTime/bloodmagic/api/util/helper
|
@ -1,35 +1,29 @@
|
|||
package WayofTime.bloodmagic.api.util.helper;
|
||||
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
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)
|
||||
{
|
||||
public class PurificationHelper {
|
||||
public static double getCurrentPurity(EntityAnimal animal) {
|
||||
NBTTagCompound data = animal.getEntityData();
|
||||
if (data.hasKey(Constants.NBT.CURRENT_PURITY))
|
||||
{
|
||||
if (data.hasKey(Constants.NBT.CURRENT_PURITY)) {
|
||||
return data.getDouble(Constants.NBT.CURRENT_PURITY);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static void setCurrentPurity(EntityAnimal animal, double amount)
|
||||
{
|
||||
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)
|
||||
{
|
||||
public static double addPurity(EntityAnimal animal, double added, double max) {
|
||||
double currentPurity = getCurrentPurity(animal);
|
||||
double newAmount = Math.min(max, currentPurity + added);
|
||||
|
||||
if (newAmount < max)
|
||||
{
|
||||
if (newAmount < max) {
|
||||
setCurrentPurity(animal, newAmount);
|
||||
return newAmount - currentPurity;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue