JeanJPNM / mindustry-schematic-parser

MIT License
14 stars 3 forks source link

Support for boulders, spawns, ores, etc #11

Closed bend-n closed 2 years ago

bend-n commented 2 years ago

Error: the block is not registered not exist is annoying, when the block clearly exists, and the mindustry schematic import can parse it.

JeanJPNM commented 2 years ago

How is this even possible, schematics shouldn't contain non building blocks

bend-n commented 2 years ago

a.msch.zip

bend-n commented 2 years ago

How is this even possible, schematics shouldn't contain non building blocks

"shouldn't" isnt the question here. they can.

JeanJPNM commented 2 years ago

the tag lol

JeanJPNM commented 2 years ago

Error: the block is not registered not exist is annoying, when the block clearly exists, and the mindustry schematic import can parse it.

I put that error there because I consider it better than silently returning something like an UnknownBlock. Because you can know the parser cannot identify the block.

JeanJPNM commented 2 years ago

Done, try version 4.1.6

bend-n commented 2 years ago

breaks on water

bend-n commented 2 years ago

not to mention ores.... this just adds support for environment blocks

JeanJPNM commented 2 years ago

Those are all environment "blocks", to make it possible for me to debug the problem you need to send the error logs and preferentially the schematic that was being parsed when the error occurred

JeanJPNM commented 2 years ago

You didn't provide any useful information, so I'm unable to debug the issue

bend-n commented 2 years ago
file:///home/bendn/node_modules/mindustry-schematic-parser/dist/index.mjs:663
        throw new Error(`The block "${code}" could not be found in the registry`);
              ^

Error: The block "water" could not be found in the registry
    at Function.fromCode (file:///home/bendn/node_modules/mindustry-schematic-parser/dist/index.mjs:663:15)
    at decodeBlocks (file:///home/bendn/node_modules/mindustry-schematic-parser/dist/index.mjs:4133:29)
    at decodeSchematic (file:///home/bendn/node_modules/mindustry-schematic-parser/dist/index.mjs:4291:20)
    at Function.decode (file:///home/bendn/node_modules/mindustry-schematic-parser/dist/index.mjs:4399:30)
    at file:///home/bendn/blocks/schem_image/msch.js:8:29
    at ModuleJob.run (node:internal/modules/esm/module_job:198:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:385:24)
    at async loadESM (node:internal/process/esm_loader:88:5)
    at async handleMainPromise (node:internal/modules/run_main:61:12)
Io(Os { code: 2, kind: NotFound, message: "No such file or directory" })

a.msch.txt

JeanJPNM commented 2 years ago

Try it with version 4.1.7. Also don't use fuck@you as a tag on the schematics you share in the future.

bend-n commented 2 years ago

Try it with version 4.1.7. Also don't use fuck@you as a tag on the schematics you share in the future.

oh, hehe, my generator adds that. anyways, it works now, thanks!