A collection of How-To Videos for Sponge Development

Actually few questions.

  1. Do I make plugins/mods on the same project. If so how?
  2. How does the hot-reload works?
  3. How do I update the Sponge?
  4. Which JDK version should I use(There are some errors with the Optional type being not compatible?

Thanks again.

Thanks a lot man! This helps me out!

  1. Use git to pull updates.

  2. JDK 8

  1. I’ll be making a video shortly/soon to make an example plugin with this.

  2. Hot-reloading works with your plugin code, the Sponge mixins themselves can not be hot-swapped.

  3. Through the VCS control buttons, basically the following steps:

Select ‘Pull…’

And you get the following dialogue box.

  1. I’m using JDK 7 in the videos, but JDK 8 is perfectly fine to use. When using JDK 8 make absolutely sure that you’re using com.google.common.base.Optional and not java.util.Optional otherwise your plugin will require using JRE 8 and of course will not be compatible with any servers running JRE 6 or 7.
1 Like

Makes perfect sense. For hot-reload, do I just have to save the project or build the project of the plugin/mod?

Cool. You should do a video on configuring IntelliJ an awesome way. I have floating nav tree on ctrl+t, new on ctrl+n and double shift for navigation.

Added a new video on debugging and hot swapping with Sponge and IntelliJ.

Doesn’t seem to work for me. I get this error whenever I am trying to start up my plugin module server.

May 04, 2015 5:57:56 PM com.google.inject.internal.MessageProcessor visit
INFO: An exception was caught and reported. Message: java.lang.ClassCastException: net.minecraftforge.fml.common.MinecraftDummyContainer cannot be cast to org.spongepowered.api.plugin.PluginContainer
java.lang.ClassCastException: net.minecraftforge.fml.common.MinecraftDummyContainer cannot be cast to org.spongepowered.api.plugin.PluginContainer

3 Likes

@gabizou Thank you for making these videos and forgive me I’m extremely new to programing.
Regarding the first video I ran to this error during importing from Gradle.

Could not read script '...\GitHub\Sponge\SpongeCommon\gradle\implementation.gradle' as it does not exist.

Did I miss a prerequisite somewhere?

The Fix

When running the server:

How can you add arbitrary plugins into the server? For example, I usually have WorldEdit/WorldGuard + a few others as my base plugin set when developing. Can you do the same here?

Make sure the git submodules are initialized.
git submodule update --init --recursive

1 Like

Much like you would on a normal server, throw the binaries into the mods folder.

Is there any other ways to do it? This way doesn’t seem to work for me.

I can’t seem to launch the server within IntelliJ.
I verified that Java JDK is correctly installed.

When I run sponge server in IntelliJ using javac 1.8.0_45 I get a ton of errors like:
“Error:(36, 55) java: generics are not supported in -source 1.3
(use -source 5 or higher to enable generics)”

Any one?

The Fix

Nevermind (oops). Great post!

How did you guys add the module? Did you also put all the dependencies or what?

Make sure your project language level is correct.

Either use the + to add a new module or import a module.

I am still crashing with no luck.

Crash Report

Thank you for all your help. The project is now on the correct language level. Although I’m still running into some errors Keeping the server from starting. Examples:

…Sponge\SpongeCommon\SpongeAPI\src\main\java\org\spongepowered\api\util\annotation\CatalogedBy.java
Error:(33, 24) java: cannot find symbol
symbol: class Nonnull
location: package javax.annotation
Error:(41, 2) java: cannot find symbol
symbol: class Nonnull
…\GitHub\Sponge\SpongeCommon\SpongeAPI\src\main\java\org\spongepowered\api\data\DataManipulator.java
Error:(27, 30) java: package com.google.common.base does not exist
Error:(61, 5) java: cannot find symbol
symbol: class Optional
location: interface org.spongepowered.api.data.DataManipulator

I’m guessing a misconfigured setting or missing dependency? I follow the instructions step-by-step it seems so straightforward.

I had the same problem and I had to refresh the gradle projects. That’s the menu that is docked.