You're in Grave Danger

You're in Grave Danger

18M Downloads

Game crashing on death with LevelZ

YamJG opened this issue ยท 10 comments

commented

Describe the bug
always happened in the latest version levelz-1.4.1

To Reproduce
Steps to reproduce the behavior:

  1. just use these mods
  • levelz-1.4.1
  • youre-in-grave-danger-1.4.6
  • fabric-api-0.67.0+1.19.2
  • cloth-config-8.2.88-fabric
  1. start game
  2. /kill

Desktop (please complete the following information):

  • OS: Windows
  • Minecraft Version: 1.19.2
  • Version: 1.4.6

Additional context
I tried levelz-1.4.0 is fine, and also I tried change config
[graveSettings.graveCompatConfig]
levelzXpInGraves = flase

but, it's still happend.
here's the game crash log:

java.lang.IllegalAccessError: class com.b1n_ry.yigd.compat.LevelzCompat tried to access private field net.levelz.stats.PlayerStatsManager.levelProgress (com.b1n_ry.yigd.compat.LevelzCompat and net.levelz.stats.PlayerStatsManager are in unnamed module of loader net.fabricmc.loader.impl.launch.knot.KnotClassLoader @6a396c1e)
at com.b1n_ry.yigd.compat.LevelzCompat.getInventory(LevelzCompat.java:39)
at com.b1n_ry.yigd.core.GraveHelper.onDeath(GraveHelper.java:240)
at net.minecraft.class_1309.mdc5bf14$lambda$generateGrave$0$b(class_1309.java:39612)
at com.b1n_ry.yigd.Yigd.lambda$onInitialize$3(Yigd.java:265)
at net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents.lambda$static$2(ServerTickEvents.java:62)
at net.minecraft.server.MinecraftServer.handler$ddd002$onEndTick(MinecraftServer.java:6821)
at net.minecraft.server.MinecraftServer.method_3748(MinecraftServer.java:857)
at net.minecraft.class_1132.method_3748(class_1132.java:98)
at net.minecraft.server.MinecraftServer.handler$bih000$modifiedRunLoop(MinecraftServer.java:5385)
at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:644)
at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:257)
at java.base/java.lang.Thread.run(Thread.java:833)

commented

I'm using levelz code to store the xp in the grave, and apparently the developer of levelz likes to change that code, meaning that the compatibility has broken. (This is the second time this has happened now). It's not at all at them though. I should just check before I update if the compat mods has updated and if the compat has broken.
Luckily the change wasn't that major and I've already managed to solve it on my end. I'll try to update the mod soon (like tomorrow or something idk)

commented

thank you so much!

commented

Thanks for the input, however overallLevel is public, as well as setLevelProgress (meaning I have no need for accessors as I can directly call the functions). Sorry, I didn't had the time to update since someone noticed my compat with twilight forest seem to be faulty on servers or something, I haven't had time to test it yet. Anyway, be patient and I will update. This weekend I should (hopefully) have more time

commented

I submitted a PR and set the overallLevel to private, so once it is merged and released, you may have to change the code.
I didn't expect that changing the code would have such a big impact, sorry.

But at the same time it occurred to me that you can't use Accessor, then you have to rely on LevelZ

commented

Oh wow that's a pretty sizable commit. I'll wait for Globox to act on the PR, and if they decide to use the code in the next update I'll update my mod shortly after. It should just be as simple as using the getOverallLevel or setOverallLevel (can't remember how yigd uses it) methods from your PR instead

commented

I submitted new code to ensure compatibility with other mods.
Globox1997/LevelZ@0bf27f0

commented

I mean that's not really necessary since I can just change my code. Since the compat currently is broke it doesn't matter if it breaks more as long as I will fix it

commented

It is recommended to add exception capture to prevent all items from being lost when such a thing happens again.
When throw an exception, use the vanilla method to drop.

Sorry for my english.

commented

updated to levelz-1.4.2, solved the problem.