add interior loading

This commit is contained in:
Brian Beck 2025-09-12 07:40:22 -07:00
parent 8509faf6bc
commit b86e5622af
1552 changed files with 1507302 additions and 44 deletions

View file

@ -15,9 +15,25 @@ export function getActualResourcePath(resourcePath: string) {
}
const resourcePaths = getResourceList();
const lowerCased = resourcePath.toLowerCase();
return (
resourcePaths.find((s) => s.toLowerCase() === lowerCased) ?? resourcePath
const foundLowerCase = resourcePaths.find(
(s) => s.toLowerCase() === lowerCased
);
if (foundLowerCase) {
return foundLowerCase;
}
const isTexture = resourcePath.startsWith("textures/");
if (isTexture) {
const foundNested = resourcePaths.find(
(s) =>
s
.replace(/^(textures\/)((lush|desert|badlands|lava|ice)\/)/, "$1")
.toLowerCase() === lowerCased
);
if (foundNested) {
return foundNested;
}
}
return resourcePath;
}
export function getResourceList() {