2015-11-07 16:51:41 +00:00
|
|
|
package WayofTime.bloodmagic.api.util.helper;
|
|
|
|
|
|
|
|
import WayofTime.bloodmagic.api.NBTHolder;
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
import net.minecraft.nbt.NBTTagCompound;
|
|
|
|
|
|
|
|
public class IncenseHelper {
|
|
|
|
public static float getCurrentIncense(EntityPlayer player) {
|
|
|
|
NBTTagCompound data = player.getEntityData();
|
2015-11-07 16:54:36 +00:00
|
|
|
if (data.hasKey(NBTHolder.NBT_CURRENT_INCENSE)) {
|
|
|
|
return data.getFloat(NBTHolder.NBT_CURRENT_INCENSE);
|
2015-11-07 16:51:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void setCurrentIncense(EntityPlayer player, float amount) {
|
|
|
|
NBTTagCompound data = player.getEntityData();
|
2015-11-07 16:54:36 +00:00
|
|
|
data.setFloat(NBTHolder.NBT_CURRENT_INCENSE, amount);
|
2015-11-07 16:51:41 +00:00
|
|
|
}
|
|
|
|
}
|