GithubHelp home page GithubHelp logo

mcimport's People

Contributors

dgm3333 avatar ekdohibs avatar ensonic avatar mystictempest avatar pantyhose-x avatar schmeldric avatar sofar avatar zaoqi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mcimport's Issues

Possibility of including conversion option for MineClone2 in addition to Minetest Game?

Hi,

I received some feedback recently regarding the possibility of this feature to simplify things for end users. That way users only need this one, the original mcimport script, but could choose between conversions.

As opposed to having one version of mcimport for MTG, and my slightly modified fork for use with MCL2: mcimport_for_MineClone2

But, before looking into how to modify the code for this, or attempting any PRs. I figured I'd ask; would y'all be open to having this feature?

Fail. in block.py

with this:
./mcimport.sh
./mcimport.sh: line 15: cd: /home/myuser/.minecraft/saves: No such file or directory

(zenity:207977): Gtk-WARNING **: 18:36:54.356: Theme parsing error: gtk.css:6703:68: Invalid name of pseudo-class

(zenity:208059): Gtk-WARNING **: 18:37:02.201: Theme parsing error: gtk.css:6703:68: Invalid name of pseudo-class

(zenity:208159): Gtk-WARNING **: 18:37:13.627: Theme parsing error: gtk.css:6703:68: Invalid name of pseudo-class
Traceback (most recent call last):0:00:28 h:m:s
File "/.../mcimport.py", line 107, in
mtmap.save()
File "/.../block.py", line 455, in save
for block in self.blocks:
File "/.../block.py", line 439, in fromMCMapBlocksIterator
for mcblock in mcmap.getBlocksIterator():
File "/r.../block.py", line 62, in getBlocksIterator
blocks = self.getChunk(chkx, chkz).blocks
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/.../block.py", line 45, in getChunk
return MCChunk(chkx, chkz, self.world_path, self.ext)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/.../block.py", line 91, in init
self.blocks.append(MCBlock(raw_data, (chkx, chkz), section["Y"], True))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/.../block.py", line 108, in init
self.from_section(section)
File "/.../block.py", line 174, in from_section
self.blocks = self.reverse_X_axis(section["Blocks"])
~~~~~~~^^^^^^^^^^
KeyError: 'Blocks'

(zenity:208172): Gtk-WARNING **: 18:37:13.984: Theme parsing error: gtk.css:6703:68: Invalid name of pseudo-class

Segmentation fault in minetest after converting with mcimport

If I try to convert a particular Minecraft world with mcimport, I get a Segmentation Fault when I try to load it in minetest. Here's the error from minetest:

.....
2020-06-16 19:09:23: INFO[Main]: Client::scanModSubfolder(): Loading "/usr/share/minetest/builtin/common/chatcommands.lua" as "*builtin*:common/chatcommands.lua".
2020-06-16 19:09:23: INFO[Main]:   size: 3138 bytes
2020-06-16 19:09:23: INFO[Main]: Client::scanModSubfolder(): Loading "/usr/share/minetest/builtin/common/information_formspecs.lua" as "*builtin*:common/information_formspecs.lua".
2020-06-16 19:09:23: INFO[Main]:   size: 4038 bytes
2020-06-16 19:09:23: VERBOSE[Main]: Loading and running script @*builtin*:init.lua
2020-06-16 19:09:23: ERROR[Main]: The following mods could not be found: "colour_chat" "csm_who_plus"
2020-06-16 19:09:23: INFO[Main]: Client loading mods: 
2020-06-16 19:09:23: INFO[Main]: Client got TOCLIENT_MOVE_PLAYER pos=(-10,0,0) pitch=0 yaw=0
2020-06-16 19:09:23: INFO[Main]: Client: Privileges updated: ban basic_privs debug interact kick password privs server shout 
2020-06-16 19:09:23: INFO[Main]: Client: Detached inventory update: "creative_Snowflake", mode=update
2020-06-16 19:09:23: INFO[Main]: Client: Detached inventory update: "creative_Snowflake", mode=update
Segmentation fault (core dumped)

