sandstone
sandstone copied to clipboard
class 'CustomResourceRoot'
Sandstone always deletes the datapack folder before regenerating it. There's currently no way to do this for custom resources (like Resourcepacks). Instantiating a CustomResourceRoot class could tell Sandstone to first clean up the location. Then, CustomResource instances need to receive the root class to retrieve their save location.
This would move the save function into the root class.
Example:
const resourcepackRoot = CustomResourceRoot(({ saveType, packName, saveLocation }): string => {
// ...
});
export const FontResource = CustomResource("font", {
// ...
root: resourcepackRoot
});
Though the save function would need the id and type of the resource to correctly determine the save destination.