Posted 08 April 2016 - 07:48 PM
I was wondering if someone has done this before that they would be able to let me know how. I want to take a Lua table (HashMap) and store it in the NBT of the peripheral's TileEntity.
// Our map in NBT form
NBTTagCompound nbtMap = new NBTTagCompound();
// Copy every element from the HashMap to the NBTTagCompound
for (every key value pair in the map) {
nbtMap.setString(key, value); // This might not be setString in your case!
}
// Save it in the TileEntity's compound
tileEntityNBT.setTag("MyMap", nbtMap);