Said world can be found here, with the input and output of mcinput: https://send.firefox.com/download/1260c04323ecf744/#xyqM2fr2P49OY0bSx4KYLw

(it's a big file, so unfortunately I had to use Firefox Send. Download expires after 100 downloads or 7 days)

Unfortunately, Minetest isn't giving me much to work with to debug the problem.

I have discovered some other example Minecraft worlds that cause the same problem too if they are required.

KeyError: 'Level'

As an enthusiastic newcomer to Minetest, I would love to bring some of my old worlds over from Minecraft. This script looks like what I'm after, but running it yields only the following error message and an exit status 1.

$ python3 mcimport.py "$HOME/Desktop/tree-world" "$HOME/.minetest/worlds/tree-world"
$HOME/mcimport/tile_entities.py:117: SyntaxWarning: invalid escape sequence '\/'
  m = re.search('\/time set (\d+)', c)
Traceback (most recent call last)::??:?? h:m:s
  File "$HOME/mcimport/mcimport.py", line 107, in <module>
    mtmap.save()
  File "$HOME/mcimport/block.py", line 455, in save
    for block in self.blocks:
  File "$HOME/mcimport/block.py", line 439, in fromMCMapBlocksIterator
    for mcblock in mcmap.getBlocksIterator():
  File "$HOME/mcimport/block.py", line 62, in getBlocksIterator
    blocks = self.getChunk(chkx, chkz).blocks
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "$HOME/mcimport/block.py", line 45, in getChunk
    return MCChunk(chkx, chkz, self.world_path, self.ext)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "$HOME/mcimport/block.py", line 86, in __init__
    raw_data = nbt.read(udata)['']['Level']
               ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
KeyError: 'Level'

Home directory redacted; substituted with $HOME.

I tried it with the shell script first, but found that iterating while debugging was faster if I just ran the python script directly, and I was getting the same result either way.

I have tried it on four different worlds and get exactly the same result. One of the worlds is from MC 1.20.6 and another is from 1.12.2, so save version doesn't seem to be related. I've linked the example (from 1.19) below. (It's too large to attach apparently.)
https://www.icloud.com/iclouddrive/044AlMrcWsxo3Bi50eVQuzzHA#source-tree-world

The output folder does seem to contain some basic files, which I've attached in case it's useful.
tree-world.tar.gz

Information

  • OS: Arch Linux (fully updated)
  • Python: 3.12.3
  • Other info available on request.

Thank you for your time! I really appreciate it!

KeyError: 'Blocks' when converting Minecraft "Witchcraft & Wizardry"

Hi, I am trying to convert the "Witchcraft & Wizardry" Minecraft project (Light version first) from the following website.

https://gumroad.com/l/floomap
http://www.mediafire.com/file/xke143473zi4ytp/Witchcraft_and_Wizardry_-_Light.zip/file

Problem is I do get the following error during conversion:

$ python3 mcimport.py ../Witchcraft\ and\ Wizardry\ -\ Light/ ../witchcraft_and_wizardry/
Processed 0 / 182570 chunks, ETA ??:??:?? h:m:s
Processed 10 / 182570 chunks, ETA 0:00:32 h:m:s
...
Processed 1250 / 182570 chunks, ETA 0:01:05 h:m:s
chunkpos -353 yslice -1, chunkpos 127
Traceback (most recent call last):
  File "mcimport.py", line 107, in <module>
    mtmap.save()
  File "/home/sthieme/Downloads/mcimport/block.py", line 457, in save
    for block in self.blocks:
  File "/home/sthieme/Downloads/mcimport/block.py", line 441, in fromMCMapBlocksIterator
    for mcblock in mcmap.getBlocksIterator():
  File "/home/sthieme/Downloads/mcimport/block.py", line 63, in getBlocksIterator
    blocks = self.getChunk(chkx, chkz).blocks
  File "/home/sthieme/Downloads/mcimport/block.py", line 45, in getChunk
    return MCChunk(chkx, chkz, self.world_path, self.ext)
  File "/home/sthieme/Downloads/mcimport/block.py", line 92, in __init__
    self.blocks.append(MCBlock(raw_data, (chkx, chkz), section["Y"], True))
  File "/home/sthieme/Downloads/mcimport/block.py", line 110, in __init__
    self.from_section(section)
  File "/home/sthieme/Downloads/mcimport/block.py", line 176, in from_section
    self.blocks = self.reverse_X_axis(section["Blocks"])
KeyError: 'Blocks'

I changed the logging a bit and added the output of the chunkpos, yslice, chunkpos in block.py line 92 to give some more context. Dunno if this is helpful ?

BTW: I have had to change the shebang to #!/bin/bash in your mcimport.py otherwise the resulting get_mods.sh would not run under Linux Mint / Debian.

more details for "Unknown Minecraft Block:52:0"

What does the ":52:0" stand for? Any guidance what to do to improve coverage?

The README only mentions 'missing mode' which is a bit vague. How do I find out what mod I would need to install?

IndexError: list index out of range

mtserver@ns533923:~/mcimport$ python3 mcimport.py
Traceback (most recent call last):
File "/home/mtserver/mcimport/mcimport.py", line 16, in
if not os.path.exists(sys.argv[1]):
~~~~~~~~^^^

Exception on import from 1.15.2

When starting the import, an exception occurs and creates an empty world:

python3 mcimport.py ... ...
Traceback (most recent call last)::00:14 h:m:s
  File "mcimport.py", line 107, in <module>
    mtmap.save()
  File "/home/dummy/mcimport/block.py", line 455, in save
    for block in self.blocks:
  File "/home/dummy/mcimport/block.py", line 439, in fromMCMapBlocksIterator
    for mcblock in mcmap.getBlocksIterator():
  File "/home/dummy/mcimport/block.py", line 62, in getBlocksIterator
    blocks = self.getChunk(chkx, chkz).blocks
  File "/home/ndurchx/mcimport/block.py", line 45, in getChunk
    return MCChunk(chkx, chkz, self.world_path, self.ext)
  File "/home/dummy/mcimport/block.py", line 91, in __init__
    self.blocks.append(MCBlock(raw_data, (chkx, chkz), section["Y"], True))
  File "/home/dummy/mcimport/block.py", line 108, in __init__
    self.from_section(section)
  File "/home/dummy/mcimport/block.py", line 174, in from_section
    self.blocks = self.reverse_X_axis(section["Blocks"])
KeyError: 'Blocks'

Versions:
Minecraft: 1.15.2 (no mods)
Python: 3.6.9

On some worlds, the exception happens at the first line of the output. On other worlds, after a few correct output lines.
Here is a vanilla map, on which I have the exception at the first line (removed player data):
MTTest.zip

Migrate mcimport.sh to Python

The mcimport.sh script is pretty simple and could be re-implemented in Python with perhaps Tkinter used for popup messages. OS specific operations such as checking if a directory exists can be done by using the Python os.path module.

This should make the code more portable and eliminate the need for users to have extra programs such as zenity and bash installed on their systems.

Minecraft PE support

Hello, every developer:

Can you develop a branch to convert maps of MCPE 1.2 or higher to Minetest maps?

If you can, I can't thank you enough.

Minetester · BingFengFSX(IFRFSX).

better progress reporting

The conversion can take quite a bit of time. Right now the status is reported as

Saved xxxxx blocks

If the tool knows the size of the world, would it be possible to report it as

Saved xxxxx/yyyyy blocks

Ideally with some ETA. Unfortunately in blocks.py self.blocks in a generator, and hence it is a bit more involved to get the len(). Anyway, I'll give it a try.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.