Code Monkey home page Code Monkey logo

mcstructurecleaner's Introduction

mcstructurecleaner's People

Contributors

jalil-salame avatar mycroftjr avatar nyveon avatar thegamersbrew avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mcstructurecleaner's Issues

1.19 compatability

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.

KeyError: 'Tag Level does not exist'

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'

Unit testing

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:

  • 1.13
  • 1.16
  • 1.17
  • 1.18
  • 1.19

Main.py

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!
image

Thank you

Just wanted to say thank you. Having to do this by hand with NBTExplorer would have freakin' killed me LOL.

[Feature Request] Putting the Structure references in a datapack.

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.

Crash

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

problems running script

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

Graphical User Interface

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

'tag Level does not exist' error

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?

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xed

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.

level data not found - 1.18

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

[Feature Request] Replacing a non-vanilla tag with a vanilla tag

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

[Feature Request] Tag name regex/wildcards

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?

Further testing

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.