diff options
| author | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2015-02-03 21:09:09 +0000 |
|---|---|---|
| committer | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2015-02-03 21:09:09 +0000 |
| commit | 3f4c717de5ebc9b942d65ae45ac87c43bdf8a31b (patch) | |
| tree | 15c68c8b61dbd0b7f44937a5c790c4b844e50f58 /java/darkknight/jewelrycraft/util/JewelryNBT.java | |
| parent | 73ca377dc01f859dabd7b07738cb7aeb762272b1 (diff) | |
Made a few modifications to some classes, added earrings and bracelets. Improved coloring algorithm and balanced the Thieving Glove
Diffstat (limited to 'java/darkknight/jewelrycraft/util/JewelryNBT.java')
| -rw-r--r-- | java/darkknight/jewelrycraft/util/JewelryNBT.java | 73 |
1 files changed, 15 insertions, 58 deletions
diff --git a/java/darkknight/jewelrycraft/util/JewelryNBT.java b/java/darkknight/jewelrycraft/util/JewelryNBT.java index db2c321..3f38f94 100644 --- a/java/darkknight/jewelrycraft/util/JewelryNBT.java +++ b/java/darkknight/jewelrycraft/util/JewelryNBT.java @@ -21,11 +21,8 @@ public class JewelryNBT { // TODO NBT Tag Adding /** - * - * @param item - * The item you want to add the NBT data on - * @param metal - * The metal you want to add on the item + * @param item The item you want to add the NBT data on + * @param metal The metal you want to add on the item */ public static void addMetal(ItemStack item, ItemStack metal) { @@ -42,11 +39,8 @@ public class JewelryNBT } /** - * - * @param item - * The item you want to add the NBT data on - * @param gem - * The gem you want to add on the item + * @param item The item you want to add the NBT data on + * @param gem The gem you want to add on the item */ public static void addGem(ItemStack item, ItemStack gem) { @@ -66,11 +60,8 @@ public class JewelryNBT } /** - * - * @param item - * The item you want to add the NBT data on - * @param modifier - * The modifier you want to add on the item + * @param item The item you want to add the NBT data on + * @param modifier The modifier you want to add on the item */ public static void addModifiers(ItemStack item, ArrayList<ItemStack> modifier) { @@ -93,6 +84,10 @@ public class JewelryNBT } } + /** + * @param item The item you want to add the NBT data on + * @param entity The entity to add on the item + */ public static void addEntity(ItemStack item, EntityLivingBase entity) { NBTTagCompound itemStackData; @@ -221,20 +216,6 @@ public class JewelryNBT 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 addFakeEnchantment(ItemStack item) { NBTTagCompound itemStackData; @@ -347,7 +328,8 @@ public class JewelryNBT if (modifier(stack) != null) { ArrayList<ItemStack> list = modifier(stack); - for(int i = 0; i < list.size(); i++) if(list.get(i).getItem() == modifier.getItem() && list.get(i).getItemDamage() == modifier.getItemDamage()) return true; + for (int i = 0; i < list.size(); i++) + if (list.get(i).getItem() == modifier.getItem() && list.get(i).getItemDamage() == modifier.getItemDamage()) return true; } return false; } @@ -358,12 +340,6 @@ 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 boolean isEntityX(ItemStack stack, EntityPlayer player, EntityLivingBase entity) { if (entity != null && entity instanceof EntityLivingBase && entity(stack, player) != null && entity(stack, player).equals(entity)) return true; @@ -382,8 +358,7 @@ public class JewelryNBT return false; } - // TODO Return components based on NBT - + // TODO Return components based on NBT public static ItemStack gem(ItemStack stack) { if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("gem")) @@ -396,32 +371,14 @@ public class JewelryNBT return null; } - public static ArrayList<ItemStack> gems(ItemStack stack) - { - if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("gemNumber")) - { - int no = stack.getTagCompound().getInteger("gemNumber"); - ArrayList<ItemStack> gems = new ArrayList<ItemStack>(); - for (int i = 1; i <= no; i++) - { - NBTTagCompound gemNBT = (NBTTagCompound) stack.getTagCompound().getTag("gem" + i); - ItemStack gem = new ItemStack(Item.getItemById(0), 0, 0); - gem.readFromNBT(gemNBT); - gems.add(gem); - } - return gems; - } - return null; - } - - //TODO Modifier public static ArrayList<ItemStack> modifier(ItemStack stack) { if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound()) { int size = stack.getTagCompound().getInteger("modifierSize"); ArrayList<ItemStack> list = new ArrayList<ItemStack>(); - for(int i = 0; i < size; i++){ + for (int i = 0; i < size; i++) + { ItemStack modifier = new ItemStack(Item.getItemById(0), 0, 0); NBTTagCompound modifierNBT = (NBTTagCompound) stack.getTagCompound().getTag("modifier" + i); modifier.readFromNBT(modifierNBT); |
