Skip to content

IntelliJ Environment Setup

Snowynx edited this page Jun 1, 2019 · 9 revisions

Setting up IntelliJ for Slay The Spire Modding

IntelliJ will be the environment in which you will do all your modding. Download it here.

Starting a new project

Once you start IntelliJ for the first time. you'll be greeted by this very important theme selection window.

Using Darcula is advised as the light theme will burn your eyes after staring at it for too long.

After that IntelliJ will give you the option to Create New Project.

Set the Project Type on the left to Maven and set your Project SDK to Java 1.8. (Navigate to the folder where you installed the JDK.)

Go ahead and give your mod whatever ID you desire.

Then save it into your my_mods directory.

It'll open up to your newly generated pom.xml file. Go ahead and copy paste this example pom.xml into that space. Then press Import Changes in the bottom right corner.

Example pom.xml: Link

Dependencies

Copy ModTheSpire.jar and BaseMod.jar into the lib folder you created earlier. Then, go to your Slay The Spire folder and copy desktop-1.0.jar into the lib folder too.

Now press Ctrl+Alt+Shift+S to open up Project Structure and click on Modules on the left. Go ahead and check off all your dependencies and hit Apply.

All your code will go into your_mod\src\main\java. Simply create a new file by right clicking on the directory and going to New > Class. You can create directories by doing New > Directory.

Building

You can build your project by going to View > Tool Windows > Maven Projects. It will open up this side window:

Expand Lifecycle and double click package

It will then output a .jar you can use as a mod to the directory specified by your pom.xml.

<target>
    <copy file="target/ExampleMod.jar" tofile="../lib/ExampleMod.jar"/> // tofile location is where you can find your compiled .jar file
</target>

Actually Modding!

You can start making your mod at the next part of the tutorial here