Page 3 of 6

Re: Convert Minecraft maps to Minetest worlds

Posted: Wed May 04, 2016 14:09
by sofar
theHalfBloodStanger wrote:Just an idea, but couldn't it be convenient to convert the programming into c++/c? It would be much faster.
Just an idea from an inexperienced programmer.
yes, and that's what likely will happen - people have already written c++ converters and we'll likely port all the code changes over.

Re: Convert Minecraft maps to Minetest worlds

Posted: Tue Dec 27, 2016 03:29
by MinisterFarrigut
Dang its so weird. Minecraft maps look better in Minetest than Minecraft XD!!!

Re: Convert Minecraft maps to Minetest worlds

Posted: Thu Jan 26, 2017 17:44
by Schmeldric
Hi!

I'm facing a "small" issue with this converter (great thanks for the work by the way).
I seems to me that what is called "north" in Minecraft (Z negative) becomes south in Minetest (which is logic since Minetest choosed Z positive for north).

Who bothers will you ask?
Well, I'm working with my students on a model of our town. We did parts of the town using the north as choosen in Minetest. But the whole town is a huge task.
So I found some help in using a service provided by IGN (french cartographers) who will provide a Minecraft version of a real France area. Great! So I got that map, converted it in Minetest, and... and if I do worldedit copy/paste the buildings are facing the wrong direction.

I know worldedit has the rotate option. That could be a solution, but my 13 years old student will have to learn to use it correctly.
I tried to edit the "block.py" file in order to have the conversion put north the right side. For now
- I know how to put the 16x16x16 blocks at the good place;
- but inside these blocks I have to also do a symetry : x = 15-x and z=15-z

For this problem, I tried to change line 231 " x, y, z = te["x"], te["y"], te["z"] " to " x, y, z = 15-te["x"], te["y"], 15-te["z"] " but failed.
Seems the blocks aren't taken one by one but converted as massive data.
I think the solution is in the "def extract_slice(data, yslice):" (line 150). During the conversion I'll have to cover X and Z the other way around.
The method's comment says "# Beware: impossible to understand code" so I'm now trying to figure out how it's working, but if one of you already solved that, it would really help me...

OR : there is a reverse_X_axis method called. Would replacing it by a reverse_Z_axis work?

Re: Convert Minecraft maps to Minetest worlds

Posted: Thu Jan 26, 2017 22:54
by sofar
Schmeldric wrote: So I found some help in using a service provided by IGN (french cartographers) who will provide a Minecraft version of a real France area. Great! So I got that map, converted it in Minetest, and... and if I do worldedit copy/paste the buildings are facing the wrong direction.
Yup, have been breaking my head over it as well. I've been unable to solve it myself. I'm hoping we can make the C++ converter not make this mistake and push the content detail to that, since I doubt we'll maintain the python version - it is just so much slower.

Re: Convert Minecraft maps to Minetest worlds

Posted: Fri Jan 27, 2017 06:43
by Nore
Hi, I'm the author of that "impossible to understand code" :).
Line 231 you're talking about is used for tile entities, which are not the bulk node data, so changing it is needed, but won't change much.
The solution is indeed in extract_slice; the idea of the code in it is just to reverse the order of the axes. For that, we process the positions in the order we want them in the output, and we compute the input positions that correspond to it by increasing with the xstride each time.

Re: Convert Minecraft maps to Minetest worlds

Posted: Tue Feb 14, 2017 07:48
by Schmeldric
Hourray!

After spending many night hours I think I got it the right way around...

