public void writeToNBT(final NBTTagCompound nbt){
  final NBTTagList modulesNbt=new NBTTagList();
  for (  final Module module : modules) {
    final NBTTagCompound moduleNbt=new NBTTagCompound();
    if (module != null) {
      module.writeToNBT(moduleNbt);
    }
    modulesNbt.appendTag(moduleNbt);
  }
  nbt.setTag(TAG_MODULES,modulesNbt);
  lock.ifPresent(null);
  lock.ifPresent(null);
}

public void writeToNBT ( final NBTTagCompound nbt ) { final NBTTagList modulesNbt = new NBTTagList ( ) ; for ( final Module module : modules ) { final NBTTagCompound moduleNbt = new NBTTagCompound ( ) ; if ( module != null ) { module . writeToNBT ( moduleNbt ) ; } modulesNbt . appendTag ( moduleNbt ) ; } nbt . setTag ( TAG_MODULES , modulesNbt ) ; lock . ifPresent ( null ) ; lock . ifPresent ( null ) ; }
write the state of all modules and pipes to the specified nbt tag .
