diff options
| author | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2014-02-08 03:03:22 +0200 |
|---|---|---|
| committer | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2014-02-08 03:03:22 +0200 |
| commit | 4d0e0e8de72bda8543a888082a93b1e56f13856b (patch) | |
| tree | b17c62ab7119ce485d49f163e4c10dfd05ae0d57 /common/darkknight/jewelrycraft/util/JewelryNBT.java | |
| parent | 9075a22c3e303699db18062ebfc0159cace27c29 (diff) | |
Added a new block and implemented an on/off "switch" for the rings that give buffs, also working on balancing the rings
Diffstat (limited to 'common/darkknight/jewelrycraft/util/JewelryNBT.java')
| -rw-r--r-- | common/darkknight/jewelrycraft/util/JewelryNBT.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/common/darkknight/jewelrycraft/util/JewelryNBT.java b/common/darkknight/jewelrycraft/util/JewelryNBT.java index aa11e8d..606ea4a 100644 --- a/common/darkknight/jewelrycraft/util/JewelryNBT.java +++ b/common/darkknight/jewelrycraft/util/JewelryNBT.java @@ -3,6 +3,7 @@ package darkknight.jewelrycraft.util; import net.minecraft.entity.EntityList; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; @@ -175,6 +176,20 @@ public class JewelryNBT itemStackData.removeTag(tag); } + public static boolean hasTag(ItemStack item, String tag) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) + itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + if(itemStackData.hasKey(tag)) return true; + return false; + } + public static void removeEntity(ItemStack item) { JewelryNBT.removeNBT(item, "entityID"); @@ -231,6 +246,14 @@ public class JewelryNBT return false; } + public static boolean isModifierEffectType(ItemStack stack) + { + if(modifier(stack) != null && (isModifierX(stack, new ItemStack(Item.blazePowder)) || isModifierX(stack, new ItemStack(Item.sugar)) + || isModifierX(stack, new ItemStack(Item.pickaxeIron)) || isModifierX(stack, new ItemStack(Item.feather)) + || isModifierX(stack, new ItemStack(Item.potion, 1, 8270)))) return true; + return false; + } + public static ItemStack ingot(ItemStack stack) { if(stack != null && stack != new ItemStack(0, 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("ingot")) |
