BasePathClass.prototype.getResourceName does not accept substitutions like template tags normally do. It only looks at the template parts of the inputted string.
name.join() is the part of the code below causing this issue, in addition to the incorrect parameter types.
Otherwise, for example, basePath`a${b}c` will output the same thing as basePath`ac` (or actually basePath`a,c` since it's name.join() and not name.join('')) no matter what b is.
Here is an example of a correct implementation for a template tag function which simply outputs exactly the string which is inputted:
(template, ...substitutions) => (
template.map((string, i) => string + (i in substitutions ? substitutions[i] : '')).join('')
)
BasePathClass.prototype.getResourceName
does not accept substitutions like template tags normally do. It only looks at the template parts of the inputted string.name.join()
is the part of the code below causing this issue, in addition to the incorrect parameter types.https://github.com/TheMrZZ/sandstone/blob/35291b3695f026c06e7bd63d6e9abc53d97c6598/src/datapack/BasePath.ts#L170
The correct signature of a template tag function should be this:
Otherwise, for example,
basePath`a${b}c`
will output the same thing asbasePath`ac`
(or actuallybasePath`a,c`
since it'sname.join()
and notname.join('')
) no matter whatb
is.Here is an example of a correct implementation for a template tag function which simply outputs exactly the string which is inputted: