feat(blocks): add froglight and budding amethyst mappings
All checks were successful
Deploy to Docker / deploy (push) Successful in 1m17s
All checks were successful
Deploy to Docker / deploy (push) Successful in 1m17s
Add block mappings for ochre_froglight, pearlescent_froglight, verdant_froglight, and budding_amethyst. Remove debug logging. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -130,6 +130,12 @@ export const JAVA_TO_BEDROCK = new Map([
|
|||||||
['raw_gold_block', { bedrock: 'raw_gold_block', data: 0, name: 'Raw Gold Block' }],
|
['raw_gold_block', { bedrock: 'raw_gold_block', data: 0, name: 'Raw Gold Block' }],
|
||||||
['raw_copper_block', { bedrock: 'raw_copper_block', data: 0, name: 'Raw Copper Block' }],
|
['raw_copper_block', { bedrock: 'raw_copper_block', data: 0, name: 'Raw Copper Block' }],
|
||||||
['amethyst_block', { bedrock: 'amethyst_block', data: 0, name: 'Amethyst Block' }],
|
['amethyst_block', { bedrock: 'amethyst_block', data: 0, name: 'Amethyst Block' }],
|
||||||
|
['budding_amethyst', { bedrock: 'budding_amethyst', data: 0, name: 'Budding Amethyst' }],
|
||||||
|
|
||||||
|
// ── Froglights ──
|
||||||
|
['ochre_froglight', { bedrock: 'ochre_froglight', data: 0, name: 'Ochre Froglight' }],
|
||||||
|
['pearlescent_froglight', { bedrock: 'pearlescent_froglight', data: 0, name: 'Pearlescent Froglight' }],
|
||||||
|
['verdant_froglight', { bedrock: 'verdant_froglight', data: 0, name: 'Verdant Froglight' }],
|
||||||
|
|
||||||
// ── Sandstone ──
|
// ── Sandstone ──
|
||||||
['sandstone', { bedrock: 'sandstone', data: 0, name: 'Sandstone' }],
|
['sandstone', { bedrock: 'sandstone', data: 0, name: 'Sandstone' }],
|
||||||
|
|||||||
@@ -203,13 +203,6 @@ export async function downloadSchematic(projectUrl, timeoutMs = 60000) {
|
|||||||
|
|
||||||
// 3a: Look for Schemagic.load({ schematic: "https://...resource_media/schematic/..." })
|
// 3a: Look for Schemagic.load({ schematic: "https://...resource_media/schematic/..." })
|
||||||
const html = await page.content();
|
const html = await page.content();
|
||||||
// Debug: Log page title and HTML snippet to diagnose extraction failures
|
|
||||||
const pageTitle = await page.title();
|
|
||||||
log(TAG, `Download page title: "${pageTitle}", HTML length: ${html.length}`);
|
|
||||||
log(TAG, `HTML snippet (first 500): ${html.slice(0, 500).replace(/\n/g, ' ')}`);
|
|
||||||
// Check for any download-related links
|
|
||||||
const allHrefs = html.match(/href="[^"]*download[^"]*"/gi) || [];
|
|
||||||
log(TAG, `Download-related hrefs found: ${allHrefs.length} — ${allHrefs.slice(0, 5).join(', ')}`);
|
|
||||||
const schemagicMatch = html.match(/Schemagic\.load\s*\(\s*\{[^}]*schematic:\s*"([^"]+)"/);
|
const schemagicMatch = html.match(/Schemagic\.load\s*\(\s*\{[^}]*schematic:\s*"([^"]+)"/);
|
||||||
if (schemagicMatch) {
|
if (schemagicMatch) {
|
||||||
schematicUrl = schemagicMatch[1];
|
schematicUrl = schemagicMatch[1];
|
||||||
@@ -246,9 +239,6 @@ export async function downloadSchematic(projectUrl, timeoutMs = 60000) {
|
|||||||
await page.waitForTimeout(3000);
|
await page.waitForTimeout(3000);
|
||||||
|
|
||||||
const schematicHtml = await page.content();
|
const schematicHtml = await page.content();
|
||||||
const schPageTitle = await page.title();
|
|
||||||
log(TAG, `Schematic page title: "${schPageTitle}", HTML length: ${schematicHtml.length}`);
|
|
||||||
log(TAG, `Schematic page HTML snippet (first 500): ${schematicHtml.slice(0, 500).replace(/\n/g, ' ')}`);
|
|
||||||
const schematicPageMatch = schematicHtml.match(/Schemagic\.load\s*\(\s*\{[^}]*schematic:\s*"([^"]+)"/);
|
const schematicPageMatch = schematicHtml.match(/Schemagic\.load\s*\(\s*\{[^}]*schematic:\s*"([^"]+)"/);
|
||||||
if (schematicPageMatch) {
|
if (schematicPageMatch) {
|
||||||
schematicUrl = schematicPageMatch[1];
|
schematicUrl = schematicPageMatch[1];
|
||||||
|
|||||||
@@ -123,19 +123,6 @@ export async function fetchSchematic(url) {
|
|||||||
throw new Error(`Failed to fetch project page: ${err.message}`);
|
throw new Error(`Failed to fetch project page: ${err.message}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Debug: log project page info
|
|
||||||
const projTitle = html.match(/<title>([^<]*)<\/title>/i);
|
|
||||||
log(TAG, `Project page title: "${projTitle?.[1] || 'NONE'}", HTML length: ${html.length}`);
|
|
||||||
log(TAG, `Project page snippet (500-1500): ${html.slice(500, 1500).replace(/\n/g, ' ')}`);
|
|
||||||
const dlLinks = html.match(/href="[^"]*download[^"]*"/gi) || [];
|
|
||||||
log(TAG, `Project page download links: ${dlLinks.length} — ${dlLinks.slice(0, 10).join(', ')}`);
|
|
||||||
// Also check for any schematic/schem references
|
|
||||||
const schemRefs = html.match(/\.(schematic|schem|litematic|nbt)/gi) || [];
|
|
||||||
log(TAG, `Schematic file references: ${schemRefs.length} — ${[...new Set(schemRefs)].join(', ')}`);
|
|
||||||
// Check for share type / download section
|
|
||||||
const shareMatch = html.match(/download\/([^/"]+)/g) || [];
|
|
||||||
log(TAG, `Download path types: ${[...new Set(shareMatch)].join(', ')}`);
|
|
||||||
|
|
||||||
// Extract metadata
|
// Extract metadata
|
||||||
const titleMatch = html.match(/<title>([^<]+)<\/title>/i);
|
const titleMatch = html.match(/<title>([^<]+)<\/title>/i);
|
||||||
const name = titleMatch
|
const name = titleMatch
|
||||||
|
|||||||
Reference in New Issue
Block a user