How to Set Up and Run SpongeForge: A Comprehensive Guide

Dec 12, 2023 | Programming

Welcome to the ultimate guide on setting up and running SpongeForge, a powerful Forge implementation of the Sponge API. Here, we’ll take you through the steps for cloning the repository, building the project, and troubleshooting common issues along the way.

Prerequisites

Cloning the Repository

To properly clone your SpongeForge project, follow these steps:

  1. Execute the command to clone the repository recursively:
  2. git clone --recursive https://github.com/SpongePowered/SpongeForge.git
  3. Navigate to the SpongeForge directory:
  4. cd SpongeForge
  5. Copy the pre-commit script into the Git hooks directory:
  6. cp scripts/pre-commit .githooks

Setup Your Environment

Before diving into building SpongeForge, you need to set up the environment:

.gradlew setupDecompWorkspace --refresh-dependencies

Remember, SpongeForge utilizes Gradle as its build system, which manages dependencies and build processes seamlessly.

Integrating with Your IDE

For Eclipse

  1. Execute:
  2. .gradlew eclipse
  3. Import Sponge as an existing project (File > Import > General).
  4. Select the root folder for SpongeForge, ensuring “Search for nested projects” is enabled.
  5. Check Sponge when the building process completes and click **Finish**.

For IntelliJ

  1. Ensure the Gradle plugin is enabled (File > Settings > Plugins).
  2. Navigate to File > New > Project from Existing Sources > Gradle and select the root folder for SpongeForge.
  3. Ensure “Use default gradle wrapper” is selected.
  4. Select “Create separate module per source set”.

Running SpongeForge

For Eclipse

  1. Running .gradlew eclipse should have created the appropriate run configurations.
  2. When you launch the server for the first time, it will automatically shut down. Modify eula.txt to set eula=true to agree to the Mojang EULA.

For IntelliJ

  1. Run:
  2. .gradlew genIntelliJRuns
  3. Restart IntelliJ IDEA or refresh the project to generate the run configuration.
  4. Remember to modify eula.txt to set eula=true to comply with Mojang’s EULA.

Building SpongeForge

After setting up your environment, simply run:

.gradlew

This will compile your SpongeForge project. On Windows, remember to use gradlew instead of .gradlew to trigger the Gradle wrapper.

The compiled JAR files can be found in .build/libs, with spongeforge-x.x.x-x-x.x-x.jar being the most relevant for your needs.

Updating Your Clone

To stay updated with the official repository, follow these three steps:

  1. Execute:
  2. git pull
  3. Update submodules:
  4. git submodule update --recursive
  5. Run the setup command:
  6. .gradlew setupDecompWorkspace --refresh-dependencies

Troubleshooting

If you encounter issues, consider these tips:

  • To resolve missing dependencies, restarting your IDE can refresh the Gradle plugin to pull in the latest dependencies.
  • If things still aren’t working, deleting the .gradle folder in your user directory can help. Run through the setup steps again or try:
  • gradle cleanCache
  • For persistent problems not mentioned in this guide, don’t hesitate to join our IRC channel for additional support.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Conclusion

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox