Inactive [TOOL/ADMIN] Minecraft Map Auto Trim v0.4.1

Discussion in 'Bukkit Tools' started by HWei, Sep 22, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    HWei

    Support both Anvil and MCR world format!


    Downloads
    --------------
    <removed>
    Direct link

    Usage
    -------

    java -jar mmat.jar -w <world path> [-d <dilation size>] [-p <id list>] [-r <minX,maxX,minZ,maxZ>] [-y <yStart,yEnd>]

    Where:

    -w <world path> Path to the world folders
    -d <dilation size> Dilate preserved area to perserve more chunks around the chunks with "perserve block"
    -p <id list> Define a list of "perserve block".If a chunk contains any "perserve block", it will be preserved.
    -r <minX,maxX,minZ,maxZ> If specified, all the chunks outside this rectangle will be forced to delete.
    -y <yStart,yEnd> If specified, only scan this range of height.

    Examples:

    java -jar mmat.jar -w ~/minecraft/world
    java -jar mmat.jar -w ~/minecraft/world -d 3 -p 63,68 -r -1000,1000,-1000,1000 -y 64,256

    Source code (open)

    Change log (open)

    v0.4.1
    Fix -y parameter.
    v0.4
    Add -y parameter to specify scan range of height.
    v0.3 beta
    Fix rectangle cut
    Fix old mcr chunk reading
    Fix unnecessary region files auto deleting
    v0.3 alpha
    Support both Anvil and McRegion world format.
    Can specify force to delete all chunks out side a rectangle.
    v0.2
    User defined preserve block id list.
    v0.1
    Fixed preserve block id list.

    background (open)

    Our world was very large and structures were distributed every where. It was hard to delete unused chunks manually. :( ...So I wrote a program to do this automatically. :D

    The name of this tool is minecraft map auto trim (mmat). Obviously, it can delete unused chunks automatically. The aim is: to delete as many unused chunks as possible, while remain the chunks which contain structures.

    how does it work (open)

    Very simple. It will check every chunk whether contains one of following blocks:5,19,20,22,23,25,26,27,28,29,33,34,35,36,41,42,43,44,45,46,47,53,55,57,59,60,63,64,65,66,67,68,69,70,71,72,75,76,77,80,84,85,87,88,89,91,92,93,94,96 (you can define your own preserve list ). If it dose, preserve this chunk and the chunks in a certain distance around it. At last, delete all the chunks not be preserved.
    If you want to reserve some chunks explicitly, just put any preserved block there.


    Before, size is larger than 20000 and 3GB.
    (Many small regions caused by tppos... :()
    [​IMG]

    After, size is no larger than 10000 and 1GB
    [​IMG]

    Hope this tool can help you. :cool:
    tips (open)

    1. Always backup your map before any modification.
    2. mcmap tool can render map into image.
    3. WorldEdit plugin can recover old chunks from backup in game.
    4. WorldEdit plugin can discard old chunks and regenerate new chunks in game.
    5. I am not an English speaker...
     
  2. Offline

    asmoranomar

    This sounds great. Does this only work on 1.7 maps?
    I tried using it on 1.8 and it only deleted 30 chunks out of 40k....

    It would be great to use to prepare for 1.9 & 1.10
     
  3. Offline

    HWei

    It can work with unknown blocks. But in 1.8 there are a lot of mine shafts, which means torches can spawn by themselves. So the algorithm for 1.7 is not efficient.
    I will update it later to allow users to define the protect block set.
     
  4. Offline

    Ismaw34

    Hello, any progress on this?
    the alternative way is replacing all the torches (id:50) with air (id:0) and warn the players about the protection.
    But it would be grat if you update this ^^
    Ismaw34
     
  5. Offline

    HWei

    Updated to v0.2, you can define the preserve block id list by yourself.

    I think the better way to warn players is show them the trim result before real trim.
    You can use c10t to draw the maps before and after trim. Put them onto zoom.it to let players know what would happen.
     
  6. Offline

    asmoranomar

    This tool definitely belongs in any administrator's toolkit. I am surprised this hasn't received more excitement. It is going to shave hours off my world migration & management efforts. It can also be used to shrink world sizes down for smaller/faster backups too. I've just barely tapped into what this thing can do and I'm already very impressed. This has easily become one of my favorite tools.

    Currently I'm telling my users to place signs on the areas they'd like to keep (-p 63,68) which works really well.
     
  7. Offline

    Antariano

    It is an awesome tool! I really would like to be able to integrate this into the SpaceBukkit project. @HWei what do you think?
     
  8. Offline

    HWei

    @asmoranomar Glad you like it. :D

    No problem.
    There is no complex technology in this tool and I also used some others' code in it.
    You can either put mmat.jar directly into your project or write a better one (it is simple).

    I appreciate that my work is considered valuable. :cool:
     
  9. Offline

    Williamsson

    But wat? Shouldn't this, after the old chunks are removed, create huge walls/valleys when the newly generated chunks generate arround the old, preserved? Since the algorithm for generating chunks changed from 1.7 to 1.8.
     
  10. Offline

    HWei

    That's right. But there is no better solution.
    It is too difficult to write a program to smooth the border. I don't have so much time on that. :(
     
  11. Offline

    Williamsson

    Thought so :) Just wanted to be sure, I'll stick to worldedit then, works just fine anyhow :)
     
  12. Offline

    Waffletastic

    When I try to run this, a black cmd screen pops up for a split second then goes back to nothing.

    I added ECHO OFF and PAUSE, and now it says it cannot find the file specified.

    scratch what i said, I didn't removed the <>s lul.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 19, 2016
  13. @HWei
    What about instead using the world seed as a point of origin then generate a fresh chunk (in memory) and compare the hash of that chunk to the one you have on your map. Any matching hashes equals untouched/unchanged chunks and can therefor be removed. While this would be very cpu intensive it would be alot more accurate then looking for specific block and then guessing how far around it should not touch. Also, you would hopefully not need to run this very often and can therefor overlook the cputime it takes to complete.
     
  14. Offline

    HWei

    Maybe you need a bukkit plugin recording whether a chunk has been modified and after some time deletes those unchanged chunks. But plugins are not able to delete chunks... I don't know how to do this... :(
     
  15. no, a standalone java app like yours. It can generate chunks and make a hash from it just like the game can.
     
  16. Offline

    ZachBora

  17. Offline

    cantidosama

    Just testing on 1.1 before 1.2 comes out, works like a charm.

    My updated, anti-village block list includes red brick stairs, enchantment table, brewing stand, cauldron, but not the blocks found in villages, as I want to get rid of old villages in my world.

    19,20,22,23,25,26,27,28,29,34,36,41,42,43,45,46,53,55,57,60,63,66,68,69,70,71,75,76,77,80,84,87,88,89,91,92,93,94,96,108,116,117,118

    Edit- though mmat is processing my world fine, I'm having trouble with chunks being left in that shouldn't be... bummer.
     
  18. Offline

    Dreamskiller

    This tool seems really interesting, considering 1.2 is out.
    Just one question ; apparently it does not change chunks which are close to the preserved one (ones with special blocks on them), but are the transition smooth between the new generated chunks and the old ones ?

    Thks
     
  19. Offline

    greatman

    does it needs a update for 1.2 or it would work Considering the map format changed?
     
  20. Offline

    ZachBora

    I believe it would require an update.
     
  21. Offline

    greatman

    Yeah just tested it myself and it found no chunks lol
     
  22. Offline

    ratty

    Such a useful program, and no changes in 5 months, and the OP's last login to forums was Feb 1.
    It might be dead guys.
    Anyone find a similar program that does the same thing?
     
  23. Offline

    ZachBora

    At least he provided the source. Not that I'd know how to update it.
     
  24. Offline

    Pezmantbh

    Gonna bump this to ask for an update from somebody :)
     
  25. Offline

    nickrak

    I sent the OP a message on GitHub.
    If you can't get an update from him by the end of the month, contact me and I'll do the update.
     
  26. Offline

    HWei

    Sorry. I always login BukkitDev but did not realize that I should also login forum. (Why they are 2 different accounts... :eek:)

    Let me try to update it to Anvil this weekend. :)
     
  27. Offline

    Pezmantbh

    Thanks, much appreciated ;)
     
  28. Offline

    ratty

    Thanks!
     
  29. Offline

    Pezmantbh

    is it still looking likely that there we will be an update this weekend? :)
     
  30. Offline

    HWei

    Yes. I am on it...
     
Thread Status:
Not open for further replies.

Share This Page