feat: expand upstream CDN mapping for additional modpack support
This commit is contained in:
@@ -178,11 +178,17 @@ const server = createServer(app);
|
||||
const TEXTURE_CACHE_DIR = process.env.TEXTURE_CACHE_DIR || path.join('/data', 'texture-cache');
|
||||
const NEGATIVE_CACHE_TTL = 7 * 24 * 60 * 60 * 1000; // 7 days for 404s
|
||||
|
||||
// Upstream CDN mapping
|
||||
// Upstream CDN mapping (Prominence Hasturian Era II modpack coverage)
|
||||
const TEXTURE_UPSTREAMS = {
|
||||
minecraft: 'https://cdn.jsdelivr.net/gh/InventivetalentDev/minecraft-assets@1.21.4/assets/minecraft/textures',
|
||||
computercraft: 'https://raw.githubusercontent.com/cc-tweaked/CC-Tweaked/mc-1.20.x/projects/common/src/main/resources/assets/computercraft/textures',
|
||||
create: 'https://raw.githubusercontent.com/Creators-of-Create/Create/mc1.20.1/dev/src/main/resources/assets/create/textures',
|
||||
mythicmetals: 'https://raw.githubusercontent.com/Noaaan/MythicMetals/1.20/src/main/resources/assets/mythicmetals/textures',
|
||||
farmersdelight: 'https://raw.githubusercontent.com/vectorwing/FarmersDelight/1.20/src/main/resources/assets/farmersdelight/textures',
|
||||
ad_astra: 'https://raw.githubusercontent.com/terrarium-earth/Ad-Astra/1.20.1/common/src/main/resources/assets/ad_astra/textures',
|
||||
betterend: 'https://raw.githubusercontent.com/quiqueck/BetterEnd/1.20/src/main/resources/assets/betterend/textures',
|
||||
ae2: 'https://raw.githubusercontent.com/AppliedEnergistics/Applied-Energistics-2/fabric/1.20.1/src/main/resources/assets/ae2/textures',
|
||||
twilightforest: 'https://raw.githubusercontent.com/TeamTwilight/twilightforest/1.20.1/src/main/resources/assets/twilightforest/textures',
|
||||
};
|
||||
|
||||
// Ensure cache directory exists
|
||||
@@ -428,7 +434,7 @@ app.get('/api/texture/resolve/:namespace/:itemName', (req, res) => {
|
||||
app.get('/api/texture/:namespace/*', async (req, res) => {
|
||||
const { namespace } = req.params;
|
||||
const texturePath = req.params[0];
|
||||
const upstream = UPSTREAM_URLS[namespace];
|
||||
const upstream = TEXTURE_UPSTREAMS[namespace];
|
||||
if (!upstream) {
|
||||
return res.status(404).send('Unknown namespace');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user