Mindustry example java mod

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

A template for Java (16-17) Mindustry mods.

Anuken/MindustryJavaModTemplate

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Читайте также:  Dd mm yyyy format to yyyy mm dd in javascript

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

Mindustry Java Mod Template

A Java Mindustry mod template that works on Android and PC. The Kotlin version of this mod can be seen here.

Building for Desktop Testing

  1. Install JDK 17.
  2. Run gradlew jar [1].
  3. Your mod jar will be in the build/libs directory. Only use this version for testing on desktop. It will not work with Android. To build an Android-compatible version, you need the Android SDK. You can either let Github Actions handle this, or set it up yourself. See steps below.

Building through Github Actions

This repository is set up with Github Actions CI to automatically build the mod for you every commit. This requires a Github repository, for obvious reasons. To get a jar file that works for every platform, do the following:

  1. Make a Github repository with your mod name, and upload the contents of this repo to it. Perform any modifications necessary, then commit and push.
  2. Check the «Actions» tab on your repository page. Select the most recent commit in the list. If it completed successfully, there should be a download link under the «Artifacts» section.
  3. Click the download link (should be the name of your repo). This will download a zipped jarnot the jar file itself [2]! Unzip this file and import the jar contained within in Mindustry. This version should work both on Android and Desktop.

Building locally takes more time to set up, but shouldn’t be a problem if you’ve done Android development before.

  1. Download the Android SDK, unzip it and set the ANDROID_HOME environment variable to its location.
  2. Make sure you have API level 30 installed, as well as any recent version of build tools (e.g. 30.0.1)
  3. Add a build-tools folder to your PATH. For example, if you have 30.0.1 installed, that would be $ANDROID_HOME/build-tools/30.0.1 .
  4. Run gradlew deploy . If you did everything correctlly, this will create a jar file in the build/libs directory that can be run on both Android and desktop.

Please note that all dependencies on Mindustry, Arc or its submodules must be declared as compileOnly in Gradle. Never use implementation for core Mindustry or Arc dependencies.

  • implementation places the entire dependency in the jar, which is, in most mod dependencies, very undesirable. You do not want the entirety of the Mindustry API included with your mod.
  • compileOnly means that the dependency is only around at compile time, and not included in the jar.

Only use implementation if you want to package another Java library with your mod, and that library is not present in Mindustry already.

[1] On Linux/Mac it’s ./gradlew , but if you’re using Linux I assume you know how to run executables properly anyway.
[2]: Yes, I know this is stupid. It’s a Github UI limitation — while the jar itself is uploaded unzipped, there is currently no way to download it as a single file.

About

A template for Java (16-17) Mindustry mods.

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

deltanedas / ExampleJavaMod Public template

Mindustry Java mod that uses a Makefile rather than evil gradle.

License

deltanedas/ExampleJavaMod

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

A prototype Java Mindustry mod that works on Android and PC. Uses a small makefile rather than gradle.

Download a precompiled build here

Building for Desktop Testing

  1. Install JDK 14 and curl. If you don’t know how, look it up. If you already have any version of the JDK >= 8, that works as well. On Debian unstable, # apt install openjdk-14-jdk-headless curl
  2. Run $ make install
  3. Test the desktop-only version that has been installed. To build an Android-compatible version, you need the Android SDK. You can either let Github Actions handle this, or set it up yourself. See steps below.

This repository is set up with Github Actions CI to automatically build the mod for you every commit. This requires a Github repository, for obvious reasons. To get a jar file that works for every platform, do the following:

  1. Make a Github repository with your mod name, and upload the contents of this repo to it. Perform any modifications necessary, then commit and push.
  2. Check the «Actions» tab on your repository page. Select the most recent commit in the list. If it completed successfully, there should be a download link under the «Artifacts» section.
  3. Click the download with no suffix. This will download a zipped jarnot the jar file itself [1]! Unzip this file and import the jar contained within in Mindustry. This version should work both on Android and Desktop. If you want to cut disk usage select the jar for your platform.

This approach is more painful

  1. Download the Android SDK, unzip it and set the ANDROID_HOME environment variable to its location.
  2. Make sure you have API level 30 installed, as well as any recent version of build tools (e.g. 30.0.1)
  3. Add a build-tools folder to your PATH. For example, if you have 30.0.1 installed, that would be $ANDROID_HOME/build-tools/30.0.1 .
  4. Run $ make . If you did everything correctly, this will create a jar file that can be run on both Android and desktop.

[1]: Yes, I know this is stupid. It’s a Github UI limitation — while the jar itself is uploaded unzipped, there is currently no way to download it as a single file.

About

Mindustry Java mod that uses a Makefile rather than evil gradle.

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

A prototype Java Mindustry mod that works on Android and PC

Gdeft/ExampleJavaMod

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

A prototype Java Mindustry mod that works on Android and PC.

Building for Desktop Testing

  1. Install JDK 14. If you don’t know how, look it up. If you already have any version of the JDK >= 8, that works as well.
  2. Run gradlew jar [1].
  3. Your mod jar will be in the build/libs directory. Only use this version for testing on desktop. It will not work with Android. To build an Android-compatible version, you need the Android SDK. You can either let Github Actions handle this, or set it up yourself. See steps below.

Building through Github Actions

This repository is set up with Github Actions CI to automatically build the mod for you every commit. This requires a Github repository, for obvious reasons. To get a jar file that works for every platform, do the following:

  1. Make a Github repository with your mod name, and upload the contents of this repo to it. Perform any modifications necessary, then commit and push.
  2. Check the «Actions» tab on your repository page. Select the most recent commit in the list. If it completed successfully, there should be a download link under the «Artifacts» section.
  3. Click the download link (should be the name of your repo). This will download a zipped jarnot the jar file itself [2]! Unzip this file and import the jar contained within in Mindustry. This version should work both on Android and Desktop.

Building locally takes more time to set up, but shouldn’t be a problem if you’ve done Android development before.

  1. Download the Android SDK, unzip it and set the ANDROID_HOME environment variable to its location.
  2. Make sure you have API level 30 installed, as well as any recent version of build tools (e.g. 30.0.1)
  3. Add a build-tools folder to your PATH. For example, if you have 30.0.1 installed, that would be $ANDROID_HOME/build-tools/30.0.1 .
  4. Run gradlew deploy . If you did everything correctlly, this will create a jar file in the build/libs directory that can be run on both Android and desktop.

[1] On Linux/Mac it’s ./gradlew , but if you’re using Linux I assume you know how to run executables properly anyway.
[2]: Yes, I know this is stupid. It’s a Github UI limitation — while the jar itself is uploaded unzipped, there is currently no way to download it as a single file.

About

A prototype Java Mindustry mod that works on Android and PC

Источник

Оцените статью