Page 2 of 3

Re: Convert Minecraft Maps to Minetest WE Schematics

PostPosted: Mon May 05, 2014 22:21
by twoelk
davi54l wrote:and what makes this dropbox link?


If the question is how to make this work read the first post:

first post wrote:Download: https://dl.dropboxusercontent.com/u/302 ... weschem.py (Right click then click “Save link as...”)
Put this in MCEdit-folder/filters


where "tomtweschem.py" is a script written in Python
where "MCEdit" is a Program that can read Minecraft worlds/maps
where ".../filters.." is a folder in the MCEdit installation

If the question is what the output file is:

The generated file is in the "*.we" format,
where "*.we" is a Minetest schematic file(ascii) that WorldEdit can import into an existing Minetest world/map

Re: Convert Minecraft maps to Minetest WorldEdit schematics

PostPosted: Wed May 21, 2014 15:29
by davi54l
Good idea. Now i can play on Hogwarts map.

Re: Convert Minecraft maps to Minetest WorldEdit schematics

PostPosted: Fri May 23, 2014 19:18
by davi54l
How to set position 1?

Re: Convert Minecraft maps to Minetest WorldEdit schematics

PostPosted: Fri May 23, 2014 19:53
by sfan5
davi54l wrote:How to set position 1?


https://github.com/Uberi/Minetest-World ... ds.md#pos1

Re: Convert Minecraft maps to Minetest WorldEdit schematics

PostPosted: Sat May 24, 2014 17:29
by davi54l
I typed / / pos1 and the block appeared after / brand / load Quidditch and did not show anything

Re: Convert Minecraft maps to Minetest WorldEdit schematics

PostPosted: Tue Jul 15, 2014 07:55
by sfan5
A beta version of this filter that creates .mts schematics (faster to import) is now available: https://dl.dropboxusercontent.com/u/302 ... tsschem.py

Re: Convert Minecraft maps to Minetest WorldEdit schematics

PostPosted: Fri Jul 18, 2014 02:00
by Sokomine
sfan5 wrote:An beta version of this filter that creates .mts schematics (faster to import) is now available: https://dl.dropboxusercontent.com/u/302 ... tsschem.py

Probably also a way to import Minecraft classic maps faster. Just converting them to an .mts file sounds like a good approach. There'll be no trouble with facedir either (Classic has none).

Re:

PostPosted: Tue Aug 26, 2014 15:26
by shaheerziya
Evergreen wrote:
Hybrid Dog wrote:great, but mlnecraft doesn't work for me

You don't need minecraft. You only need a world file, MCedit, his filter, and minetest.

It doesnot for me too

Re: Re:

PostPosted: Tue Aug 26, 2014 15:47
by Evergreen
shaheerziya wrote:
Evergreen wrote:
Hybrid Dog wrote:great, but mlnecraft doesn't work for me

You don't need minecraft. You only need a world file, MCedit, his filter, and minetest.

It doesnot for me too

Like I said, you do not need minecraft. All you need is MCedit and a world file. Also, saying "It doesn't work" is not enough information for us to help you.

Re: Convert Minecraft maps to Minetest WorldEdit schematics

