Granite is the SpongeAPI implementation for Vanilla Minecraft.
- IRC: #sponge or #spongedev on irc.esper.net
To clone Granite, simply run git clone [email protected]:SpongePowered/Granite.git
Note: If you do not have Gradle installed then use ./gradlew for Unix systems or Git Bash and gradlew.bat for Windows systems in place of any 'gradle' command.
For Eclipse
- Run
gradle setupDecompWorkspace --refresh-dependencies
- Make sure you have the Gradle plugin installed (Help > Eclipse Marketplace > Gradle Integration Plugin)
- Import Granite as a Gradle project (File > Import)
- Select the root folder for Granite and click Build Model
- Check Granite when it finishes building and click Finish
For IntelliJ
- Run
gradle setupDecompWorkspace --refresh-dependencies
- Make sure you have the Gradle plugin enabled (File > Settings > Plugins).
- Click File > Import Module and select the build.gradle file for Granite.
Note: The following is aimed to help you setup run configurations for Eclipse and IntelliJ, if you do not want to be able to run Granite directly from your IDE then you can skip this.
For Eclipse
- Go to Run > Run Configurations.
- Right-click Java Application and select New.
- Set the current project.
- Set the name as
Granite (Client)
and apply the information for Client below. - Repeat step 1 through 4, then set the name as
Granite (Server)
and apply the information for Server below. - When launching the server for the first time, it will shutdown by itself. You will need to modify the server.properties to set onlinemode=false and modify the eula.txt to set eula=true (this means you agree to the Mojang EULA, if you do not wish to do this then you cannot run the server).
For IntelliJ
- Go to Run > Edit Configurations.
- Click the green + button and select Application.
- Set the name as
Granite (Client)
and apply the information for Client below. - Repeat step 2 and set the name as
Granite (Server)
and apply the information for Server below. - When launching the server for the first time, it will shutdown by itself. You will need to modify the server.properties to set onlinemode=false and modify the eula.txt to set eula=true (this means you agree to the Mojang EULA, if you do not wish to do this then you cannot run the server).
Client
Property | Value |
---|---|
Main class | GradleStart |
Program arguments | --noCoreSearch |
Working directory | ./run (Included in project) |
Module classpath | Granite (IntelliJ Only) |
Server
Property | Value |
---|---|
Main class | GradleStartServer |
Program arguments | --noCoreSearch |
Working directory | ./run (Included in project) |
Module classpath | Granite (IntelliJ Only) |
Note: If you do not have Gradle installed then use ./gradlew for Unix systems or Git Bash and gradlew.bat for Windows systems in place of any 'gradle' command.
In order to build Granite you simply need to run the gradle
command. You can find the compiled JAR files in ./build/libs
but in most cases
you'll only need 'granite-x.x.x-x.x.x.jar'.
A dependency was added, but my IDE is missing it! How do I add it?
If a new dependency was added, you can just restart your IDE and the Gradle plugin for that IDE should pull in the new dependencies.
Help! Things are not working!
Some issues can be resolved by deleting the '.gradle' folder in your user directory and running through the setup steps again, or even running
gradle cleanCache
and running through the setup again. Otherwise if you are having trouble with something that the README does not cover, feel free to join our IRC channel and ask for assistance.