Convert Minecraft maps to Minetest worlds

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: Convert Minecraft maps to Minetest worlds

by sofar » Post

superschizo wrote:I found the problem with my edits of map_content.txt. It was a default setting for my KDE text writers. My text writers (Kate and Kwrite) both default to a soft tab, which I guess converts the white space from a tab to spaces. So now I have changed the setting and my edits work.
yeah, it just dawned on me that that's likely the problem. The file needs to be TAB delimited.

superschizo
Member
Posts: 121
Joined: Mon Aug 26, 2013 17:08
In-game: uberdorf
Location: Missouri, USA

Re: Convert Minecraft maps to Minetest worlds

by superschizo » Post

Here is what the stadium looks like after the conversion with the modified map_content.txt and no mods. I would post the modified map content file, but some colors are off. Thank you very much for this app.
screenshot_20190522_100009.png
screenshot_20190522_100009.png (427.72 KiB) Viewed 3327 times

User avatar
Wuzzy
Member
Posts: 4786
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: Convert Minecraft maps to Minetest worlds

by Wuzzy » Post

Does this work for MCL2?

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: Convert Minecraft maps to Minetest worlds

by sofar » Post

Wuzzy wrote:Does this work for MCL2?
There's a PR pending for full MCL2 support, but it needs rework. If that's merged, it would fully support it.

xeno
New member
Posts: 8
Joined: Mon Feb 25, 2019 11:59
In-game: xeno

Re: Convert Minecraft maps to Minetest worlds

by xeno » Post

i just downloaded the mc to mt map converter
viewtopic.php?t=13709
but when i launch it, it tells me "unable to locate map_content.txt fille, this is a critical error, and this program is unable to continue"
im am using linux
it commes as a terminal program and it has no graphic interface
do i have to put the mc folder in mcimport's folder or something ?

Also can anyone make a video tutorial for it pls ?
6qJF0AfOu745Hwbz4uWr9TEmyDB0BQ73

mini
Member
Posts: 79
Joined: Tue Jul 05, 2016 11:28
GitHub: niansa
IRC: nisa oder tuxifan
In-game: nisa oder tuxifan
Location: Deutschland

Re: Convert Minecraft maps to Minetest worlds

by mini » Post

Does not seem to work for MC 1.14.4 worlds:

Code: Select all

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

talamh
Member
Posts: 156
Joined: Sun Nov 12, 2017 18:24

Re: Convert Minecraft maps to Minetest worlds

by talamh » Post

mini wrote:
Fri May 22, 2020 16:48
Does not seem to work for MC 1.14.4 worlds:
Interesting, MC 1.14.4 is storing biome data in 256 long integers instead of the 256 integers that would be expected in maps from that period, that's possibly the cause of the issue. I'd not seen this documented anywhere so it seems you may be the first to notice that that client had a uniqueness. I have mentioned it on https://minecraft.gamepedia.com/Talk:Ja ... ion_1.14.4

*Edit posted link to where I mentioned it on gamepedia. I'm surprised those folks didn't have that info documented.

Starbeamrainbowlabs
Member
Posts: 66
Joined: Sat May 26, 2018 11:25
GitHub: sbrl
Location: Nowhere, Everywhere, and Somewhere inbetween
Contact:

Re: Convert Minecraft maps to Minetest worlds

by Starbeamrainbowlabs » Post

Currently I'm aware of these 2 minecraft → minetest importers:

- https://github.com/minetest-tools/mcimport/
- https://github.com/jonajames/mc2mt

Neither of them seem to particularly fast or stable. mcimport does appear to be able to convert some worlds, but appears to crash on others. mc2mt crashed on a few worlds, but I found one that it would work with - I haven't been able to evaluate it's performance yet though because it's so slow the conversion is still running.

I wonder if mcimport's existing algorithm could be ported easily to use a more solid / stable minecraft world parser. If anyone knows of a really solid & stable one that's well maintained and supports as many different MC versions as possible, then I might be able to write something multithreaded perhaps. C# is preferred, followed by Rust, C++, then Javascript (I love JS, but it's not suited to multithreaded).

