Issues getting run configuration to appear in IntelliJ for pulgin debugging

Hello,

I have been working on getting plugin debugging to work, but I have been having some trouble. I have followed the instructions for getting it to work.

Here is a summary of what I have done so far:

  • I have cloned the SpongeForge repo recursively so that it is on the same level as my plugin project directory. (Would it be a better idea to have it as a nested repo within my main repo?)
  • I have run ./gradlew setupDecompWorkspace --refresh-dependencies
  • I have imported the SpongeForge module to my plugin project
  • I have added myplugin_main as a dependency to SpongeForge_main
  • I have run ./gradlew genIntelliJRuns

Despite doing this and restarting IntelliJ, the run configurations don’t appear in IntelliJ. Is there something that I could be overlooking that would cause this issue?

It’s possible that adding that Intellij isn’t picking up on the run configurations because SpongeForge is a module of an existing project.

However, it’s straightforward to create them yourself. Simple create a new Application run configuration, and select SpongeForge_main as the module classpath. To start a dedicated server, use GradleStartServer (without any package name) as the main class. To start a dedicated client, use GradleStart

I have made a run configuration using what you suggested and it is able to launch the sever, but before it is finished launching, I get this exception: java.lang.IllegalStateException: Sponge has not been initialized!

How can I fix this issue?

Sorry, I forgot the last part: add "-Dfml.coreMods.load=“org.spongepowered.mod.SpongeCoremod” to the VM options field.

Adding that argument fixed the issue that I was having initially, but I am now encountering this error: [21:38:08] [main/FATAL] [mixin]: Mixin apply failed mixins.forge.core.json:common.MixinSpongeImplHooks -> org.spongepowered.common.SpongeImplHooks: org.spongepowered.asm.mixin.transformer.throwables.InvalidMixinException Overwrite target "onUseItemTick" was not located in target class org/spongepowered/common/SpongeImplHooks org.spongepowered.asm.mixin.transformer.throwables.InvalidMixinException: Overwrite target "onUseItemTick" was not located in target class org/spongepowered/common/SpongeImplHooks

Make sure that you’ve properly initialized all of the SpongeForge submodules with:

git submodute init
git submodule update --recrusive

If you’re still having that issue, please upload your debug.log

It turns out the issue that I was having was the result of having checked out the stable-7 branch on the outermost repo for SpongeForge but having all the other ones be still on the bleeding branch. I have changed all of them to be on the bleeding branch instead, and that solved it.

Now, though, I am encountering another issue. Since this one appears to be pretty extensive, here is the text from the server start up: https://pastebin.com/Vr18Df5y

I decided to just completely clone the repo again, and that allowed the server to start properly.

I am still getting the following exception, though:

[Sponge]: Could not pass FMLServerStartedEvent to Plugin{id=inventorysetoperationstest, name=Inventory Set Operations Test, version=0.0.0, description=A plugin to test inventory set operations, source=C:\Users\ethan\Documents\minecraft-syndicates\classes\production\testplugins_main}
java.lang.IllegalStateException: This should be the first slot only!
	at com.google.common.base.Preconditions.checkState(Preconditions.java:444) ~[guava-21.0.jar:?]
	at org.spongepowered.test.inventory.InventorySetOpsTest.testIntersect(InventorySetOpsTest.java:88) ~[InventorySetOpsTest.class:?]
	at org.spongepowered.test.inventory.InventorySetOpsTest.onStart(InventorySetOpsTest.java:59) ~[InventorySetOpsTest.class:?]
	at org.spongepowered.common.event.listener.GameStartedServerEventListener_InventorySetOpsTest_onStart47.handle(Unknown Source) ~[?:?]
	at org.spongepowered.common.event.RegisteredListener.handle(RegisteredListener.java:95) ~[RegisteredListener.class:?]
	at org.spongepowered.mod.event.SpongeModEventManager.post(SpongeModEventManager.java:383) [SpongeModEventManager.class:?]
	at org.spongepowered.mod.event.SpongeModEventManager.extendedPost(SpongeModEventManager.java:420) [SpongeModEventManager.class:?]
	at org.spongepowered.mod.event.SpongeModEventManager.post(SpongeModEventManager.java:404) [SpongeModEventManager.class:?]
	at org.spongepowered.common.SpongeImpl.postEvent(SpongeImpl.java:223) [SpongeImpl.class:?]
	at org.spongepowered.mod.SpongeMod.onStateEvent(SpongeMod.java:246) [SpongeMod.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_172]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_172]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_172]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_172]
	at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) [guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) [guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) [guava-21.0.jar:?]
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) [guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) [guava-21.0.jar:?]
	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) [guava-21.0.jar:?]
	at com.google.common.eventbus.EventBus.post(EventBus.java:217) [guava-21.0.jar:?]
	at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:218) [LoadController.class:?]
	at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:196) [LoadController.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_172]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_172]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_172]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_172]
	at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) [guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) [guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) [guava-21.0.jar:?]
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) [guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) [guava-21.0.jar:?]
	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) [guava-21.0.jar:?]
	at com.google.common.eventbus.EventBus.post(EventBus.java:217) [guava-21.0.jar:?]
	at net.minecraftforge.fml.common.LoadController.redirect$onPost$zza000(LoadController.java:560) [LoadController.class:?]
	at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:135) [LoadController.class:?]
	at net.minecraftforge.fml.common.Loader.serverStarted(Loader.java:807) [Loader.class:?]
	at net.minecraftforge.fml.common.FMLCommonHandler.handleServerStarted(FMLCommonHandler.java:301) [FMLCommonHandler.class:?]
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:554) [MinecraftServer.class:?]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_172]

It doesn’t seem to inhibit my ability to run and debug my plugin, though.

Thank you for all your help with helping me get this to run!