Finished implementation of Incense Altar and associated blocks.
Also added the recipe for the Ritual Tinkerer, as well as the finalized book entry for the Incense Altar.
This commit is contained in:
parent
7634404dac
commit
cb2db9bc50
108 changed files with 2197 additions and 81 deletions
|
@ -0,0 +1,55 @@
|
|||
package wayoftime.bloodmagic.util.helper;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import wayoftime.bloodmagic.util.Constants;
|
||||
|
||||
public class IncenseHelper
|
||||
{
|
||||
|
||||
public static double getCurrentIncense(PlayerEntity player)
|
||||
{
|
||||
CompoundNBT data = player.getPersistentData();
|
||||
if (data.contains(Constants.NBT.CURRENT_INCENSE))
|
||||
{
|
||||
return data.getDouble(Constants.NBT.CURRENT_INCENSE);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static void setCurrentIncense(PlayerEntity player, double amount)
|
||||
{
|
||||
CompoundNBT data = player.getPersistentData();
|
||||
data.putDouble(Constants.NBT.CURRENT_INCENSE, amount);
|
||||
}
|
||||
|
||||
public static void setMaxIncense(PlayerEntity player, double amount)
|
||||
{
|
||||
CompoundNBT data = player.getPersistentData();
|
||||
data.putDouble(Constants.NBT.MAX_INCENSE, amount);
|
||||
}
|
||||
|
||||
public static double getMaxIncense(PlayerEntity player)
|
||||
{
|
||||
CompoundNBT data = player.getPersistentData();
|
||||
if (data.contains(Constants.NBT.MAX_INCENSE))
|
||||
{
|
||||
return data.getDouble(Constants.NBT.MAX_INCENSE);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static void setHasMaxIncense(ItemStack stack, PlayerEntity player, boolean isMax)
|
||||
{
|
||||
stack = NBTHelper.checkNBT(stack);
|
||||
stack.getTag().putBoolean(Constants.NBT.HAS_MAX_INCENSE, isMax);
|
||||
}
|
||||
|
||||
public static boolean getHasMaxIncense(ItemStack stack)
|
||||
{
|
||||
stack = NBTHelper.checkNBT(stack);
|
||||
return stack.getTag().getBoolean(Constants.NBT.HAS_MAX_INCENSE);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue