Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Mar 2nd, 2012  |  syntax: C++  |  size: 0.69 KB  |  hits: 6  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.         NBTTagCompound Compound("RootCompound");
  2.        
  3.         NBTTagInt64 Byte("entry");
  4.         Byte.getDataRef() = 92233720368547807;
  5.        
  6.        
  7.         NBTTagList EnchList("encharray",FC_NBT_TYPE_COMPOUND);
  8.  
  9.         NBTTagCompound Ench1("Ench1");
  10.         NBTTagShort data1("data"),data2("data2");
  11.         data1.getDataRef() = 11;
  12.         data2.getDataRef() = 99;
  13.  
  14.  
  15.         Ench1.addSubElement(&data1);
  16.         Ench1.addSubElement(&data2);
  17.  
  18.         EnchList.addSubElement(&Ench1);
  19.         EnchList.addSubElement(&Ench1);
  20.  
  21.  
  22.  
  23.         Compound.addSubElement(&EnchList);
  24.         Compound.addSubElement(&Byte);
  25.        
  26.  
  27.         string sOut("");
  28.         Compound.write(sOut,FC_NBT_OUTPUT_GZIP);
  29.         std::ofstream File;
  30.         File.open("NBT.dat");
  31.         File.write(sOut.c_str(),sOut.length());
  32.         File.flush();
  33.         File.close();