Skip to content

Setting up workspace

mineLdiver edited this page Jul 23, 2023 · 3 revisions

We're going to use IntelliJ IDEA throughout this wiki, as it's the most supported IDE for modding Minecraft.

To setup a StationAPI workspace, you simply need to use the template repo.

There are two approaches to this.

1. Generating a GitHub Repo

It involves creating your own GitHub repo for your StationAPI workspace.

It's the better approach if you plan to make your mod open source or want any sort of GitHub integration from the start.

To generate your own GitHub repo with StationAPI:

  1. Go to the template repo's page and use Use this template -> Create a new repository buttons.
  2. Choose the repo's name, description and visibility, and click Create repository.
  3. Open IntelliJ and click Get from VCS button (or File -> New -> Project from Version Control if you have a project open already).
  4. Choose GitHub, login if you haven't already, then choose the repo you've just created and click Clone.
  5. Wait until the project finishes importing.

2. Getting a local workspace

If you don't want any GitHub integration or want to add it later:

  1. Go to the template repo's page and use Code -> Download ZIP buttons.
  2. Unzip the folder inside of the file you've just downloaded, and rename.
  3. Open IntelliJ, click Open and choose the folder you've downloaded.
  4. Wait until the project finishes importing.

Troubleshooting

Wrong Java version

If during project import an error occurred related to wrong Java version being used:

  1. Go to File -> Project Structure -> Project Settings -> Project
  2. Set SDK to a JDK 17, preferably Temurin.
    • If you don't have any JDK 17 in the SDK list:
      • Click Add SDK -> Download JDK.
      • Choose Version 17 and Vendor Eclipse Temurin (AdoptOpenJDK HotSpot) and click Download.
  3. Close Project Structure and open File -> Settings -> Build, Execution, Deployment -> Build Tools -> Gradle.
  4. Make sure Gradle JVM is set to Project SDK.
  5. Close settings and open Gradle tab on the right sidebar.
  6. Click the Reload All Gradle Projects button and wait until the project finishes importing.