-
Notifications
You must be signed in to change notification settings - Fork 12
Tutorial: Contributing
This tutorial quickly shows you how to set up a fork of Gale so that you can make a pull request that modifies existing patches or adds new patches.
ℹ️ This tutorial is written for Gale, but you can follow the same steps on any other fork! |
✔ You need to know how to open a command terminal and run commands
✔ You need to know how to use Git.
If you don't know Git, check out a tutorial online (for example this one).
Specifically, you should know how to do an interactive rebase in Git: git rebase -i
(Check out this video, for example)
✔ You will need 6+ GB of free RAM
✔ You must have installed Java JDK 17 or higher
✔ You must have installed IntelliJ IDEA
(Other IDEs are much harder to use for this project)
✔ (Windows only) On Windows: you should install WSL:
● Open PowerShell and type wsl --install
● Open a wsl command line (type wsl
into Start and press Enter)
● Install Java JDK 17 on WSL by running this command in the WSL command window:
sudo apt-get update && sudo apt-get upgrade && sudo apt install openjdk-17-jdk openjdk-17-jre
● Do everything in this tutorial on WSL
(It is possible without WSL, but 100 things can go wrong, so I don't recommend it)
Setting up the project is not a one-click step, but it's pretty easy.
-
Click Fork in the top-right corner of the Gale project page
-
Click Create a new fork
-
Click Create fork
You will now be on the repository page for your own fork of Gale,
(for example: onhttps://github.com/<username>/Gale
)
-
On your own fork's page, click the green Code button
TODO IMAGE
-
Copy the URL shown
(which will be something likehttps://github.com/<username>/Gale
)TODO IMAGE
-
Open IntelliJ IDEA
-
File > New > Project from Version Control...
-
In the URL field, paste the URL you copied earlier
(for example, I would pastehttps://github.com/MartijnMuijsers/Gale.git
) -
Choose the directory to place Gale in
ℹ️ (Windows only) Remember that you should use a WSL directory like
\\wsl$\Ubuntu-20.04\home\martijn\minecraft_stuff\Gale
-
Clone
Now, if you don't know how Paperweight works yet, read through this simple explanation. Then, continue with the next step.
To apply the patches, you can use the command line, or you can use the Gradle functions in IntelliJ (by default, there is a vertical Gradle button on the right).
Normally, I use the command line, because we also need to do interactive rebases in Git anyway.
I will primarily use the command line below, except when setting up IntelliJ properly (because IntelliJ sometimes only understands Gradle projects when you build the project from within IntelliJ at least once).
-
In a command terminal, navigate to the
Gale
folder you just created
(if you typels
and you see a file called.editorconfig
and a file calledgradlew
, you are in the right folder)
ℹ️ (Windows only) Remember that you should use a WSL command window
-
Run the following command:
./gradlew applyPatches
⚠️ This step needs a lot of memory!
For some systems, you need at least 6+ GB of free RAM, but on other systems,
you need at least 10+ GB of free RAM!
If you do not have enough memory, you will get a very vague error saying the task failed, without an explanation.
This happens because decompiling the vanilla and Spigot jars takes a lot of memory.
Every time Minecraft or Spigot is updated, the jars need to be decompiled one time.The code should now be ready to use in the
gale-server
andgale-api
folders.
- We need to make sure the project is properly set up in IntelliJ. Maybe it immediately works on your machine.