Need some help Importing Sponge into IntelliJ

Oh I understand, I actually Just send my plugin via ssh for testing, I’ll see if I can figure it out. In the mean time hopefully someone else knows how.

1 Like

SO I came across this, a little busy so can’t test it but it might be what you’re looking for.

pie_flavor has recommended it in a past post.

A little shameless self-promotion, I created some tutorials. Now while I am on windows and, based on those tutorials above it seems like you’re on OS X, I still believe they could be much of use to you.
You can check them out here

1 Like

No Shame in Helping out the community :stuck_out_tongue: You beat me to making videos.

1 Like

Wow, I do not believe it. I have already came across your videos and watched them a few times now. They are well put together. Thanks for replying although I am on Windows 10 I did not make the tutorials above.

Thanks. Im just about to go to sleep soon so if you are able to test it before I do that would be great.

So i watched through your videos, this is pretty much the default way I think mostly everyone does, I think what we were talking about (atleast me) is that you used to be able to run a build script that what just take your src files put them in with the sponge server source and start the server completely from your work space, without having to manage anything externally. But seriously pretty good quality.

YesI know exactly what you’re talking about and it is how I run and debug my plugins, with run configurations in intelliJ is what I assume you’re talking about?

The way I currently do this, not saying this is the best, but I create a new Run Configuration (Gradle) I add three things to the before launch area: Build ‘PLUGIN_NAME’ Artifact, Run Gradle Task ‘PLUGIN_NAME’ Build, and I then create an external tool as you will see that option show up. Within the external tool window I created a new one Called Start Server, set the program to my servers start.bat and set my working directory to the server directory. After this you should have three things in this order, from top to bottom, Build Artifact, Run Gradle Task, and External Tool.

You might ask why I have run gradle task as a before launch task and thats because it would be kind of pointless to build in gradle after the server started and have a pointless server started.

Two ways of doing it:

  1. SpongeStart Gradle plugin works out of the box, it’s really handy! I prefer this over method 2.

  2. Clone SpongeForge or -Vanilla as described in the README on GitHub, also do the setupDecompWorkspace. Then clone your plugin into the Sponge folder. Import the Sponge project in IntelliJ, and import your plugin as a module. Set that new module as a dependency of ‘Sponge java_6’ or something like that(I should do some screenshots). Then execute gradle genIntelliJ. A new run configuration appeared. Edit it to have that ‘sponge java6’ as module. Then you can run the configuration and the server should start with your plugin.

Thanks everyone for the responses. I will try and figure it out using the video from intronate67 and using the plugin from RandomByte.

Hey I posted this earlier and just got around to testing it, but It won’t seem to work for me when I run my build.gradle, did you run into anything like this?

What do you mean by ‘running’ build.gradle?

I seem to be getting the same issue. Could you provide a copy of your build.gradle?

As MUCH information as you would be kind enough to provide. link the video here and ill watch it for sure.

Yeah including how to debug the plugin would be nice. :slight_smile:

This Is great stuff :slight_smile:

As you said there are other ways to debug your plugin. Here is one:

Instead of building a new artifact just add the plugin to the classpath. Forge will automagically load it.

The easiest way to do that is to create a new empty module.
(Don’t edit SpongeForge_java6 as it gets reset each time you do a gradle import)
Then add the SpongeForge_java6 module and your plugins module to it as a dependency.

Use this newly created module as classpath for your run configuration.
Add before launch “build project” (if you removed it)
done.

3 Likes

Indeed. The deed is done, your latest waxing and profundity now graces the SpongeDocs Plugin Tutorials page. I’ve just linked the playlist, it should speak for itself (literally). May the sound of Sponge Metal ring throughout the holiday season!

3 Likes

Just finished Part 2 of your playlist, and things were working up until they weren’t :confused: :slight_smile:

$ ./gradlew setupDecompworkspace --refresh-dependencies
Downloading https://services.gradle.org/distributions/gradle-3.3-bin.zip

Unzipping C:\Users\John.gradle\wrapper\dists\gradle-3.3-bin\64bhckfm0iuu9gap9hg 3r7ev2\gradle-3.3-bin.zip to C:\Users\John.gradle\wrapper\dists\gradle-3.3-bin\ 64bhckfm0iuu9gap9hg3r7ev2
Starting a Gradle Daemon (subsequent builds will be faster)
Download https://plugins.gradle.org/m2/gradle/plugin/net/minecrell/licenser/0.3/ licenser-0.3.pom
Download https://plugins.gradle.org/m2/com/github/jengelman/gradle/plugins/shado w/1.2.4/shadow-1.2.4.pom
Download https://plugins.gradle.org/m2/gradle/plugin/org/spongepowered/spongegra dle/0.8.1/spongegradle-0.8.1.pom
Download https://repo.spongepowered.org/maven/org/spongepowered/mixingradle/0.4- SNAPSHOT/mixingradle-0.4-20160617.140650-4.pom
Download https://plugins.gradle.org/m2/org/spongepowered/plugin-meta/0.4.1/plugi n-meta-0.4.1.pom

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project ‘SpongeForge’.

Could not resolve all dependencies for configuration ‘:classpath’.
Could not resolve net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT.
Required by:
project :
Could not resolve net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT.
Unable to load Maven meta-data from http://files.minecraftforge.net/m aven/net/minecraftforge/gradle/ForgeGradle/2.2-SNAPSHOT/maven-metadata.xml.
Could not GET ‘Minecraft Forge repository forge/gradle/ForgeGradle/2.2-SNAPSHOT/maven-metadata.xml’.
Connect to files.minecraftforge.net:80 [files.minecraftforge.ne t/158.69.55.219] failed: Connection timed out: connect

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Anyone able to shed any supporting light upon what to try?
It’s been pretty much a case of rabbit-see, rabbit-do here, so anything overtly technical may leave me twitching my nose and tail :smile:

EDIT:

I ran “./gradlew setupDecompworkspace --refresh-dependencies” again and it’s doing a lot more now.
Will post a pastebin of what occurs after it’s finished, although it looks set to function based on the little I understand of what I can read.

Link for it running second time through - if it provides help in some way :slight_smile:
http://pastebin.com/hV3ar2zd