![](./icons/personal.png)
![](./icons/grok.png)
Modded structure cleaner for Minecraft. Removes all references to non-existent structures to allow for clean error logs and chunk saving.
License: MIT License
If a mod implements custom structures that are variants of ones used in Vanilla, there should be a feature to replace the tag name with a Vanilla equivalent. For example, if a mod implements the structure supermod:superstronghold
, there should be an option to replace this with minecraft:stronghold
so that Eye of Enders can point to this structure, rather than ignoring it.
The syntax could be something like python main.py -c supermod:superstronghold minecraft:stronghold
I can't get this to run is there any way you can help via discord? my discord is KillaKilla#9286 you said contact you on discord but i dont see a contact
Just wanted to say thank you. Having to do this by hand with NBTExplorer would have freakin' killed me LOL.
I'm not sure if this is a problem with the script or my region file (the latter is more likely as it's the only one that is having this issue). Whenever I run the script, it will stop at 1 specific mca file with the following error: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xed in position 9: invalid continuation byte
.
Full log: https://gist.github.com/Footage2-Amply-Pounce/756933e4a2a83b1215b0fcd804da5f30
Is there anything that can be done to fix it? I don't really need to clean this file, but I actually noticed that I get a significant FPS lag in 1 specific place of this region and completely wiping it helps, but I won't be doing that for obvious reasons. That makes me think that the problem is actually with the chunk file, rather than the script, but I'm hoping you could at least help me identify the issue as I have no clue what this error means.
I could send you the file if needed, however, you won't be able to load it in game as it's heavily modded and reproducing my mod setup is going to be too much to ask for.
These new structures need to be added to the structure allowlist: 'minecraft:village_plains', 'minecraft:ancient_city', 'minecraft:pillager_outpost'. Semi-dependant on 1.18 support.
To make sure the upcoming fixes that make it work with both pre 1.18 and post 1.18 worlds, unit testing using some mock world files would be ideal.
World file formats to test:
One of the hardest parts of using this project, is interacting with the command line for people who are not familiar with that workflow. A graphical user interface could greatly improve the experience.
The other hardest part, is the installation of python and the dependencies, for people who do not already have them installed or do not know how. Packaging the project as an executable, could greatly help streamline the usage of the software.
If anybody has ideas for how either of these should be implemented, feel free to comment them below.
Edit: Title change so that standalone executable can be a separate issue
Currently, only 1.15 files are tested. With the introduction of 1.18+ support in version 1.7 (#24), it would be nice to verify that everything works as expected for other versions
I only use python for really basic stuff so I may just be doing a simple mistake, but whenever I try to run main.py it instantly closes, I tried to find out what the problem was and this is what popped up. I have both the newest python installed and anvil parser. Thank you for making this program by the way!
I thought by tag you meant namespace, but I put in the tag "repurposed_structures" (the mod I deleted) and it keeps saying 0 tags were removed. What does it actually mean by tag?
Trying to purge my 1.20.4 world files but getting this error.
Added the log below.
No tag given, will run in purge mode.
Replacing all non-vanilla structures in all region files in G:\world\region.Saving newly generated region files to G:\fixed\new_region
Checking file: G:\world\region\r.-1.-1.mca
Checking file: G:\world\region\r.-2.2.mca
Checking file: G:\world\region\r.-7.0.mca
Checking file: G:\world\region\r.-1.0.mca
Checking file: G:\world\region\r.-2.9.mca
Checking file: G:\world\region\r.-4.1.mca
Checking file: G:\world\region\r.1.-12.mca
Checking file: G:\world\region\r.-1.-3.mca
Checking file: G:\world\region\r.-6.0.mca
Checking file: G:\world\region\r.3.-6.mca
Checking file: G:\world\region\r.-3.8.mca
Checking file: G:\world\region\r.-9.2.mca
Checking file: G:\world\region\r.0.6.mca
Checking file: G:\world\region\r.4.-2.mca
Checking file: G:\world\region\r.5.-4.mca
Checking file: G:\world\region\r.-2.-5.mca
Checking file: G:\world\region\r.-5.0.mca
Checking file: G:\world\region\r.2.2.mca
Checking file: G:\world\region\r.-1.7.mca
Checking file: G:\world\region\r.-3.0.mca
Checking file: G:\world\region\r.0.-2.mca
Checking file: G:\world\region\r.1.3.mca
Checking file: G:\world\region\r.-2.-1.mca
Checking file: G:\world\region\r.0.-9.mca
Checking file: G:\world\region\r.1.-6.mca
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "C:\Users\Roy\AppData\Local\Programs\Python\Python310\lib\multiprocessing\pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "C:\Users\Roy\AppData\Local\Programs\Python\Python310\lib\multiprocessing\pool.py", line 48, in mapstar
return list(map(*args))
File "C:\Users\Roy\Desktop\MCStructureCleaner_v17\structurecleaner\remove_tags.py", line 34, in _remove_tags_region_task
return _remove_tags_region(*args)
File "C:\Users\Roy\Desktop\MCStructureCleaner_v17\structurecleaner\remove_tags.py", line 95, in _remove_tags_region
new_region.add_chunk(anvil.Chunk(data_copy))
File "C:\Users\Roy\AppData\Local\Programs\Python\Python310\lib\site-packages\anvil\chunk.py", line 55, in init
self.data = nbt_data['Level']
File "C:\Users\Roy\AppData\Local\Programs\Python\Python310\lib\site-packages\nbt\nbt.py", line 543, in getitem
raise KeyError("Tag %s does not exist" % key)
KeyError: 'Tag Level does not exist'
"""The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\Roy\Desktop\MCStructureCleaner_v17\main.py", line 268, in
main()
File "C:\Users\Roy\Desktop\MCStructureCleaner_v17\main.py", line 259, in main
remove_tags(to_replace, world_region, new_region, num_processes, mode)
File "C:\Users\Roy\Desktop\MCStructureCleaner_v17\structurecleaner\remove_tags.py", line 131, in remove_tags
count = sum(pool.map(_remove_tags_region_task, data))
File "C:\Users\Roy\AppData\Local\Programs\Python\Python310\lib\multiprocessing\pool.py", line 367, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "C:\Users\Roy\AppData\Local\Programs\Python\Python310\lib\multiprocessing\pool.py", line 774, in get
raise self._value
KeyError: 'Tag Level does not exist'
Hey so my my idea is using this script to find the structure references and put them into a datapack while its cleaning so that way, You will have a datapack after the script is done and you can put that datapack in your world and it would show references of the structures when using the locate command.
once the program finished and I put it back on my server, it basically wiped the whole world and so I restored from a backup and tried one more time and still wiped the world. The console was printing level data not found for every chunk loaded
In order to make it easier to use, and get rid of dependency installations, having the releases be packaged executables would be nice.
https://github.com/pyinstaller/pyinstaller in particular seems promising
not 100% sure what I'm doing but when I run the script it throws this error ('tag Level does not exist') and gives a blank "new region" folder with nothing in it.
using different parameters seems to have no effect, do you have any idea of what i"m doing wrong?
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/usr/lib/python3.9/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/usr/lib/python3.9/multiprocessing/pool.py", line 48, in mapstar
return list(map(*args))
File "/[…]/main.py", line 65, in _remove_tags_region
File "/[…]/main.py", line 92, in remove_tags_region
File "/usr/local/lib/python3.9/dist-packages/anvil/region.py", line 52, in chunk_location
sectors = self.data[b_off + 3]
IndexError: index out of range
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/[…]/main.py", line 230, in <module>
File "/[…]/main.py", line 219, in _main
File "/[…]/main.py", line 132, in remove_tags
File "/usr/lib/python3.9/multiprocessing/pool.py", line 364, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "/usr/lib/python3.9/multiprocessing/pool.py", line 771, in get
raise self._value
IndexError: index out of range
Occurred on pop os 21.04, python3.9
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.