SpongePowered / SpongeDocs

Documentation for Sponge and its Implementations
Creative Commons Attribution Share Alike 4.0 International
110 stars 116 forks source link

Debugging tutorial is overcomplicated #806

Open XakepSDK opened 5 years ago

XakepSDK commented 5 years ago

https://docs.spongepowered.org/stable/en/plugin/debugging.html This tutorial is completely wrong! You don't need to clone any sponge source code to just debug, everything you need is server jar and your plugin jar, that's all! Replace or remove it.

  1. Create new IDEA project or open existing
  2. Open 'project structure' window
  3. Click on 'artifacts' tab
  4. Add artifact with source from module
  5. Point artifact's build output directory to mods dir. of sponge installation
  6. Save
  7. Open 'run configurations' window
  8. Add new run configuration 'JAR Application (that should be in '+' dropbox)
  9. Point 'Path to jar' to your forge.jar or spongevanilla.jar
  10. Change 'Working directory' to a directory, where forge.jar or spongevanilla.jar located if you don't do this, your project directory will be littered with sponge/forge/minecraft files
  11. Open run configuration window again
  12. In bottom part of this window you will see '+', click on it and add your artifact
  13. Save
  14. Now you can run your plugin with debugging, just press green bug icon near launch button.
simon816 commented 5 years ago

That won't give you source code or the ability to set breakpoints in sponge/minecraft code.

XakepSDK commented 5 years ago

This will give source code and ability to set breakpoints up SF or SV code. This won't give you deobfuscated names or ability to set breakpoints in MC or Forge code. If don't know how can you debug code in JVM, i'm sure you don't need setting breakpoints in MC codebase or wanting deobfuscated names.

gabizou commented 5 years ago

This tutorial is completely wrong!

Your opinion. If someone does want to get a workspace with full code access, the docs are 100% right.

What I think the correct solution to the issue is: Split up full vs "beginning to debug" docs and call it a day.

zhourui123 commented 5 years ago

A lot of forge code gets mixin , can't be debugged(The line number is incorrect for debugging), Further setup is required for normal debugging

gabizou commented 5 years ago

can't be debugged(The line number is incorrect for debugging)

Debugs just fine in intellij with the MinecraftDev plugin: https://youtu.be/JQAnCC-ZDng

XakepSDK commented 5 years ago

If you're using mixins, then you are using ForgeGradle too. FG has out of box run configs for IDE's, so current tutorial and this tutorial are unnecessary and confusing.