I don't know anything about the minetest format, but I can imagine that it must be documented somewhere - I'll go and look that up if I actually end up actually writing anything.

(note: I don't own a copy of Minecraft, so if I were to write anything I'd have to source the minecraft worlds for conversion elsewhere)

talamh
Member
Posts: 156
Joined: Sun Nov 12, 2017 18:24

Re: Convert Minecraft maps to Minetest worlds

by talamh » Post

Starbeamrainbowlabs wrote:
Tue Jun 16, 2020 23:38
Currently I'm aware of these 2 minecraft → minetest importers:

- https://github.com/minetest-tools/mcimport/
- https://github.com/jonajames/mc2mt

Neither of them seem to particularly fast or stable. mcimport does appear to be able to convert some worlds, but appears to crash on others. mc2mt crashed on a few worlds, but I found one that it would work with - I haven't been able to evaluate it's performance yet though because it's so slow the conversion is still running.

I wonder if mcimport's existing algorithm could be ported easily to use a more solid / stable minecraft world parser. If anyone knows of a really solid & stable one that's well maintained and supports as many different MC versions as possible, then I might be able to write something multithreaded perhaps. C# is preferred, followed by Rust, C++, then Javascript (I love JS, but it's not suited to multithreaded).

I don't know anything about the minetest format, but I can imagine that it must be documented somewhere - I'll go and look that up if I actually end up actually writing anything.

(note: I don't own a copy of Minecraft, so if I were to write anything I'd have to source the minecraft worlds for conversion elsewhere)
Mcimport crashes when the minecraft map contains chunks that are in a format that it does not support. An individual minecraft map can contain chunks that are in several different formats so you never can tell if conversion will succeed until you try. Unless it is a very recent map in which case it certainly wont be able to convert successfully.

Yes mcimport could be ported but you would still have that issue, and others issues that will result in slow and incomplete conversions. These issues could of course be addressed during the porting process so are no reason not to make a port.

I am working on map converter that is nearly ready for release (another week or two) that is written in Java and it will be multithreaded, conversion times are already faster that mcimport when running on a single thread. I'm working on adding greater map compatibility at the moment, starting with older maps and working my way towards the most recent map format.

If you do intend to do a port, I would recommend getting a copy of minecraft, being able to manipulate the input so you can check your output is a huge plus.

Starbeamrainbowlabs
Member
Posts: 66
Joined: Sat May 26, 2018 11:25
GitHub: sbrl
Location: Nowhere, Everywhere, and Somewhere inbetween
Contact:

Re: Convert Minecraft maps to Minetest worlds

by Starbeamrainbowlabs » Post

Ah, I see. It sounds like it's really about finding a mature library that can parse as many different minecraft world versions as possible.

Oh, cool! Java isn't my favourite language, but it's probably worth waiting to check your port out first before writing my own (if you open source it when you're done and I can build it from source, I might be able to contribute a little bit - eg. a Docker container, since I have a Raspberry Pi cluster using the Hashicorp stack, and a Docker container would make it easy for my to queue conversions on said cluster).

Ah, right. It's sorta the principle of the thing though - the whole reason I'm using Minetest it because a) the Lua modding API and b) it's open-source - but I do see how that would be very valuable.

talamh
Member
Posts: 156
Joined: Sun Nov 12, 2017 18:24

Re: Convert Minecraft maps to Minetest worlds

by talamh » Post

Starbeamrainbowlabs wrote:
Wed Jun 17, 2020 17:33
Ah, I see. It sounds like it's really about finding a mature library that can parse as many different minecraft world versions as possible.

Oh, cool! Java isn't my favourite language, but it's probably worth waiting to check your port out first before writing my own (if you open source it when you're done and I can build it from source, I might be able to contribute a little bit - eg. a Docker container, since I have a Raspberry Pi cluster using the Hashicorp stack, and a Docker container would make it easy for my to queue conversions on said cluster).

Ah, right. It's sorta the principle of the thing though - the whole reason I'm using Minetest it because a) the Lua modding API and b) it's open-source - but I do see how that would be very valuable.
It will be open source. Building should not be an issue.

