Posted May 13, 20205 yr I did a small mod for testing with one simple event h andler. It works* until i build it to jar (with gradlew build) and put it in folder. This is what the build outputs:build.txt The mod itself: https://github.com/satyd/TestMod1 *I have no problems/bugs when i compile it, everything works how it supposed to do. Can someone help me, what i did wrong?
May 13, 20205 yr Author 2 minutes ago, diesieben07 said: What is the behavior if you use the jar file? Just nothing happens. When I run compiled minecraft, it applies potion effect whenever a player kills a mob. With jar it stands still.
May 13, 20205 yr Author 25 minutes ago, diesieben07 said: Nvm that. Wtf is this? https://github.com/satyd/TestMod1/blob/master/src/main/java/com/deathpotion/dp/myEvents.java#L41-L49 And why? Sometimes it crashed the game with NoSuchMethodException when the src didn't have the method getTrueSource, for example when entity was killed by a block. Edited May 13, 20205 yr by mdcby
May 13, 20205 yr Author 2 minutes ago, diesieben07 said: That's.... thats not how Java works. If src did not have that method all the time, your code would not compile NoSuchMethodException is something thrown by reflection code. I got this exception when bat suffocated maybe because of gravel. Blocks dont have this method, but living entities do. But ok let's say there is a problem, then why it works properly when compiled?
May 13, 20205 yr Author 36 minutes ago, diesieben07 said: Show the stacktrace. The actual game is obfuscated. When you run the build task, ForgeGradle reobfuscates your mod, updating references to Minecraft's methods and fields. But since you use "getTrueSource" in a string, this will not be updated. In the normal game there won't be a method called "getTrueSource", so your event handler always bails out. I removed this part and tried to repeat this issue, but seems like everything is working. That time i got this:crash-2020-05-11_21.37.49-server.txt
May 13, 20205 yr 6 minutes ago, mdcby said: I removed this part and tried to repeat this issue, but seems like everything is working. That time i got this:crash-2020-05-11_21.37.49-server.txt Are you using deobfuscated names for reflection, because that's very wrong. If you are replace them with the names from MCP. (Incase you don't know what deobfuscated and obfuscated means,getTrueSource -> func_76346_g) It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".
May 13, 20205 yr Author 8 minutes ago, diesieben07 said: They are not. NoSuchMethodError is not something reflection produces. You did not use the gradle build task to build your mod. ohh maybe i really didn't use gradle build without this check, since it works now then thanks ?
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.