
Initial publishing of the 1.16.3 branch of the mod. A lot of systems are missing (such as Rituals and Living Armour), but enough is present for a decent Alpha release.
30 lines
644 B
Java
30 lines
644 B
Java
package wayoftime.bloodmagic.iface;
|
|
|
|
import javax.annotation.Nonnull;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
import net.minecraft.nbt.CompoundNBT;
|
|
import wayoftime.bloodmagic.util.Constants;
|
|
|
|
public interface IActivatable
|
|
{
|
|
|
|
default boolean getActivated(ItemStack stack)
|
|
{
|
|
return !stack.isEmpty() && stack.hasTag() && stack.getTag().getBoolean(Constants.NBT.ACTIVATED);
|
|
}
|
|
|
|
@Nonnull
|
|
default ItemStack setActivatedState(ItemStack stack, boolean activated)
|
|
{
|
|
if (!stack.isEmpty())
|
|
{
|
|
if (!stack.hasTag())
|
|
stack.setTag(new CompoundNBT());
|
|
|
|
stack.getTag().putBoolean(Constants.NBT.ACTIVATED, activated);
|
|
}
|
|
|
|
return stack;
|
|
}
|
|
} |