Minor issue might be that I'm using libgdx to make a gameified UI and that might not be suitable for your needs but I'm using it as simplicity of use for the average desktop user is one of my top goals. Only 2 classes actually use libgdx and both of those classes are separate from the conversion process, so making a CLI version and/or porting to C# should be trivial.

Starbeamrainbowlabs
Member
Posts: 66
Joined: Sat May 26, 2018 11:25
GitHub: sbrl
Location: Nowhere, Everywhere, and Somewhere inbetween
Contact:

Re: Convert Minecraft maps to Minetest worlds

by Starbeamrainbowlabs » Post

talamh wrote:
Wed Jun 17, 2020 19:14
It will be open source. Building should not be an issue.

Minor issue might be that I'm using libgdx to make a gameified UI and that might not be suitable for your needs but I'm using it as simplicity of use for the average desktop user is one of my top goals. Only 2 classes actually use libgdx and both of those classes are separate from the conversion process, so making a CLI version and/or porting to C# should be trivial.
Nice!

Ah, I see. A gamified UI sounds awesome!

Hrm, I'm hesitant to port it to C♯ because then I'd loose automatic integration of any work you do on it - so I think the most effective course of action will be to contribute via PRs to your project :D

I've done Java for Android before, so it'll be a new experience for me doing Java on the desktop.

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: Convert Minecraft maps to Minetest worlds

by sofar » Post

I appreciate the attention to keeping a solution going to solve this maintenance problem. Please do make a *new* forum thread for your specific application so that the discussion can be focused and on topic.

talamh
Member
Posts: 156
Joined: Sun Nov 12, 2017 18:24

Re: Convert Minecraft maps to Minetest worlds

by talamh » Post

sofar wrote:
Fri Jun 19, 2020 18:10
I appreciate the attention to keeping a solution going to solve this maintenance problem. Please do make a *new* forum thread for your specific application so that the discussion can be focused and on topic.
I agree, I have gone off topic for this thread. I could just run mcimport in Jython using my UI and be back on topic again :) Joking aside there does seem to have been an uptick of late in people showing an interest in map conversion, so maybe a thread discussing goals and potential pitfalls in the process of writing a converter might be an idea. Anyone interested in such a thread let me know and I'll start one.

Edit: Going to start one regardless of interest!

Jannusch
New member
Posts: 2
Joined: Wed Jul 15, 2020 13:55

Re: Convert Minecraft maps to Minetest worlds

by Jannusch » Post

mini wrote:
Fri May 22, 2020 16:48
Does not seem to work for MC 1.14.4 worlds:

Code: Select all

Traceback (most recent call last):??:?? h:m:s
  File "./mcimport.py", line 107, in <module>
    mtmap.save()
  File "/home/nils/Programme/OSS/mcimport/block.py", line 455, in save
    for block in self.blocks:
  File "/home/nils/Programme/OSS/mcimport/block.py", line 439, in fromMCMapBlocksIterator
    for mcblock in mcmap.getBlocksIterator():
  File "/home/nils/Programme/OSS/mcimport/block.py", line 62, in getBlocksIterator
    blocks = self.getChunk(chkx, chkz).blocks
  File "/home/nils/Programme/OSS/mcimport/block.py", line 45, in getChunk
    return MCChunk(chkx, chkz, self.world_path, self.ext)
  File "/home/nils/Programme/OSS/mcimport/block.py", line 91, in __init__
    self.blocks.append(MCBlock(raw_data, (chkx, chkz), section["Y"], True))
  File "/home/nils/Programme/OSS/mcimport/block.py", line 108, in __init__
    self.from_section(section)
  File "/home/nils/Programme/OSS/mcimport/block.py", line 174, in from_section
    self.blocks = self.reverse_X_axis(section["Blocks"])
