From e09f9313f9ed65236cf84ba0c92138be76c4717c Mon Sep 17 00:00:00 2001 From: Electroblob77 <35599699+Electroblob77@users.noreply.github.com> Date: Sat, 16 May 2020 23:35:23 +0100 Subject: [PATCH] This is nullable --- src/main/java/electroblob/wizardry/item/IManaStoringItem.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/electroblob/wizardry/item/IManaStoringItem.java b/src/main/java/electroblob/wizardry/item/IManaStoringItem.java index de93846d..585f0752 100644 --- a/src/main/java/electroblob/wizardry/item/IManaStoringItem.java +++ b/src/main/java/electroblob/wizardry/item/IManaStoringItem.java @@ -4,6 +4,8 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import javax.annotation.Nullable; + /** * Interface for any items that store mana. This interface simply specifies methods for setting and getting the amount * of mana held in the item (plus a few convenience methods); implementations may differ between items. @@ -48,7 +50,7 @@ public interface IManaStoringItem { /** Convenience method that decreases the amount of mana contained in the given item stack by the given value. This * method automatically limits the mana to a minimum of 0 and performs the relevant checks for creative mode, etc. */ - default void consumeMana(ItemStack stack, int mana, EntityLivingBase wielder){ + default void consumeMana(ItemStack stack, int mana, @Nullable EntityLivingBase wielder){ if(wielder instanceof EntityPlayer && ((EntityPlayer)wielder).isCreative()) return; // Mana isn't consumed in creative setMana(stack, Math.max(getMana(stack) - mana, 0)); }