SpongeStartV2

Continuing the discussion from SpongeStart Gradle plugin:

GitHubstars GitHubissues Latest Version

:package: Major differences

  • SpongeVanilla issues should be solved (thanks to RandomByte).
  • Removed acceptEula task (Eula is now accepted by default upon server setup, avoiding the creation of an eula.txt in the forge folder while you’re setting up a vanilla server).
  • Mercurius is deleted during forge server setup.
  • downloadSpongeVanilla is a separate task now.
  • New properties in build.gradle (see below).
  • Tweaked configs after server setup (see below).
  • It’s faster
  • Minor fixes

:elephant: build.gradle

plugins {
    id 'com.qixalite.spongestart2' version '4.0.0'
}

spongestart { 
    minecraft '1.12.2'
}

Note: you have to define either minecraft or the sponge specific version for the platform you plan to setup.

:hammer_and_wrench: ADVANCED

Not really advanced, but here’s the full list of build.gradle properties.

spongestart {
    minecraft ''            //minecraft version 
    spongeForge ''          //SpongeForge version
    spongeVanilla ''        //SpongeVanilla version
    online ''               //online-mode (true/false). Default to true
    forgeServerFolder ''    //absolute path to the forge server folder. Default to run/forge
    vanillaServerFolder ''  //absolute path to the vanilla server folder. Default to run/vanilla
    cacheFolder ''          //absolute path to the SpongeStart cache folder for downloads. Default to .gradle/caches/SpongeStart
}

:wrench: TWEAKS

server.properties:

max-tick-time=-1
snooper-enabled=false
allow-flight=true

forge.cfg:

general {
    B:disableVersionCheck=true
}
version_checking {
    B:Global=false
}

:gear: Tasks

cleanForgeServer - Clean Forge server folder
cleanSpongeStartCache - Clean SpongeStart cache folder
cleanVanillaServer - Clean Vanilla server folder
downloadForge - Download Forge jar
downloadSpongeForge - Download SpongeForge jar
downloadSpongeVanilla - Download SpongeVanilla jar
GenerateForgeRun - Generate Forge run configuration to start a SpongeForge server
GenerateVanillaRun - Generate Vanilla run configuration to start a SpongeVanilla server
setupForgeServer - Setup a SpongeForge server
setupVanillaServer - Setup a SpongeVanilla server

Source/Issue: GitHub - ImMorpheus/SpongeStart: Replaced by https://github.com/SpongePowered/VanillaGradle

Todo:

  • A̶d̶d̶ ̶s̶p̶o̶n̶g̶e̶ ̶c̶o̶n̶f̶i̶g̶ ̶t̶w̶e̶a̶k̶s̶
  • A̶d̶d̶ ̶f̶o̶r̶g̶e̶ ̶c̶o̶n̶f̶i̶g̶ ̶t̶w̶e̶a̶k̶s̶
  • C̶o̶d̶e̶ ̶c̶l̶e̶a̶n̶u̶p̶
  • F̶i̶x̶ ̶a̶n̶n̶o̶y̶i̶n̶g̶ ̶e̶x̶c̶e̶p̶t̶i̶o̶n̶ ̶d̶u̶r̶i̶n̶g̶ ̶t̶h̶e̶ ̶f̶i̶r̶s̶t̶ ̶e̶x̶e̶c̶u̶t̶i̶o̶n̶ ̶o̶f̶ ̶S̶t̶a̶r̶t̶V̶a̶n̶i̶l̶l̶a̶S̶e̶r̶v̶e̶r̶
7 Likes

@Morpheus If I just want to setup a test/debug configuration, What are the tasks I need to run? Is there a way to make a task / config that will do all the tasks if necessary in order, and just have a “vanillaGo” or “forgeGo” task?

I think you are looking for

GenerateForgeRun - Generate Forge run configuration to start a SpongeForge server
GenerateVanillaRun - Generate Vanilla run configuration to start a SpongeVanilla server

(this will create the run configs but won’t actually setup any jar/server)

If, instead, you want to setup a vanilla/forge server then you are looking for

setupForgeServer - Setup a SpongeForge server
setupVanillaServer - Setup a SpongeVanilla server

(this will download the necessary jars and create the run configuration to launch the server)

PS: I forgot to write the task list here. Thanks.

Sorry I wasn’t clear.

I was thinking about a task that did generate (if generate was needed) did setup (if setup was needed) then ran the server.

Essentially, simplifying what beginner plugin devs need to know in regards to the setup.

Worked out the issue I was having. As my test plugin ChatClear was it’s own module, in a parent IntelliJ project, Generating the runs was placing the files into the module, rather then the project. :frowning:

Not sure if this is fixable.

I was thinking about a task that did generate (if generate was needed) did setup (if setup was needed) then ran the server.

That’s setupForgeServer/setupVanillaServer.

Worked out the issue I was having. As my test plugin ChatClear was it’s own module, in a parent IntelliJ project, Generating the runs was placing the files into the module, rather then the project. :frowning:
Not sure if this is fixable.

Feel free to open an issue. You can customize pretty much every parameter of a run config, but if they are not generating then it’s a problem.

I’m a complete beginner when it comes to Gradle in general, so please call me out for being a total idiot if needs be, but I’m not sure what I’m doing wrong. It’s a miracle I’m even getting my project to build at all.

I want to generate the “Run Configurations”, so I run the “GenerateVanillaRun” command as I figured from the GitHub page, but nothing really happens. There aren’t any errors but I don’t get any new run configurations either.

Here’s a gfy to show what I’m doing. Maybe someone can point at what I’m doing wrong from that.

Thanks in advance :heart:

EDIT:

I ran “setupVanillaServer” directly and that seems to have placed a vanilla server in the /run/vanilla folder. Problem is I’m not sure how to actually run the server and have it attach to IntelliJ so I can debug the server.

Ah right, sorry. I was stupid, after running GenerateVanillaRun I was looking for a Gradle Run Configuration, but I now found the new “StartVanillaServer” configuration. I made sure to build my project and ran setupVanillaServer and that part seems to work.

The problem now is that when I try to run it, I just get the error:

Error: Could not find or load main class Gradle
(https://i.imgur.com/MB2ysLn.png)

The generated run configuration looks like this:

I am not sure if the warning regarding not being able to find “server” is relevant, nor do I know how to fix that.

The entire VM options string if you need it: https://pastebin.com/bbMc06v6

Here’s my entire build.grade file: build.gradle · GitHub

I appreciate you trying to help. Please excuse my lack of knowledge

EDIT:
No idea if it’s relevant, but I’m doing what I can to try to figure this out. Noticed I now have an unresolved dependency(?):

I have a \.gradle folder but not a \.gradle\start folder. I tried reinstalling Gradle but no difference. Not sure if this is relevant, grasping at straws here!

Version 4.0.0 released.

I just want to clarify a few things with this update and the versioning change

  • When setting up a SpongeForge server, forge recommended (not latest) will be used.
  • You can’t use forge latest (unless you do it manually) but it’s not supported by Sponge anyway.
  • SpongeStart will now download the latest recommended build of Sponge.
  • If you want to use a RC version of Sponge, you need to specify the version in the spongestart block.
  • 1.10 and 1.11 are no longer supported, but you can still setup a server by specifying the version in the spongestart block.
  • Run configurations are no longer generated with the setupXServer task (you need to run the genXRun task separately). If you’re not using IntelliJ, you can setup a server and manually create the run configurations (but you’re on your own)
1 Like