예제 #1
0
 public ItemStack getOutput(ItemStack in, Random R) {
   ItemStack is = getOutput(R);
   if (is != null && this.keepNBT) {
     if (is.hasTagCompound()) {
       NBTTagCompound nbt = is.getTagCompound();
       for (Object o : in.getTagCompound().func_150296_c()) {
         NBTBase n = (NBTBase) o;
         if (nbt.hasKey(n.toString())) nbt.removeTag(n.toString());
         nbt.func_150296_c().add(o);
       }
     } else {
       is.setTagCompound(in.stackTagCompound);
       if (TFC_ItemHeat.HasTemp(is)) TFC_ItemHeat.SetTemp(is, TFC_ItemHeat.GetTemp(is) * 0.9f);
     }
   }
   return is;
 }
예제 #2
0
  public static ArrayList<String> parseNBTAsLines(NBTTagCompound nbt) {
    ArrayList<String> li = new ArrayList();
    Iterator<NBTBase> it = nbt.func_150296_c().iterator();
    for (Object o : nbt.func_150296_c()) {
      String key = (String) o;
      NBTBase b = nbt.getTag(key); /*
			if (b instanceof NBTTagByteArray) {
				li.add(b.getName()+": "+Arrays.toString(((NBTTagByteArray)b).byteArray));
			}
			else if (b instanceof NBTTagIntArray) {
				li.add(b.getName()+": "+Arrays.toString(((NBTTagIntArray)b).intArray));
			}
			else if (b instanceof NBTTagCompound) {
				li.add(EnumChatFormatting.GOLD+b.getName()+": "+b.toString());
			}
			else {
				li.add(b.getName()+": "+b.toString());
			}*/
      li.add(key + ": " + b.toString());
    }
    return li;
  }