My first try was to change the "extract_slice" and "extract_slice_half_bytes" functions to read the nodes the other way around.Althought I think I understood the code, my maths didn't word :'(
Nota :
MC uses "blocks" as voxels in a 16x16x128 chunk
MT uses "nodes" as voxels in 16x16x16 blocks...


So I tried another way.

> In MTMap.save : changed

Code: Select all

(self.getBlockAsInteger((block.pos[0],block.pos[1],block.pos[2])),
to

Code: Select all

(self.getBlockAsInteger((-block.pos[0],block.pos[1],-block.pos[2])),
in order to get a first rotation. This puts the MT blocks at their right place, but didn't rotate their content.

> Instead of reversing X axis (MC and MT uses left/right "trièdre" - sorry, didn't find the english for that) , I reversed Z axis
In MCBlock.reverse_X_axis and MCBlock.expand_half_bytes (yeah, data on u12 ... so easy...) I changed the order data was read, reversing Z instead of X.
By the way : I think this code could be optimised but I'm not used enought to Python

Code: Select all

        l2 = l[locSt:locSt+16]
        for i in l2:
            l3.append(i)
So... Do you want my file?

Re: Convert Minecraft maps to Minetest worlds

Posted: Tue Feb 14, 2017 21:02
by sofar
Schmeldric wrote:Hourray!

After spending many night hours I think I got it the right way around...

My first try was to change the "extract_slice" and "extract_slice_half_bytes" functions to read the nodes the other way around.Althought I think I understood the code, my maths didn't word :'(
Nota :
MC uses "blocks" as voxels in a 16x16x128 chunk
MT uses "nodes" as voxels in 16x16x16 blocks...


So I tried another way.

> In MTMap.save : changed

Code: Select all

(self.getBlockAsInteger((block.pos[0],block.pos[1],block.pos[2])),
to

Code: Select all

(self.getBlockAsInteger((-block.pos[0],block.pos[1],-block.pos[2])),
in order to get a first rotation. This puts the MT blocks at their right place, but didn't rotate their content.

> Instead of reversing X axis (MC and MT uses left/right "trièdre" - sorry, didn't find the english for that) , I reversed Z axis
In MCBlock.reverse_X_axis and MCBlock.expand_half_bytes (yeah, data on u12 ... so easy...) I changed the order data was read, reversing Z instead of X.
By the way : I think this code could be optimised but I'm not used enought to Python

Code: Select all

        l2 = l[locSt:locSt+16]
        for i in l2:
            l3.append(i)
So... Do you want my file?
I'll take it - can you make a PR? If not, throw the file on gist.github.com and post the URL.

Re: Convert Minecraft maps to Minetest worlds

Posted: Tue Feb 14, 2017 23:24
by Schmeldric
Euh... What's a PR ? Personal Release on Github?

Re: Convert Minecraft maps to Minetest worlds

Posted: Wed Feb 15, 2017 12:16
by Schmeldric

Re: Convert Minecraft maps to Minetest worlds

Posted: Wed Feb 15, 2017 19:14
by sofar
Schmeldric wrote:Is this correctly done?
https://gist.github.com/anonymous/450c3 ... teadofx-py
well, it works, but it does remove all the custom door/water code I added... Did you do that on purpose or did you just edit an older version?

There's some great git how-to documents how this git/github stuff all works.

Re: Convert Minecraft maps to Minetest worlds

Posted: Wed Feb 15, 2017 23:05
by Schmeldric
Thought I used the latest release, my bad.
I'll modify a more recent version, sorry.

Re: Convert Minecraft maps to Minetest worlds

Posted: Wed Feb 22, 2017 18:40
by Schmeldric
So... On GitHub I forked from your source code.
I uploaded the block.py file.
I asked for a "pull request"

Was it correctly done?

Re: Convert Minecraft maps to Minetest worlds

Posted: Wed Feb 22, 2017 19:25
by sofar
Schmeldric wrote:So... On GitHub I forked from your source code.
I uploaded the block.py file.
I asked for a "pull request"

Was it correctly done?
yup! Will review but looks good so far!

Re: Convert Minecraft maps to Minetest worlds

Posted: Thu Feb 23, 2017 07:08
by sofar
I upgraded the conversion test map I have to 1.11 and redid a ton of stuff, including node rotations and flowerpots (using my own flowerpot mod now! no more homedecor!) Fixed tile entites (signs!) while we're at it, although some are still not converting well (maybe I need to re-place them first).

Re: Convert Minecraft maps to Minetest worlds

Posted: Fri Apr 14, 2017 22:54
by GreenXenith
I converted Parkour Paradise 3 (for the cliffs and water, not the parkour) and it worked very well! Just to note, the installer tried and failed to install it's necessary mods. I think it couldn't find them or something. Luckily, I had most of them anyway. I used the terminal on Xubuntu 16.04. Also, the vines on this map weren't all rotated correctly, but I didn't care because I wanted it all vanilla so I used WE and replaced them with bush leaves :D Very good work sir!

Re: Convert Minecraft maps to Minetest worlds

Posted: Sun Apr 30, 2017 19:47
by nightengale
Sorry for this really dumb question, but I should just be able to run:

python mcimport.py [path to the level.dat]

And that will start the conversion process, or no?

-------------EDIT----------------------

Dumb question asked by linux noob, ran the wrapper instead, we'll see how it turns out. = )

Re: Convert Minecraft maps to Minetest worlds

Posted: Mon May 01, 2017 01:57
by sofar
nightengale wrote:Sorry for this really dumb question, but I should just be able to run:

python mcimport.py [path to the level.dat]

And that will start the conversion process, or no?

-------------EDIT----------------------

Dumb question asked by linux noob, ran the wrapper instead, we'll see how it turns out. = )
The wrapper uses zenity which makes it easier to use, since it makes a simple gui around the python parts, but yes, you can also just run it manually (with the right options).

Re: Convert Minecraft maps to Minetest worlds

Posted: Sat May 06, 2017 21:19
by PEAK
Hello sofar!

Recently I tortured my computer with converting many Minecraft maps.
The results are really amazing. Thank you!


Some suggestions for improvement:


map_content.txt

Code: Select all

22	lapis:lapis
should be

Code: Select all

22	lapis:lapisblock
there's no lapis:lapis

Code: Select all

98 3	moreblocks:circle_stone_bricks
I would prefer:

Code: Select all

98 3	xdecor:stone_rune

addition:

Code: Select all

116	xdecor:enchantment_table

Code: Select all

139 1	default:mossycobble			// FIXME: you may not want this
139	default:cobble				// FIXME: you may not want this
fixed:

Code: Select all

139 1	walls:mossycobble
139	walls:cobble

Code: Select all

168 0	prismarine:prismarine
168 1	prismarine:prismarine_brick
168 2	prismarine:prismarine_dark
169	prismarine:sea_lantern
It's a pity that these blocks get lost.
I made a mod for this, but I'm unsure about the license for the textures, so I don't publish it.
(I took the textures from http://hydra-media.cursecdn.com/minecra ... ockCSS.png at http://minecraft.gamepedia.com/Minecraft_Wiki)


stone and wooden buttons (77 and 143)
Often they are used just for decoration -- so perhaps an extra buttons mod?


other:

  • doors need fix: unknown blocks because Minetest newly handles them differently.
  • inner and outer corners of stairs would be fine.

Some tips for users:

The player is not everytime spawned at the right location! Some maps contain random chunks far away from the main content, so they seem to consist only of that: use a mapper to find the area of the main content.

The lighting seems to get better corrected when flying above the dark regions in the sky while the adjacent parts of the map under them are generated. For the rest use mapfix.

In some cases antifire is useful.

Re: Convert Minecraft maps to Minetest worlds

Posted: Sun May 07, 2017 07:30
by sofar
PEAK wrote:Some suggestions for improvement:
thanks, I pulled most of this in.
PEAK wrote:It's a pity that these <prismarine> blocks get lost.
Try and find a texture pack that is Public Domain or CC-BY and has their own versions for these blocks, then you can use that in your mod!

Re: Convert Minecraft maps to Minetest worlds

Posted: Sun May 07, 2017 12:50
by PEAK
sofar wrote:
PEAK wrote:Some suggestions for improvement:
thanks, I pulled most of this in.
"Several fixes for the map content, lose moreblocks."

That's fine!
sofar wrote:
PEAK wrote:It's a pity that these <prismarine> blocks get lost.
Try and find a texture pack that is Public Domain or CC-BY and has their own versions for these blocks, then you can use that in your mod!
I will work on that.

Re: Convert Minecraft maps to Minetest worlds

Posted: Thu May 11, 2017 16:52
by PEAK
Here is the prismarine mod. I used the textures from Faithful 1.11 as Wuzzy does for his Mineclone2.
(I would rather prefer 16x16 textures, but that is what I found...)

Image

License

Textures: Faithful 1.11 by Vattic, xMrVizzy and many others (MIT License)
Code: by PEAK WTFPL (it's not really worth to have a license)

Usage

This mod is only intended as supplement for sofar's converter script.
So the blocks are just decorative, no crafting recipes, and the "Prismarine" is not animated.

depends: default

Put the "prismarine" folder into the "worldmods" folder of the converted map.

Test it e.g. with Pirimidin ! Apartement For People !.

map_content.txt

Code: Select all

168 0	prismarine:prismarine
168 1	prismarine:prismarine_brick
168 2	prismarine:prismarine_dark
169	prismarine:sea_lantern
*****

Minetest can have nice emeralds too: oresplus by jp.
With that you can do:

map_content.txt

Code: Select all

129	oresplus:stone_with_emerald
and

Code: Select all

133	oresplus:emerald_block

Re: Convert Minecraft maps to Minetest worlds

Posted: Tue Sep 05, 2017 13:23
by Bookkc
Can this work on windows ?? or only for linux???

Re: Convert Minecraft maps to Minetest worlds

Posted: Tue Sep 05, 2017 15:50
by sofar
Bookkc wrote:Can this work on windows ?? or only for linux???
It's possible that it works under Windows, but nobody has tried or tested it. The script is fairly complex and you'd have to setup a lot of tools to make it work under windows, so it's not really worth anyone's time TBH.

Re: Convert Minecraft maps to Minetest worlds

Posted: Wed Sep 06, 2017 05:37
by Bookkc
sofar wrote:
Bookkc wrote:Can this work on windows ?? or only for linux???
It's possible that it works under Windows, but nobody has tried or tested it. The script is fairly complex and you'd have to setup a lot of tools to make it work under windows, so it's not really worth anyone's time TBH.

So i need a linux and python ? what librarys me need ?? And if i need a Xserver???

Re: Convert Minecraft maps to Minetest worlds

Posted: Wed Sep 06, 2017 17:34
by sofar
Bookkc wrote:So i need a linux and python ? what librarys me need ?? And if i need a Xserver???
It's documented in the post: python3 and Zenity. You can run the conversion without zenity if you know what you are doing.