sandstone icon indicating copy to clipboard operation
sandstone copied to clipboard

class 'CustomResourceRoot'

Open ColinTimBarndt opened this issue 3 years ago • 1 comments

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
});

ColinTimBarndt avatar Sep 02 '21 11:09 ColinTimBarndt

Though the save function would need the id and type of the resource to correctly determine the save destination.

ColinTimBarndt avatar Sep 02 '21 12:09 ColinTimBarndt