Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JVM argument for data directory #10350

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

ahdg6
Copy link

@ahdg6 ahdg6 commented Nov 23, 2024

  • I have read the contribution guidelines.
  • I have ensured that my code compiles, if applicable.
  • I have ensured that any new features in this PR function correctly in-game, if applicable.

This PR introduces a JVM argument (-Dmindustry.data.dir) to specify the data directory, reducing the dependency on the environment variable (MINDUSTRY_DATA_DIR). If the JVM argument is not provided, the fallback is still to use the environment variable. This simplifies configuration by allowing direct use of JVM arguments.

java -jar desktop.jar -Dmindustry.data.dir=./custom_dir

@SMOLKEYS
Copy link
Contributor

mfw head repo deleted 💀

also please lord i actually need/want this

@ahdg6
Copy link
Author

ahdg6 commented Nov 24, 2024

mfw head repo deleted 💀

The previous repository was deleted because I had forked another client, which itself was a fork of Mindustry. As a result, GitHub overwrote and deleted the original repository where the PR was created. However, I’ve now recreated the repository and resubmitted the PR.

also please lord i actually need/want this

Regarding the PR content, using JVM arguments to set the data directory is a better approach than relying on environment variables. This is because when you make the game portable (e.g., running it from a USB drive), you often need to verify if the data directory environment variable exists. Moreover, the method for setting environment variables varies across shells and operating systems, while JVM arguments are straightforward, clear, and directly visible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants