-
Notifications
You must be signed in to change notification settings - Fork 103
Usage
All usage examples shown here are for windows. The usage doesn't really change from Windows to Linux or Mac, so there are not linux or mac examples. The only change from platform to platform is how the program is executed, for instance:
-
Windows: from source code use
regionfixer.py
and with the exeregionfixer.exe
-
Linux: only the source code is available, you usually will need to run it as
python regionfixer.py
-
Mac: I don't own a mac but as far as I know is exactly the same as in linux, you will need to run it as
python regionfixer.py
Region fixer comes in two variants: the command line application and the GUI (a typical windows application).
Once you have followed the installation instructions you are ready to execute region fixer in command line or in GUI.
To use the gui you only have to double click the file regionfixer_gui.py
in a file explorer and that will pop-up the region-fixer gui.
The GUI is pretty straightforward to use. Open a world (button in the top right) and then scan it (top right too), the results will be shown in the "Results" section. Once you have the results you can choose between a few buttons (in the bottom riht) to do actions like delete all the broken chunks or delete the broken region files.
You can also use backups to replace broken chunks and region files. For that go to View menu and click in Backups. You can add as many world as you like and region fixer will try to find a sane chunk/region file to use in top-down order. Please, refer to the FAQ for info about what is a backup.
First, open a prompt (a MS-DOS window). The easiest why is probably to run cmd.exe
in the run menu. If you are running windows 8 you only have to press the windows key and then write cmd
and press enter.
Once in the prompt navigate to the folder where you have decompressed region fixer. If you don't know hot to navigate in there, please, refer to Troubleshooting.
In there you can read the program help using region-fixer.py --help
, that will print a ton of options and stuff. Some commonly used options are:
-
--processes
or-p
that will set the number of processes to use, this will speed up the scan a lot (if you have a few cores to spare). -
--log myfilename.txt
or-l myfilename.txt
that will save a log file with in detail results.
Now lets see some usage examples in different cases:
If you know where the problem is you can scan a single region file instead of scanning the whole world and save precious time. You can also scan a few region files from different locations. Example:
NOTE: The first line is the command used to run region fixer. The first character in this line is the prompt symbol and is not part of the command.
> regionfixer.py c:\worlds\test\region\r.1.1.mca
Welcome to Region Fixer!
(version: 0.2.0)
############################################################
############## Scanning separate region files ##############
############################################################
Scanning: 1 / 1 100% [#######################################] Time: 00:00:01
Chunk problems:
No problems found.
Region files problems:
No problems found.
You can also:
> regionfixer.py -p 4 c:\worlds\test2\region\*.mca
Welcome to Region Fixer!
(version: 0.2.0)
############################################################
############## Scanning separate region files ##############
############################################################
Scanning: 18 / 18 100% [#######################################] Time: 00:00:01
Chunk problems:
No problems found.
Region files problems:
No problems found.
The typical usage of Region-Fixer will be to scan a whole world. To do that only point it to the world path. For exampe:
$ regionfixer.py -p 4 c:\worlds\broken-world
Welcome to Region Fixer!
(version: 0.2.0)
############################################################
############### Scanning world: Broken world ##############
############################################################
World info:
There are 144 region files, 435 player files and 507 data files in the world dir
ectory.
-------------------- Checking level.dat --------------------
'level.dat' is readable
---------------- Scanning UUID player files ----------------
Scanning: 13 / 13 100% [#######################################] Time: 00:00:00
------------- Scanning old format player files -------------
Scanning: 422 / 422 100% [#####################################] Time: 00:00:00
---------- Scanning structures and map data files ----------
Scanning: 507 / 507 100% [#####################################] Time: 00:00:04
------------------ Scanning region files -------------------
Scanning: 144 / 144 100% [#####################################] Time: 00:00:23
############################################################
############### Scan results for: Broken world #############
############################################################
Unreadable player files:
cosarota.dat
Unreadable data files:
No problems found.
Chunk problems:
--------------------------------------------------------------------
| Problem | Corrupted Wrong l. Entities Shared o. Total chunks |
--------------------------------------------------------------------
| Counts | 644 1 1 3 21808 |
--------------------------------------------------------------------
Region problems:
--------------------------------------------------
| Problem | Too small Unreadable Total regions |
--------------------------------------------------
| Counts | 26 0 144 |
--------------------------------------------------
You can also point to a few worlds and Region-Fixer will scan them all.
You can use the --delete-... options to delete broken chunks or broken region files or even entities when there are too many in a chunk. In the next example we see the results of using --delete-corrupted
and we use four processes to scan the world (we add the option -p 4
):
$ regionfixer.py -p 4 --delete-corrupted c:\worlds\broken-world
Welcome to Region Fixer!
(version: 0.2.0)
############################################################
############### Scanning world: Broken world #############
############################################################
World info:
There are 144 region files, 435 player files and 507 data files in the world dir
ectory.
-------------------- Checking level.dat --------------------
'level.dat' is readable
---------------- Scanning UUID player files ----------------
Scanning: 13 / 13 100% [#######################################] Time: 00:00:00
------------- Scanning old format player files -------------
Scanning: 422 / 422 100% [#####################################] Time: 00:00:00
---------- Scanning structures and map data files ----------
Scanning: 507 / 507 100% [#####################################] Time: 00:00:04
------------------ Scanning region files -------------------
Scanning: 144 / 144 100% [#####################################] Time: 00:00:23
############################################################
############### Scan results for: Broken world ############
############################################################
Unreadable player files:
cosarota.dat
Unreadable data files:
No problems found.
Chunk problems:
--------------------------------------------------------------------
| Problem | Corrupted Wrong l. Entities Shared o. Total chunks |
--------------------------------------------------------------------
| Counts | 644 1 1 3 21808 |
--------------------------------------------------------------------
Region problems:
--------------------------------------------------
| Problem | Too small Unreadable Total regions |
--------------------------------------------------
| Counts | 26 0 144 |
--------------------------------------------------
########## Deleting chunks with status: Corrupted ##########
Deleting chunks in region set "region":
Removed 644 chunks in this regionset.
Deleting chunks in region set "DIM-1":
Removed 0 chunks in this regionset.
Deleted 644 chunks with status: Corrupted
If you have backups of you minecraft world you can use them to replace all the broken chunks and region files. For that use the options --replace-...
in combination with the option --backup
. The option --backup
wants as argument paths to Minecraft worlds that are backups of your world. For example, this command will scan the world using 4 processes and then replace any wrong-located chunks found using the backups in one of the two backup directories provided (you can add as many backups directories as you want, writing them comma separated):
> regionfixer.py -p 4 --replace-wrong --backups
c:\mine-backups\2014-06,c:\mine-backups\2014-05 c:\worlds\broken-world
Welcome to Region Fixer!
(version: 0.2.0)
############################################################
############### Scanning world: Broken world ##############
############################################################
World info:
There are 144 region files, 435 player files and 507 data files in the world dir
ectory.
-------------------- Checking level.dat --------------------
'level.dat' is readable
---------------- Scanning UUID player files ----------------
Scanning: 13 / 13 100% [#######################################] Time: 00:00:00
------------- Scanning old format player files -------------
Scanning: 422 / 422 100% [#####################################] Time: 00:00:00
---------- Scanning structures and map data files ----------
Scanning: 507 / 507 100% [#####################################] Time: 00:00:04
------------------ Scanning region files -------------------
Scanning: 144 / 144 100% [#####################################] Time: 00:00:22
############################################################
############### Scan results for: Broken world #############
############################################################
Unreadable player files:
cosarota.dat
Unreadable data files:
No problems found.
Chunk problems:
--------------------------------------------------------------------
| Problem | Corrupted Wrong l. Entities Shared o. Total chunks |
--------------------------------------------------------------------
| Counts | 0 1 1 3 21164 |
--------------------------------------------------------------------
Region problems:
--------------------------------------------------
| Problem | Too small Unreadable Total regions |
--------------------------------------------------
| Counts | 26 0 144 |
--------------------------------------------------
####### Replacing chunks with status: Wrong located ########
------ New chunk to replace. Coords: x = 18; z = -63 -------
Backup region file found in:
c:\mine-backups\2014-06/region/r.0.-2.mca
Replacing...
Chunk replaced using backup dir: c:\mine-backups\2014-06
1 replaced of a total of 1 chunks with status: Wrong located
There are options to replace all the chunks problems and all the region problems.
###Handling too many entities problems. Sometimes, while playing Minecraft, you ask to yourself "What would happend if I fill a whole chunk with TNT and I light it?". Well It's pretty awesome but after that your world probably won't work anymore because thousands of entities are moving in every direction and the server is dying trying to move all of them.
When this happens you can use the options --entity-limit
and --delete-entities
to remove all the entities in any chunk that has more entities than the number given to --entity-limit
(150 entities by default).
In the example we scan the world using 4 processes and we delete all the entities in any chunk that has more than 100 entities:
> regionfixer.py -p 4 --delete-entities --entity-limit 100
c:\worlds\broken-world
Welcome to Region Fixer!
(version: 0.2.0)
############################################################
############### Scanning world: Broken world ##############
############################################################
World info:
There are 144 region files, 435 player files and 507 data files in the world dir
ectory.
-------------------- Checking level.dat --------------------
'level.dat' is readable
---------------- Scanning UUID player files ----------------
Scanning: 13 / 13 100% [#######################################] Time: 00:00:00
------------- Scanning old format player files -------------
Scanning: 422 / 422 100% [#####################################] Time: 00:00:00
---------- Scanning structures and map data files ----------
Scanning: 507 / 507 100% [#####################################] Time: 00:00:04
------------------ Scanning region files -------------------
Deleted 46944 entities in chunk (13,6) of the region file: r.0.-2.mca 00:00:02
Scanning: 144 / 144 100% [#####################################] Time: 00:00:39
############################################################
############### Scan results for: Broken world #############
############################################################
Unreadable player files:
cosarota.dat
Unreadable data files:
No problems found.
Chunk problems:
--------------------------------------------------------------------
| Problem | Corrupted Wrong l. Entities Shared o. Total chunks |
--------------------------------------------------------------------
| Counts | 0 0 0 3 21164 |
--------------------------------------------------------------------
Region problems:
--------------------------------------------------
| Problem | Too small Unreadable Total regions |
--------------------------------------------------
| Counts | 26 0 144 |
--------------------------------------------------
No chunks to delete with status: Too many entities
Region-Fixer will delete entities while scanning (that's why it says there are no chunks to delete at the end, it has deleted the entities in the middle of the scan), so it doesn't have to load those chunks twice.
Please note, if you have a chunk with a lot of entities, you need to load that chunk in RAM in order to delete them. Sometimes you will need GBs of RAM and a good amount of time to do so, please, be patient.
Also, this method will delete all the entities in those chunks, at the moment of writing this Entities stored in chunks are:
- mobs
- projectiles (arrows, snowballs...)
- primed TNT
- ender crystal
- paintings
- items on the ground (don't worry chests are safe)
- vehicles (boats and minecarts)
- dynamic tiles (falling sand, primed TNT)
This mode allows you to keep the scan information while you decide what to do with your world. It's very useful if you don't know what's wrong in your world and a full scan takes a lot of time. To use this mode add the option --interactive
or -i
. Once in interactive mode you can use help to see a list of commands.
In this example we use interactive mode to remove chunks sharing offset. First we scan the world:
$ regionfixer.py -p 4 --interactive ~/cosas\ minecraft/Mundos\ corruptos\ \(anv
il\)/Otros/2014.06.17\ #\ Crafted\ with\ all\ the\ possible\ chunk\ problems/
Welcome to Region Fixer!
(version: 0.2.0)
Minecraft Region-Fixer interactive mode.
(Use tab to autocomplete. Type help for a list of commands.)
#-> scan
World info:
There are 144 region files, 435 player files and 507 data files in the world dir
ectory.
-------------------- Checking level.dat --------------------
'level.dat' is readable
---------------- Scanning UUID player files ----------------
Scanning: 13 / 13 100% [#######################################] Time: 00:00:00
------------- Scanning old format player files -------------
Scanning: 422 / 422 100% [#####################################] Time: 00:00:00
---------- Scanning structures and map data files ----------
Scanning: 507 / 507 100% [#####################################] Time: 00:00:04
------------------ Scanning region files -------------------
Scanning: 144 / 144 100% [#####################################] Time: 00:00:08
Then we get a summary of what is going wrong with it:
#-> summary
Unreadable player files:
cosarota.dat
Unreadable data files:
No problems found.
Chunk problems:
--------------------------------------------------------------------
| Problem | Corrupted Wrong l. Entities Shared o. Total chunks |
--------------------------------------------------------------------
| Counts | 0 0 0 3 21164 |
--------------------------------------------------------------------
Region problems:
--------------------------------------------------
| Problem | Too small Unreadable Total regions |
--------------------------------------------------
| Counts | 26 0 144 |
--------------------------------------------------
Now we just want to know what can we do with this interactive mode so we type:
#-> help
Documented commands (type help <topic>):
========================================
EOF current_workload remove_chunks replace_regions
count_all exit remove_entities scan
count_chunks help remove_regions set
count_regions quit replace_chunks summary
We really want to delete those sharing offset chunks, so:
#-> remove_chunks sharing
Deleting chunks in region set "region":
Removed 3 chunks in this regionset.
Deleting chunks in region set "DIM-1":
Removed 0 chunks in this regionset.
Removed 3 chunks with status 'Sharing offset'.
And its done! Now we can type:
#-> quit