PostPosted: Sun Oct 05, 2014 01:22
by Michael Eh?
having fun just trying to get MCEdit to run... winows version... just pops up then closes. :(

Re: Convert Minecraft maps to Minetest WorldEdit schematics

PostPosted: Sat Oct 11, 2014 18:41
by Michael Eh?
okay, we got MCEdit to work... but the .mts files come up with "unable to load" error. :(

Re: Convert Minecraft maps to Minetest WorldEdit schematics

PostPosted: Sun Oct 12, 2014 15:44
by sfan5
What does it say in debug.txt?

Re: Convert Minecraft maps to Minetest WorldEdit schematics

PostPosted: Tue Oct 14, 2014 00:10
by Michael Eh?
sfan5 wrote:What does it say in debug.txt?


20:07:20: ERROR[ServerThread]: core.deserialize(): ...inetest\minetest-0.4\bin\..\builtin\common\serialize.lua:181: [string "return MTSM"]:1: '<eof>' expected
20:07:20: ERROR[ServerThread]: core.deserialize(): ...inetest\minetest-0.4\bin\..\builtin\common\serialize.lua:181: [string "return MTSM"]:1: '<eof>' expected

running minetest 0.4.10
I had the directory as schema than schems but i changed it.

Re: Convert Minecraft maps to Minetest WorldEdit schematics

PostPosted: Tue Oct 14, 2014 12:03
by sfan5
You have to use //mtschemplace instead of //load to load .mts files.

Re: Convert Minecraft maps to Minetest WorldEdit schematics

PostPosted: Wed Oct 15, 2014 00:26
by Michael Eh?
tried it ... several times. just sits there then the 1 marker disappears. Nothing in debug txt.

I'm just going to wing it a build Big Sight myself.

Re: Convert Minecraft maps to Minetest WorldEdit schematics

PostPosted: Fri Jan 09, 2015 01:37
by themtsurvivor
I am getting some weird things with tomsweschem.py script in mcedit 1.7.1 and 1.8
screenshot_9951686.png
steel door owned by vanessa
screenshot_9951686.png (291.7 KiB) Viewed 7044 times

a steel door that says it is owned by vanessa??
....
I have found a fix for this error in the .we files..
using notepad++ just search and replace
{ ["fields"] = { ["infotext"] = "Owned by VanessaEzekowitz", ["doors_owner"] = "VanessaEzekowitz" }
with { ["fields"] = { }
and
doors:door_steel_b_1
doors:door_steel_t_1
with doors:door_steel
in the files in your schems directory.
any ideas?

Re: Convert Minecraft maps to Minetest WorldEdit schematics

PostPosted: Fri Jan 09, 2015 18:36
by sfan5
themtsurvivor wrote:I am getting some weird things with tomsweschem.py script in mcedit 1.7.1 and 1.8
screenshot_9951686.png

a steel door that says it is owned by vanessa??
....
I have found a fix for this error in the .we files..
using notepad++ just search and replace
{ ["fields"] = { ["infotext"] = "Owned by VanessaEzekowitz", ["doors_owner"] = "VanessaEzekowitz" }
with { ["fields"] = { }
and
doors:door_steel_b_1
doors:door_steel_t_1
with doors:door_steel
in the files in your schems directory.
any ideas?

The tomtweschem.py script does not even use the Lua format of WorldEdit files.
(It uses one of the older format which does not support the metadata that is used for door ownership)
This is not a bug in this script.

Re: Convert Minecraft maps to Minetest WorldEdit schematics

PostPosted: Tue Jan 13, 2015 15:02
by themtsurvivor
Thanks sfan5 for your input, but I still get owned doors.
here is an example of what testing I have done;

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
filter a steel door from a 1.8 (theothermine) map using MCEdit_dev-0.1.8build799.win32
=that will create a .we file with default:door_steel_t_1   or _b_1   * 2 pieces y aligned
using minetest 4.11 with mods mesecons,homedecor.stairsplus,worldedit
commands;   
   //pos1
   //load steeldoortest
now with this door just created you cannot break it, it is owned

Re: Convert Minecraft maps to Minetest WorldEdit schematics

PostPosted: Sun Feb 01, 2015 07:55
by dgm5555
Someone mentioned a progress bar. This does happen, but is only visible from the terminal the script is run from.
If there's any way of feeding back about the beta script can I suggest adding the following around line 260 (after the output)
print("Nodes will be packed then saved to file")
-- print("Saving file at: %s/%s.mts" % (os.getcwd(), options["Output filename"]))
print("Packing %d nodes", size[0] * size[1] * size[2])

and change
sys.stdout.write(
"\r%0.2f%% done, %d nodes / sec, ETA: %d sec(s) "
to
"\r%0.2f%% packed, %d nodes / sec, ETA: %d sec(s) "

Then finally
sys.stdout.write("\rFinished packing in %0.3f seconds. Saving to file...!" % (end-start,))

Finally curiously and rather off topic. given minecraft (using anvil format) saves blocks in YZX format because it's "the most efficient" (which I would have agreed with - put the axes which will vary the most closer together), why does minetest choose ZYX?

Re: Convert Minecraft maps to Minetest WorldEdit schematics

PostPosted: Sun Feb 01, 2015 09:28
by dgm5555
How difficult would it be to make a single step python converter to take a minecraft 1.x world file, extract only the block data, and convert it into an empty minetest world (or place it at eg y=500, so it doesn't get corrupted by regen). Then our tools like worldedit would work, and the toolchain would be drastically reduced.
Worldedit is totally unstable attempting to import any large volumes. The python version of Minetestmapper-numpy can read an entire minetest world in seconds (or worst case minutes). Apparently the c version is even faster, but python is so much easier for most of us to code and we don't have to recompile for every different computer. tomtsschem.py is so incredibly slow (presumably because it's relying on mcedit to access the file, but also possibly because it doesn't follow the minecraft block order, so extraction is very inefficient.
I'm thinking it would be far better to just bypass mcedit entirely.

The minecraft anvil file format is very well documented, so shouldn't be that difficult to extract from. The difficult bit I don't understand it the files seem to have compressed sections within them, and I'm not sure how you'd go about extracting that. Actually mineblend: http://randomsamples.info/project/mineblend/ has python code to extract direct to blender, so would probably be a good start, and there are probably others

Then you could have a simple text-based lookup table to convert from a minecraft block to a minetest one (just as tomtsschem.py does) and resort the blocks into chunks for minetest.

Finally put it directly into a minetest world sqlite file with any header code.

Even if it took all night for a world to convert it would be worth it as it give minetest users access to the thousands of amazing worlds and objects built by minecraft users...
EDIT: I've started a new post on this, as the more I think about it the better the idea seems:
https://forum.minetest.net/viewtopic.php?f=5&t=11146

Re: Convert Minecraft maps to Minetest WorldEdit schematics

PostPosted: Wed Mar 11, 2015 15:14
by apienk
Does this filter work both sides? I'm looking for a method to export fragments of Minetest worlds to Blender. I thought I might import a .we file in MC's WorldEdit and then use the Mineblend filter to export.

Re: Convert Minecraft maps to Minetest WorldEdit schematics

PostPosted: Thu Mar 12, 2015 18:03
by sfan5
No, this only converts Minecraft to Minetest.

Re: Convert Minecraft maps to Minetest WorldEdit schematics

PostPosted: Sun Mar 15, 2015 22:02
by dgm5555
apienk wrote:Does this filter work both sides? I'm looking for a method to export fragments of Minetest worlds to Blender. I thought I might import a .we file in MC's WorldEdit and then use the Mineblend filter to export.

There is a minecraft to blender python script called mineblend, that might provide a starter if you wished to code something specifically for minetest

Re: Convert Minecraft maps to Minetest WorldEdit schematics

PostPosted: Fri Apr 03, 2015 20:36
by Kociak
Hello, my first post here, so excuse me any mistakes - english is not my native language.
I've just used this filter to import a building from minecraft's world. The thing I've noticed - imported schematic needed to be flipped along X axis. I've repeated this with two independent constructions.

Re: Convert Minecraft maps to Minetest WorldEdit schematics

PostPosted: Sat Jul 25, 2015 19:41
by Sokomine
mccompat is based on this approach here, although it is slightly diffrent. It takes schematics more or less directly (you have to manually gunzip them) and imports them using lua via the mod handle_schematics. It's intended for smaller objects like houses or tiny villages/towns and does handle a lot of nodes.

Re: Convert Minecraft maps to Minetest WorldEdit schematics

PostPosted: Sat Sep 12, 2015 14:16
by imkongfu
heheh thnx

Re: Convert Minecraft maps to Minetest WorldEdit schematics

PostPosted: Tue Sep 22, 2015 00:02
by eduardomezencio
I got this when trying to load the schematic in worldedit:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
2015-09-21 20:56:28: ERROR[main]: ServerError: Lua: Runtime error from mod 'worldedit_commands' in callback on_chat_message(): .../mods/Minetest-WorldEdit/worldedit_commands/init.lua:1009: attempt to concatenate local 'count' (a nil value)
2015-09-21 20:56:28: ERROR[main]: stack traceback:
2015-09-21 20:56:28: ERROR[main]:    .../mods/Minetest-WorldEdit/worldedit_commands/init.lua:1009: in function 'func'
2015-09-21 20:56:28: ERROR[main]:    /usr/share/minetest/builtin/game/chatcommands.lua:42: in function '?'
2015-09-21 20:56:28: ERROR[main]:    /usr/share/minetest/builtin/game/register.lua:355: in function </usr/share/minetest/builtin/game/register.lua:335>


I don't know if the problem is with the schematic exported from the filter or if it's a worldedit bug. Is there a way for me to check if the schematic is 'valid'?

Re: Convert Minecraft maps to Minetest WorldEdit schematics

PostPosted: Wed Sep 23, 2015 20:48
by sfan5
Possibly a WorldEdit bug, make an issue at the issue tracker.

Re: Convert Minecraft maps to Minetest WorldEdit schematics

PostPosted: Wed Sep 23, 2015 23:05
by eduardomezencio
I'm also getting errors when applying the filters. I have attached pictures using the two versions of the filter

Here's the terminal output for the division by zero:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
Traceback (most recent call last):
  File "/usr/lib/mcedit/editortools/filter.py", line 32, in _func
    func(*args, **kw)
  File "/usr/lib/mcedit/editortools/filter.py", line 410, in confirm
    self.editor.addOperation(op)
  File "/usr/lib/mcedit/leveleditor.py", line 3382, in addOperation
    self.performWithRetry(op)
  File "/usr/lib/mcedit/leveleditor.py", line 3388, in performWithRetry
    op.perform(self.recordUndo)
  File "/usr/lib/mcedit/editortools/filter.py", line 317, in perform
    self.filter.perform(self.level, BoundingBox(self.box), self.options)
  File "/home/edju/.mcedit/filters/tomtsschem.py", line 301, in perform
    float(numnodes) / nps_avg,
ZeroDivisionError: float division by zero


And here's the one about 'permission denied'
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
Traceback (most recent call last):
  File "/usr/lib/mcedit/editortools/filter.py", line 32, in _func
    func(*args, **kw)
  File "/usr/lib/mcedit/editortools/filter.py", line 410, in confirm
    self.editor.addOperation(op)
  File "/usr/lib/mcedit/leveleditor.py", line 3382, in addOperation
    self.performWithRetry(op)
  File "/usr/lib/mcedit/leveleditor.py", line 3388, in performWithRetry
    op.perform(self.recordUndo)
  File "/usr/lib/mcedit/editortools/filter.py", line 317, in perform
    self.filter.perform(self.level, BoundingBox(self.box), self.options)
  File "/home/edju/.mcedit/filters/tomtweschem.py", line 221, in perform
    f = open("../" + options["Output filename"] + ".we", 'w')
IOError: [Errno 13] Permission denied: u'../test.we'

Re: Convert Minecraft maps to Minetest WorldEdit schematics

PostPosted: Sun Sep 27, 2015 20:20
by Sokomine
If whatever you're trying to convert isn't too big (say, not several hundered/thousand nodes in each direction), you can also save it as a MC .schematic and import the file using my handle_schematics mod.