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 Education Edition World Loading Error #779

Closed
lanceingle opened this issue Mar 23, 2017 · 3 comments
Closed

Minecraft Education Edition World Loading Error #779

lanceingle opened this issue Mar 23, 2017 · 3 comments

Comments

@lanceingle
Copy link

I'm trying to use MCEdit to load a world that was created with the education edition of Minecraft. My wife has been tasked with letting kids make things in Minecraft and then we export them to STL files for a 3d printer for her work.

I'm trying to follow the instructions on Mineways to convert the newer version of the world (LevelDB?) to the older PC version that Mineways can understand to finish the STL export process.

I found a comment in the issues where a dev got 1.0 to at least load. I can't seem to get that to work with the latest pull from master.

Here is a link to the .mcworld file (it's just a zip) I'm trying to load.
https://www.dropbox.com/s/f7oe8iyv6yk7gkg/Sandbox.mcworld?dl=1

lingle at lingles-MacBook-Pro.local  ~/Desktop/temp/MCEdit-Unified on master
$ python mcedit.py --debug-pe
Running in fixed mode. Support files are in your App Support Folder (Available from the main menu of MCEdit)
Splash load...
2017-03-23 02:01:42.210 Python[37197:603465] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/rh/_9n375hn79n9y_8vvg_cj8br0000gp/T/org.python.python.savedState
[ ****** ] ~~~~~~~~~~ Starting MCEdit-Unified v1.5.6.0
[   ERROR][          pymclevel.nbt.py:684]:Failed to import Cythonized nbt file. Running on (very slow) pure-python nbt fallback.
[   ERROR][          pymclevel.nbt.py:685]:(Did you forget to run 'setup.py build_ext --inplace'?)
[   ERROR][          pymclevel.nbt.py:686]:No module named _nbt
[ WARNING][            mcplatform.py:1258]:Initializing window management...
Minecraft_Server.jar storage initialized.
Each server is stored in a subdirectory of /Users/lingle/Library/Application Support/pymclevel/ServerJarStorage named with the server's version number
Cached servers:  []
*** MCEDIT DEBUG: file_dialog: /Users/lingle/Desktop/temp/MCEdit-Unified/albow/file_dialogs.pyc
*** MCEDIT DEBUG: directory: /Users/lingle/Desktop/temp/MCEdit-Unified/albow
*** MCEDIT DEBUG: current directory: /Users/lingle/Desktop/temp/MCEdit-Unified
[   ERROR][                  root.py:1188]:Wasn't able to open a file {file => /Users/lingle/Desktop/5NEFAB-NAQA=/level.dat}
Traceback (most recent call last):
  File "/Users/lingle/Desktop/temp/MCEdit-Unified/leveleditor.py", line 1185, in loadFile
    level = pymclevel.fromFile(filename)
  File "/Users/lingle/Desktop/temp/MCEdit-Unified/pymclevel/mclevel.py", line 226, in fromFile
    return PocketLeveldbWorld(filename)
  File "/Users/lingle/Desktop/temp/MCEdit-Unified/pymclevel/leveldbpocket.py", line 582, in __init__
    self.worldFile = PocketLeveldbDatabase(filename, create=create)
  File "/Users/lingle/Desktop/temp/MCEdit-Unified/pymclevel/leveldbpocket.py", line 314, in __init__
    self.options = leveldb_mcpe.Options()
AttributeError: 'NoneType' object has no attribute 'Options'

Any help would greatly be appreciated. Thanks.
// lance

@LaChal
Copy link
Collaborator

LaChal commented Mar 23, 2017

I guess I'm the dev you're talking about...

You may lack some .so files to use properly the current PE support. These files are included in the .app, but since I'm not an OSX expert, I'm not sure which ones you have to extract. (1)

The --debug-pe CLI option create a specific log file to see how the PE support guts are working. You can use it, of course, but be aware it can create a gigantic file.

Also, it is highly recommended to use the binary NBT support.
To get it you have two options:

  1. Look in the MCEdit .app for OSX; search for _nbt.so and copy it to your MCEdit source install pymclevel directory.
  2. Install Cython 0.21.2 and run python setup.py build_ext --inplace from your MCEdit source directory.

Now, lets talk about the PE support itself 😄

The current support is not exactly working. You may be able to open PE worlds with, but no guaranty about what happens (as you know). It is handled by a binary file: leveldb_mcpe.so in pymclevel subdirectory.

We're working on a new version of this support. You shall already have in your source installation: libleveldb.dylib in pymclevel subdirectory.
It is possible to use this new support, but just remember it's under development, so backup your worlds (at least)...

To use it:

  1. Create the new_features.def file alongside mcedit.py.
  2. Put these lines in the file:

loadNBTCompoundList
newPocketSupport
levelDBPy

  1. Run MCEdit using python mcedit.py --new-features.

You shall be able to open the world.
Remember that PE and PC versions does not contain exactly the same blocks, so putting stuff from one version into another one may not work, and even crash MCEdit...

Please, keep in mind some people reported memory issues when trying to work with large selections.

P.S.: I've looked to Mineways documentation, and tested the MCEdit part with your world. All went fine 😄

P.S. 2: You're the first one outside the dev team who may test this new PE support on OSX, AFAIK. Any feedback is welcome 😉


(1) You will find two .so files for the NBT and PE support in two different places in the .app.
_nbt.so will be found in Contents/Resources/pymclevel/ and Contents/Resources/lib/python2.7/lib-dynload/pymclevel/; leveldb_mcpe.so in Contents/Resources/pymclevel/ and Contents/Resources/lib/python2.7/lib-dynload/.

@lanceingle
Copy link
Author

@LaChal Yep, I was referring to you. Thanks for taking a look at this.

Quick Question: Since you went through the process defined on the Mineways docs. Is it possible to automate the conversion without the GUI. I skimmed the mcedit source and thought that it might be possible but it was getting late last night.

Your "new-features" flag did the trick. MCEdit successfully loaded my world! I was able to convert the world back to the PC version. I did hit a snag though. There was a file_dialog bug that was pretty simple to patch. The details are below.

Due to my very limited feature requirements I'm not sure I have a ton of feedback. But it does work and thank you for this. Saved me from having to read up on LevelDB. I was so excited last night when I stumbled upon your post saying you were able to read 1.0 PE. I figured once it was read and loaded that translating these simple worlds the kids would make back to classic wouldn't be that much harder.

Let me know what you think it's possible to automate this workflow.

Crash / Fix
Workflow is as follows.

  • Open world
  • Select All
  • Copy
  • Create New World <---- Crashes here
  • Paste
  • Save as PC version

Crash
It happens when I click create with the file dialog modal open. I tried it twice to no avail. Also tried with a path that has no spaces as well.
Path that I'm attempting to save to: "/Users/lingle/Desktop/untitled\ folder/"

$ python mcedit.py --new-features
Running in fixed mode. Support files are in your App Support Folder (Available from the main menu of MCEdit)
Splash load...
2017-03-23 16:07:40.814 Python[65315:917984] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/rh/_9n375hn79n9y_8vvg_cj8br0000gp/T/org.python.python.savedState
[ ****** ] ~~~~~~~~~~ Starting MCEdit-Unified v1.5.6.0
[ WARNING][                   root.py:103]:New features mode requested.
[ WARNING][                   root.py:107]:New features list loaded.
[ WARNING][            mcplatform.py:1258]:Initializing window management...
Minecraft_Server.jar storage initialized.
Each server is stored in a subdirectory of /Users/lingle/Library/Application Support/pymclevel/ServerJarStorage named with the server's version number
Cached servers:  []
*** MCEDIT DEBUG: file_dialog: /Users/lingle/Desktop/temp/MCEdit-Unified/albow/file_dialogs.pyc
*** MCEDIT DEBUG: directory: /Users/lingle/Desktop/temp/MCEdit-Unified/albow
*** MCEDIT DEBUG: current directory: /Users/lingle/Desktop/temp/MCEdit-Unified
Clipping:  _Vector(x=160, y=256, z=160)
Minecraft_Server.jar storage initialized.
Each server is stored in a subdirectory of /Users/lingle/Library/Application Support/pymclevel/ServerJarStorage named with the server's version number
Cached servers:  []
Minecraft_Server.jar storage initialized.
Each server is stored in a subdirectory of /Users/lingle/Library/Application Support/pymclevel/ServerJarStorage named with the server's version number
Cached servers:  []
*** MCEDIT DEBUG: file_dialog: /Users/lingle/Desktop/temp/MCEdit-Unified/albow/file_dialogs.pyc
*** MCEDIT DEBUG: directory: /Users/lingle/Desktop/temp/MCEdit-Unified/albow
*** MCEDIT DEBUG: current directory: /Users/lingle/Desktop/temp/MCEdit-Unified
mcedit.main MCEdit exited with errors.
[   ERROR][                   root.py:941]:MCEdit version Unified v1.5.6.0 %s Minecraft 1.8-1.11.2 | PE 0.11
Traceback (most recent call last):
  File "mcedit.py", line 1004, in <module>
    main(sys.argv)
  File "mcedit.py", line 938, in main
    MCEdit.main()
  File "mcedit.py", line 816, in main
    rootwidget.run()
  File "/Users/lingle/Desktop/temp/MCEdit-Unified/albow/root.py", line 167, in run
    self.run_modal(None)
  File "/Users/lingle/Desktop/temp/MCEdit-Unified/albow/root.py", line 300, in run_modal
    last_mouse_event_handler.handle_mouse('mouse_up', event)
  File "/Users/lingle/Desktop/temp/MCEdit-Unified/albow/widget.py", line 378, in handle_mouse
    self.call_handler(name, event)
  File "/Users/lingle/Desktop/temp/MCEdit-Unified/albow/widget.py", line 460, in call_handler
    return method(*args)
  File "/Users/lingle/Desktop/temp/MCEdit-Unified/albow/controls.py", line 240, in mouse_up
    self.call_handler('action')
  File "/Users/lingle/Desktop/temp/MCEdit-Unified/albow/widget.py", line 460, in call_handler
    return method(*args)
  File "/Users/lingle/Desktop/temp/MCEdit-Unified/leveleditor.py", line 3047, in showControls
    self.controlPanel.present(False)
  File "/Users/lingle/Desktop/temp/MCEdit-Unified/albow/widget.py", line 524, in present
    self.root.run_modal(self)
  File "/Users/lingle/Desktop/temp/MCEdit-Unified/albow/root.py", line 300, in run_modal
    last_mouse_event_handler.handle_mouse('mouse_up', event)
  File "/Users/lingle/Desktop/temp/MCEdit-Unified/albow/widget.py", line 378, in handle_mouse
    self.call_handler(name, event)
  File "/Users/lingle/Desktop/temp/MCEdit-Unified/albow/widget.py", line 460, in call_handler
    return method(*args)
  File "/Users/lingle/Desktop/temp/MCEdit-Unified/albow/controls.py", line 240, in mouse_up
    self.call_handler('action')
  File "/Users/lingle/Desktop/temp/MCEdit-Unified/albow/widget.py", line 460, in call_handler
    return method(*args)
  File "mcedit.py", line 692, in createNewWorld
    level = self.editor.createNewLevel()
  File "/Users/lingle/Desktop/temp/MCEdit-Unified/leveleditor.py", line 2643, in createNewLevel
    filename = mcplatform.askCreateWorld(directories.minecraftSaveFileDir)
  File "/Users/lingle/Desktop/temp/MCEdit-Unified/mcplatform.py", line 384, in askCreateWorld
    suffix="",
  File "/Users/lingle/Desktop/temp/MCEdit-Unified/mcplatform.py", line 537, in askSaveFile
    pathname=None)
  File "/Users/lingle/Desktop/temp/MCEdit-Unified/albow/file_dialogs.py", line 550, in request_new_filename
    if dlog.present():
  File "/Users/lingle/Desktop/temp/MCEdit-Unified/albow/widget.py", line 524, in present
    self.root.run_modal(self)
  File "/Users/lingle/Desktop/temp/MCEdit-Unified/albow/root.py", line 300, in run_modal
    last_mouse_event_handler.handle_mouse('mouse_up', event)
  File "/Users/lingle/Desktop/temp/MCEdit-Unified/albow/widget.py", line 378, in handle_mouse
    self.call_handler(name, event)
  File "/Users/lingle/Desktop/temp/MCEdit-Unified/albow/widget.py", line 460, in call_handler
    return method(*args)
  File "/Users/lingle/Desktop/temp/MCEdit-Unified/albow/controls.py", line 240, in mouse_up
    self.call_handler('action')
  File "/Users/lingle/Desktop/temp/MCEdit-Unified/albow/widget.py", line 460, in call_handler
    return method(*args)
  File "/Users/lingle/Desktop/temp/MCEdit-Unified/albow/file_dialogs.py", line 480, in ok
    path = self.pathname
  File "/Users/lingle/Desktop/temp/MCEdit-Unified/albow/file_dialogs.py", line 472, in get_pathname
    return path
NameError: global name 'path' is not defined

==================================
			  MCEdit has crashed
==================================
Press the Enter key to close this window

Fix. I didn't test it very thorough but here is what I did. Seems to work.

     def get_pathname(self):
-        return path
+        name = self.filename
+        if name:
+            return os.path.join(self.directory, name)
+        else:
+            return None

LaChal added a commit that referenced this issue Mar 24, 2017
A method was not correctly written in the internal file dialogs which prevented to 'save as' files and worlds.

This issue has been reported in #779, and the fix is mostly lanceingle's one.

Thanks to him 😄
@LaChal
Copy link
Collaborator

LaChal commented Mar 24, 2017

Thanks for the fix 😄

It has been implemented!

LaChal added a commit that referenced this issue Jun 17, 2017
The nes PE support is now the default one, since it's the only one which permit PE 1+ worlds to be edited.

The lines:

```
loadNBTCompoundList
newPocketSupport
levelDBPy
```

Can be removed from the `new_features.def` file, and the CLI switch `--new-features` is no more needed.

(Referencing #805, #803, #801, #779, #676, #671.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants