Treer / Amidst-for-Minetest

the Amidst project converted to support Minetest (aka Amidstest)
https://www.minetest.net/
GNU General Public License v3.0
27 stars 2 forks source link

Amidstest is accessing configuration files in directories also used by amidst, causing many compatibility problems #22

Closed juozaspo closed 6 years ago

juozaspo commented 6 years ago

Running Amidstest first and then running running original amidst after that I found that amidst crash while loading a minecraft profile (toolbox4minecraft/amidst#428). This is caused by Amidstest writing it's configuration to wrong files/directories which causes many compatibility problems with original amidst program.

I diagnosed this by running strace -f -e trace=%file java -jar amidstest-v1-2-beta.jar 2>&1 | tee /path/to/output.txt on Linux, I found many reads/writes to directories listed below:

Also libraries, versions, launcher_profiles.json are accessed in .minecraft folder if present, none of them are used in minetest, everything should be read from .minetest, where a method to find worlds (in .minetest/worlds) & users (in .minetest/worlds/worldname/auth.txt) should be rewritten.

You should also add an option to use alternate minetest directory location, as some minetest builds store configuration in parent folder of bin directory where minetest executable is located (run-in-place builds, e.g. parent folder of where /home/yourusername/minetest/bin/minetest executable is located is /home/yourusername/minetest/)

The references to directories above should be changed to something else to avoid any further bugs caused by that.

Treer commented 6 years ago

It looks like Amidst is crashing due to the biomes directory, which as you say is local to the application, so either don't run both applications in the same directory, or use the -biome-profiles command-line argument to specify where the biome directory should be kept (both apps support this).

The /home/yourusername/.java/.userPrefs/amidst directory is an interesting issue, it's created by a Java library automatically from code namespaces. I don't think it will harm Amidst but it'd be nice to keep the preference settings of the two apps separated, so creating a dummy namespace in the code may be in order.

Also libraries, versions, launcher_profiles.json are accessed in .minecraft folder if present, none of them are used in minetest

They're not used in minetest, but are used by Amidstest - which can display Minecraft and Minetest maps (though has not been updated for 1.13).

You should also add an option to use alternate minetest directory location

Locating the Minetest installation and loading its worlds and configurations is unfortunately still on the todo list, Amidstest currently just contains a copy of the Minetest default values :/