BloodMagic/src/main/java/WayofTime/bloodmagic/api/util/helper/IncenseHelper.java

25 lines
709 B
Java
Raw Normal View History

2015-11-07 16:51:41 +00:00
package WayofTime.bloodmagic.api.util.helper;
import WayofTime.bloodmagic.api.Constants;
2015-11-07 16:51:41 +00:00
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
public class IncenseHelper
{
public static double getCurrentIncense(EntityPlayer player)
{
2015-11-07 16:51:41 +00:00
NBTTagCompound data = player.getEntityData();
if (data.hasKey(Constants.NBT.CURRENT_INCENSE))
{
return data.getDouble(Constants.NBT.CURRENT_INCENSE);
2015-11-07 16:51:41 +00:00
}
return 0;
}
public static void setCurrentIncense(EntityPlayer player, double amount)
{
2015-11-07 16:51:41 +00:00
NBTTagCompound data = player.getEntityData();
data.setDouble(Constants.NBT.CURRENT_INCENSE, amount);
2015-11-07 16:51:41 +00:00
}
}