full suport for models and hotloading Plugins

This commit is contained in:
2026-08-04 22:28:39 -05:00
parent be8c1a9ea8
commit 552f570efb
9 changed files with 236 additions and 7 deletions
+11
View File
@@ -177,6 +177,7 @@
const member = btn.dataset.member;
const name = btn.dataset.name || member;
const modelFormat = btn.dataset.modelFormat || '.geo.json';
const slug = btn.dataset.projectSlug || '';
const opts = { baseUrl: btn.dataset.baseUrl, vanillaBaseUrl: btn.dataset.vanillaBaseUrl, defaultTexture: btn.dataset.defaultTexture || null };
if (!member || !opts.baseUrl || busy) return;
busy = true;
@@ -223,6 +224,16 @@
busy = false;
return;
}
// Pack plugins to hotload (autoload.txt), unless the user opted out.
const noHotload = slug && localStorage.getItem('packs:no-hotload:' + slug) === '1';
if (!noHotload && btn.dataset.plugins) {
try {
const members = JSON.parse(btn.dataset.plugins);
msg.plugins = members.map(m => ({ member: m, url: assetUrl(opts.baseUrl, m) }));
} catch (e) {
msg.plugins = [];
}
}
if (EMBEDDED_FORMATS.indexOf(modelFormat) !== -1) {
// Textures baked into the file — hand it to Blockbench as-is.
msg.modelFile = { format: modelFormat, content: await fetchModelText(member, opts.baseUrl) };