#How to tell the Debugger to jump to replaced code?

1 messages · Page 1 of 1 (latest)

tender holly
#

Context

I'm using Intellij IDEA CE and I'm modding a game, The game loads *.jar files (mods) into its classpath. By naming a class in your mod the same as a game source class, you can overwrite it. This way it's possible to replace vanilla game code. I guess Minecraft does something similar. I'm using a special DEBUG.run.xml config to run the game in debug mode. There I'm providing my mod *.jar files and some the game needs to function.

Problem

When debugging my replaced code by placing a break point in it, the debugger will jump to the original vanilla game source code instead of my replaced one.
I can see variables in the debugger, which are only present in my replaced code. The IDE just sends me to the wrong place.

Is there a way to tell the debugger my source is the truth?

GitHub

Adds a menu with more options for the game Songs of Syx - 4rg0n/songs-of-syx-mod-more-options

celest pineBOT
#

<@&987246527741304832> please have a look, thanks.

candid tartan
#

try excluding that vanilla class from classpath

#

somehow

tender holly
#

AFAIK I can only exclude whole .jar files from the classpath 🤔

jolly marsh
#

You can remove old class from the jar and add new one

tender holly
#

I can not change the games source code directly, if that's what you mean by removing the old class

jolly marsh
#

Then, you can use the "evaluate" in the debugger and put some code there if it is a temporary solution. (for example in intellij)
But not clear how changed code was added to the game. Was is loaded by game?
If yes then how was it configured?

tender holly
#

it is hardcoded as far as I know

#

there is no configuration for it

#

evaluation works somehow... but going step by step through the code is not possible with this ^^