diff options
| author | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2014-02-06 21:44:28 +0200 |
|---|---|---|
| committer | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2014-02-06 21:44:28 +0200 |
| commit | 9075a22c3e303699db18062ebfc0159cace27c29 (patch) | |
| tree | aa772e1e70074134ce85056aa4b67d3f180fef4a /common/darkknight/jewelrycraft/util/JewelryNBT.java | |
| parent | bd524a6dc2bdca6777659287bfcaa235b3362b44 (diff) | |
Weeee! New awesome block!
Diffstat (limited to 'common/darkknight/jewelrycraft/util/JewelryNBT.java')
| -rw-r--r-- | common/darkknight/jewelrycraft/util/JewelryNBT.java | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/common/darkknight/jewelrycraft/util/JewelryNBT.java b/common/darkknight/jewelrycraft/util/JewelryNBT.java index be2f959..aa11e8d 100644 --- a/common/darkknight/jewelrycraft/util/JewelryNBT.java +++ b/common/darkknight/jewelrycraft/util/JewelryNBT.java @@ -146,6 +146,21 @@ public class JewelryNBT itemStackData.setTag("dimension", coords); itemStackData.setTag("dimName", coords); } + + public static void addMode(ItemStack item, String modeN) + { + NBTTagCompound itemStackData; + if (item.hasTagCompound()) + itemStackData = item.getTagCompound(); + else + { + itemStackData = new NBTTagCompound(); + item.setTagCompound(itemStackData); + } + NBTTagCompound mode = new NBTTagCompound(); + mode.setString("mode", modeN); + itemStackData.setTag("mode", mode); + } public static void removeNBT(ItemStack item, String tag) { @@ -167,7 +182,7 @@ public class JewelryNBT JewelryNBT.removeNBT(item, "ench"); } - public static void addEnchantment(ItemStack item) + public static void addFakeEnchantment(ItemStack item) { NBTTagCompound itemStackData; if (item.hasTagCompound()) @@ -234,6 +249,12 @@ public class JewelryNBT return false; } + public static boolean isModeX(ItemStack stack, String modeN) + { + if(modeName(stack) != null && modeName(stack).equals(modeN)) return true; + return false; + } + public static EntityLivingBase entity(ItemStack stack, EntityPlayer player) { if (stack != null && stack != new ItemStack(0, 0, 0) && stack.getTagCompound().hasKey("entityID") && stack.getTagCompound().hasKey("entity")) @@ -266,6 +287,17 @@ public class JewelryNBT return null; } + public static String modeName(ItemStack stack) + { + if(stack != null && stack != new ItemStack(0, 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("mode")) + { + NBTTagCompound dim = (NBTTagCompound) stack.getTagCompound().getTag("mode"); + String name = dim.getString("mode"); + return name; + } + return null; + } + public static boolean isDimNameX(ItemStack stack, String dimName) { if(ingot(stack) != null && dimName(stack).equals(dimName)) return true; |
