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