Skip to content

Saver (3.0)

ScalarVector edited this page Oct 1, 2025 · 1 revision

In this class you will find utilities for saving regions of the world into structure data, and then saving that data into files if needed. This API is typically reserved for more atypical or advanced use cases such as saving and placing structures at runtime or creating custom tools for saving structures.

Methods

SaveToStructureData

public static StructureData SaveToStructureData(int x, int y, int width, int height)

Summary

Saves a region of the world into a StructureData object.

Parameters

  • x: The leftmost point of the region
  • y: The topmost point of the region
  • width: The width of the region
  • height: The height of the region

Returns

  • a StructureData object representing that region of the world

Exceptions

  • ArgumentException: If any part of the region is outside of the world

SaveToStructureDataWithCustom

public static StructureData SaveToStructureDataWithCustom(int x, int y, int width, int height, List<Type> customTypes)

Summary

Saves a region of the world into a StructureData object, including the specified custom ITileData types.

Parameters

  • x: The leftmost point of the region
  • y: The topmost point of the region
  • width: The width of the region
  • height: The height of the region
  • customTypes: The types of ITileData to save in addition to vanilla ITileData. These should all be blittable ITileData types.

Returns

  • a StructureData object representing that region of the world

Exceptions

  • ArgumentException: If any part of the region is outside of the world

SaveToFile

public static void SaveToFile(StructureData data, string targetPath = null, string name = "unnamed structure")

Summary

Saves a given StructureData to a file, the location is by the target path, and with the given name.

Parameters

  • data: The StructureData to save
  • targetPath: The path to the directory save the file into
  • name: The name of the file, NOT including the extension

SaveMultistructureToFile

public static void SaveMultistructureToFile(MultiStructureData data, string targetPath = null, string name = "unnamed multistructure")

Summary

Saves a given MultiStructureData to a file, the location is by the target path, and with the given name.

Parameters

  • data: The MultiStructureData to save
  • targetPath: The path to the directory save the file into
  • name: The name of the file, NOT including the extension

Do you want me to generate this as a .md file for your docs directly, or just leave it in text like this?

Clone this wiki locally