Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minecraft Block Wizard export to folder does not work on linux #608

Open
nhardt opened this issue Aug 28, 2024 · 0 comments
Open

Minecraft Block Wizard export to folder does not work on linux #608

nhardt opened this issue Aug 28, 2024 · 0 comments
Labels
bug report Looks like something isn't working, but it's not yet verified

Comments

@nhardt
Copy link

nhardt commented Aug 28, 2024

Problem

Exporting blocks to a folder using the Minecraft Block Wizard on linux fails on the last step.

When attempting to export to a file, the wizard is attempting to create "blocks" directory, the leading forward slash is lost, resulting in a dialog box that does nothing.

VM608:1664 Error: ENOENT: no such file or directory, open '/home/nhardt/.local/share/mcpelauncher/games/com.mojang/development_behavior_packs/TestPack/manifest.json'
    at Object.readFileSync (node:fs:453:20)
    at t.readFileSync (node:electron/js2c/node_init:2:9771)
    at <anonymous>:1649:25
    at Array.forEach (<anonymous>)
    at m (<anonymous>:1641:13)
    at Cr.switchPage (<anonymous>:4572:27)
    at DialogSidebar.onPageSwitch (<anonymous>:5053:50)
    at DialogSidebar.setPage (dialog.js:522:39)
    at HTMLLIElement.<anonymous>

Use case

I am developing on linux and running a bedrock server on linux. I am exporting the custom entities to the bedrock server, not a local install.

Notes

In the existing code, e.split(PathModule.sep) is returning the directory names, but it loses track that this is an absolute path. The entity wizard works, i think because it does not need to create an additional directory under development_behavior_packs. The code below fixes this issue on linux.

                    ((function (e, t) {
                      // console.log("func args: " + e + " " + t)
                      // let a = e.split(PathModule.sep),
                      //   o = Math.max(t.split(PathModule.sep).length - 1, 1);
                      // for (; o < a.length; o++) {
                      //   let e = PathModule.join(...a.slice(0, o + 1));
                      //   try {
                      //     console.log("reading: " + e)
                      //     d.readdirSync(e);
                      //     console.log("read: " + e)
                      //   } catch (t) {
                      //     console.log("could not read, will make: " + e)
                      //     d.mkdirSync(e);
                      //     console.log("created " + e)
                      //   }
                      // }
                      console.log("create paths: " + e + " and " + t)
                      try {
                        fs.mkdirSync(e, { recursive: true });
                        fs.mkdirSync(t, { recursive: true });
                      } catch (err) {
                        console.error('Error creating paths:', err);
                      }
                    })(PathModule.dirname(o), a),
                    "integrate" == e.export_mode && d.existsSync(o))

I would love it if I could select my working folders but just having this part working would be great! Thanks, this is great, fun software to use!

@JannisX11 JannisX11 added the bug report Looks like something isn't working, but it's not yet verified label Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Looks like something isn't working, but it's not yet verified
Projects
None yet
Development

No branches or pull requests

2 participants