KeyError: 'Blocks'
Hi,
is there a fix for this? Maybe I would take care of the problem. Does anyone have more detailed information, or do you know that it is a very big problem and a big rewrite is required?

Jannusch
New member
Posts: 2
Joined: Wed Jul 15, 2020 13:55

Re: Convert Minecraft maps to Minetest worlds

by Jannusch » Post

mini wrote:
Fri May 22, 2020 16:48
Does not seem to work for MC 1.14.4 worlds:

Code: Select all

Traceback (most recent call last):??:?? h:m:s
  File "./mcimport.py", line 107, in <module>
    mtmap.save()
  File "/home/nils/Programme/OSS/mcimport/block.py", line 455, in save
    for block in self.blocks:
  File "/home/nils/Programme/OSS/mcimport/block.py", line 439, in fromMCMapBlocksIterator
    for mcblock in mcmap.getBlocksIterator():
  File "/home/nils/Programme/OSS/mcimport/block.py", line 62, in getBlocksIterator
    blocks = self.getChunk(chkx, chkz).blocks
  File "/home/nils/Programme/OSS/mcimport/block.py", line 45, in getChunk
    return MCChunk(chkx, chkz, self.world_path, self.ext)
  File "/home/nils/Programme/OSS/mcimport/block.py", line 91, in __init__
    self.blocks.append(MCBlock(raw_data, (chkx, chkz), section["Y"], True))
  File "/home/nils/Programme/OSS/mcimport/block.py", line 108, in __init__
    self.from_section(section)
  File "/home/nils/Programme/OSS/mcimport/block.py", line 174, in from_section
    self.blocks = self.reverse_X_axis(section["Blocks"])
KeyError: 'Blocks'
Hi,
is there a fix for this? Maybe I would take care of the problem. Does anyone have more detailed information, or do you know that it is a very big problem and a big rewrite is required?

talamh
Member
Posts: 156
Joined: Sun Nov 12, 2017 18:24

Re: Convert Minecraft maps to Minetest worlds

by talamh » Post

This wont help convert 0.14.4 using mcimport but a top tip is to install pypy3 and change line 37 of mcimport.sh to

Code: Select all

pypy3 mcimport.py "$IN" "${HOME}/.minetest/worlds/$OUT"
This can result in mcimport converting maps 4 or 5 times faster.

User avatar
Sharpik
Member
Posts: 28
Joined: Tue Feb 04, 2020 21:27
GitHub: Sharpik
Location: Prague, Czech Republic

Re: Convert Minecraft maps to Minetest worlds

by Sharpik » Post

Hi everyone, I'd like to ask if someone tryed to convert MC world with moded blocks to Minetest. I tryed to convert blocks from my own MC mod to MT, but when I added new lines to map_content.txt Example: 3122 2 streets:asphalt
But in the converted world this blocks are converted to torches instead streets:asphalt blocks.

I'm not abe to run mcimport.sh with GUI because I'm using windows 10. So I started conversion with this param: python mcimport.py "worlds/Minecraft/convertw" "worlds/Minetest/convertw"

World is succesfully converted to MT, but blocks that I added to map_content.txt aren't coverted as it was defined. Some of them are hardened clay and some of them are torches etc..
Any idea how to force convertor to do what i set in map_content.txt?

Thanks for answers

User avatar
aracnus
Member
Posts: 70
Joined: Wed May 15, 2013 01:09
GitHub: aracnus
IRC: aracnus
In-game: aracnus
Location: Belo Horizonte - MG - Brazil
Contact:

Re: Convert Minecraft maps to Minetest worlds

by aracnus » Post

First, thank you very much for this tool, sofar. It did an amazing job with an old Minecraft world I have. Until now I saw only two glitches: it doesn't import pumpkin lantern (could it be substituted by any other light source on Minetest world?) and convert all blocks in a water flow as water source. For example, if you, in Minecraft, build a waterfall with only top blocks as water sources, mcimport converts all other blocks of waterfall as water sources too (you may imagine the flood mess). But these are problems that I can handle manually. :-)

