[Old] MapEdit: The faster world editor

Post Reply
random_geek
Member
Posts: 49
Joined: Wed Jun 20, 2018 18:55
GitHub: random-geek
In-game: Techy5 random_geek

[Old] MapEdit: The faster world editor

by random_geek » Post

Update (May 2021): MapEdit is no longer maintained. For the latest features, check out MapEditr instead!

What is MapEdit?

MapEdit is an external command-line tool for relatively fast manipulation of Minetest worlds (map files). It is not intended to be a replacement for WorldEdit, but is more reliable and much faster for large operations where WorldEdit would usually fail.
The tool is currently in the beta stage; it is not complete and may have bugs.

Features:
MapEdit is aimed at server owners, although it can be used for single-player worlds as well. It features a number of commands designed for large-scale map manipulation. Things you can do with it include:
  • Cloning, deleting, and filling of areas.
  • Overlaying parts of one map file onto another.
  • Bulk replacement of nodes.
  • Bulk replacement of items in inventories.
  • Metadata, node timer, and entity deletion.
  • Basic metadata and param2 editing.
Update (June 2020): Updated with more functionality, more speed, and sub-mapblock support for all commands.

Most commands can be restricted to inside or outside of one area, and there is also a progress bar so you know how long things will take.
As usual, full documentation of the commands and other notes can be found at the GitHub repository.

Dependencies: Python 3 and NumPy.

Download: https://github.com/random-geek/MapEdit/ ... master.zip

GitHub: https://github.com/random-geek/MapEdit

License: LGPL v3
Last edited by random_geek on Fri May 28, 2021 19:06, edited 2 times in total.
I have not failed. I've just found 10,000 ways that won't work. —Thomas Edison

u34

Re: [Beta] MapEdit

by u34 » Post

is this tool only for linux-user or also for windows users? when it work on windows, how do i enable python3 on this plattform? thanks for infos.

random_geek
Member
Posts: 49
Joined: Wed Jun 20, 2018 18:55
GitHub: random-geek
In-game: Techy5 random_geek

Re: [Beta] MapEdit

by random_geek » Post

cHyper wrote:is this tool only for linux-user or also for windows users? when it work on windows, how do i enable python3 on this plattform? thanks for infos.
It should work on all platforms, including Windows. You can get the latest Python 3 release from https://python.org/downloads/windows/ and install it. Then, open the folder where mapedit.py is in Command Prompt or PowerShell and run "python mapedit.py" without the quotes. If it works, it should display a help screen. If it doesn't, try using "python3 mapedit.py" or restarting the computer.
Hope this helps.
I have not failed. I've just found 10,000 ways that won't work. —Thomas Edison

random_geek
Member
Posts: 49
Joined: Wed Jun 20, 2018 18:55
GitHub: random-geek
In-game: Techy5 random_geek

Re: [Beta] MapEdit

by random_geek » Post

UPDATE: A couple of bugs were fixed, as well as some code cleanup. :)
I have not failed. I've just found 10,000 ways that won't work. —Thomas Edison

Gundul
Member
Posts: 1252
Joined: Thu Aug 27, 2015 10:55
GitHub: berengma
IRC: Gundul
Location: Europe/Asia
Contact:

Re: [Beta] MapEdit

by Gundul » Post

random_geek wrote:UPDATE: A couple of bugs were fixed, as well as some code cleanup. :)
Looks like deleting mapblocks does not work:

Code: Select all

` python3.7 mapedit.py -f map.sqlite --p1 100 -100 100 --p2 -100 100 -100 deleteblocks
WARNING: Using this tool can potentially cause permanent
damage to your map database. Please SHUT DOWN the game/server
and BACK UP the map before proceeding. To continue this
operation, type 'yes'.

    yes
    Traceback (most recent call last):
    File "mapedit.py", line 177, in
    args.func(db, args)
    File "/Jungle/lib/commands.py", line 50, in delete_blocks
    list = helpers.get_mapblocks(cursor, area=(p1, p2), inverse=args.inverse)
    NameError: name 'cursor' is not defined
    `
I changed helpers.get_mapblocks(cursor, area=(p1, p2), inverse=args.inverse)
to helpers.get_mapblocks(database, area=(p1, p2), inverse=args.inverse)

now code is running, but the map.sqlite changed not in size after script finished.
My servers: Jungle, Lilly in the valley click for my mods

User avatar
Festus1965
Member
Posts: 2485
Joined: Sun Jan 03, 2016 11:58
In-game: Festus1965 Thomas Thailand Explorer
Location: Thailand ChiangMai
Contact:

Re: [Beta] MapEdit

by Festus1965 » Post

Gundul wrote:now code is running, but the map.sqlite changed not in size after script finished.
Sure it isn't changed size, as that is not included to run of VACUUM. That you still have to do yourself.
Human has no future (climate change)
If urgend, you find me in Roblox (as CNXThomas)

random_geek
Member
Posts: 49
Joined: Wed Jun 20, 2018 18:55
GitHub: random-geek
In-game: Techy5 random_geek

Re: [Beta] MapEdit: The faster world editor

by random_geek » Post

Update! The code has been revamped with sub-mapblock editing, a better command-line interface, more features, more speed, et cetera. It now requires NumPy (install with `pip install numpy`).
I have not failed. I've just found 10,000 ways that won't work. —Thomas Edison

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest