I am currently trying to figure out, how I can use the HotSwap functionality.
I am using Intelij Idea and followed the whole tutorial from this series:
I made a local copy of the current stable 7.1 git repository and integrated my plugin as an artifact.
I am able to debug, but when I am using the “Reload changed classes” functionality, it tries to rebuild sponge and my plugin and I receive the following error:
Unable to find source java class: ‘C:\Users\gottw.gradle\caches\minecraft\net\minecraftforge\forge\1.12.2-14.23.5.2838\start\GradleStartServer.java’ because it does not belong to any of the source dirs: '[D:\SpongeForge\testmods\src\main\java]*
The strange thing is that the file at C:\Users\gottw.gradle\caches\minecraft\net\minecraftforge\forge\1.12.2-14.23.5.2838\start\GradleStartServer.java is present.
I am completely new to Intelij Idea and Sponge, but I would like to be able to use the HotSwap functionality. Does anybody of you have an idea what kind of problem I have and how I can solve it?
Has it something todo, that the project workspace is on disk D and the cache on C?
I think I have a guess as to what’s going on. Could you send a screenshot of the “External Libraries” section in the project pane? It should look something like this:
I updated IntelliJ IDEA and SpongeForge and now it builds the project without the described error. Now when I do some code changes in my plugin, I click on “Reloaded changed classes” and it rebuilds my plugin and SpongeFroge which causes the server to stop.
@JBYoshi or someone else, any idea left? I really want to continue developing our plugin. At the moment I have to restart the whole server for every line of code I change. It is really hard to make any progress. We migrated a Spigot plugin into Sponge with a lot of code and we need the HotSwap functionality to test and adjust the migrated code.
After months of testing I started to set up my sponge enviroment new. After doing all the steps mentioned in the tutorial, I coulnd’t get it running again. But I didn’t surrendered and figured after days of testing out that in the newest Intelij Idea IDE the option “Reload changed classes” doesn’t work for me. With the option “Recompile xxx.class” in the Build menu it worked without any of the errors I explained above. Now after months of pain I finally can continue my project.