And I would ask what would happen if mapgen is activated? It will alter the original world structures? I would love to continue playing this world in Minetest, with new chunks generation. And how could I turn on mapgen?

WanSko
New member
Posts: 4
Joined: Wed Dec 02, 2020 21:30
GitHub: wansko
IRC: wansko
In-game: Lucifer

Re: Convert Minecraft maps to Minetest worlds

by WanSko » Post

Dang its so weird. Minecraft maps look better in Minetest than Minecraft XD! There's something inherently tempting about rolling the dice in the new world of Minecraft and just seeing what you get. In most cases, this random result is large. It's exciting to step out into a huge, clean, completely unknown world. Other times, you might have a certain type of adventure on your mind, or maybe you want to see a world that recreates the seed of the Minecraft title screen here. This is where the Minecraft seeds appear.

AISS
New member
Posts: 3
Joined: Tue Feb 16, 2021 01:22

Re: Convert Minecraft maps to Minetest worlds

by AISS » Post

1
Last edited by AISS on Fri Feb 26, 2021 03:43, edited 1 time in total.

AISS
New member
Posts: 3
Joined: Tue Feb 16, 2021 01:22

Re: Convert Minecraft maps to Minetest worlds

by AISS » Post

error Convert
system: Manjaro Win10
versions: Minecraft Java 1.12.2
map: https://www.planetminecraft.com/project ... e-download
Image
cdb_gOrAqcGIwPCF

ZAAo
Member
Posts: 47
Joined: Tue Jul 27, 2021 16:15

Re: Convert Minecraft maps to Minetest worlds

by ZAAo » Post

Hi sofar, do you think it would be possible to convert a Minecraft mcfunction minigame to Minetest?

I found this Cluedo minigame for Minecraft and it looks really great... hoping there is a way to "port" it to Minetest, without having to recreate it from scratch:

https://github.com/Fietje/Clueblo

https://www.youtube.com/watch?v=XM1lAUJjDo4

User avatar
Eris
Member
Posts: 175
Joined: Thu Nov 19, 2020 23:12
IRC: definitelya Ovalo
In-game: Eris_still_crafts

Re: Convert Minecraft maps to Minetest worlds

by Eris » Post

I love it when I can use the popularity of minecraft to convert it's maps onto our engine. This mod is badass, congrats sofar and contributors!
Jump in the caac

bzt
Member
Posts: 217
Joined: Tue Sep 24, 2019 14:26

Re: Convert Minecraft maps to Minetest worlds

by bzt » Post

Starbeamrainbowlabs wrote:
Tue Jun 16, 2020 23:38
Currently I'm aware of these 2 minecraft → minetest importers:

- https://github.com/minetest-tools/mcimport/
- https://github.com/jonajames/mc2mt
Add
- Handle Schematics and
- MTSEdit
to that list. MC stores the world data in NBT format, both can handle that, but there are drawbacks though. (The MC world is basically a set of schematics stored in the same file format, but with additional data (called "region" files). There are three variants based what that additional info might be, and these are slightly incompatible: Anvil, Classic and Bedrock. Concerning world data in those region files, there are two NBT variants: the older one is limited to 256 kind of blocks, while the newer one uses varint encoding and a block-type palette.)

Handle Schematics is a Lua mod, so you can import NBT files directly into your MT world. The downside is, sadly Handle Schematics can only read the older world NBT format (limited to 256), but not the newer one (with palette).

On the other hand, MTSEdit supports both NBT formats, but it is limited to 256x256x256 volumes, so you can't import entire worlds with it as-is, you need to save that into multiple files (however MC POIs most of the time fits into that volume, so shouldn't be a real issue). MTSEdit converts NBT into MTS format, which then can be imported into an MT world with a mod of your choosing (World Edit, Schematic Editor, Handle Schematics, etc. and even MTSEdit provides a minimalistic .mts loader mod).

Cheers,
bzt

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests