oωo (owo-lib)

oωo (owo-lib)

29M Downloads

The Mod "Hey Wiki" makes owo-lib crash on usage or F3

LPFan12 opened this issue · 3 comments

commented

Description

I have noticed that owo-lib is incompatible with the mod Hey Wiki (https://github.com/mc-wiki/minecraft-mod-heywiki), as using its Wiki lookup function causes the game to immedietly crash with the error "java.lang.NullPointerException: Cannot invoke "java.util.Map.containsKey(Object)" because "this.owo$textMap" is null". It is a bit of a shot in the dark for me what mod is really responsible for the issue, because I am not exactly good with code and the flow of execution behind the scenes. I apologize if owo-lib happens to not be at fault.

To confirm the validity of the mod-combination causing the crash and not have the log be bloated by unrelated stuff, I made a clean instance and the issue infact persists exactly the same as it did in a bigger modpack. Both of the mods also seem to be stable on their own, it is only when they are put together that the game encounters an exception.

Edit: As it turns out, pressing F3 also causes the crash. That is the only new information I have noticed.

Attachments

latest.log
crash-2024-09-28_07.28.29-client.txt

Versions

owo-lib = 0.12.14+1.21
Hey Wiki = v1.6.4-1.21.1
Fabric API = 0.105.0+1.21.1
Fabric loader = 0.16.5

commented

I've also encountered the same crash, and I just tried to read the code of both mod.

So mc-wiki/minecraft-mod-heywiki called the hasTranslation method of storage with TranslationStorage class:

TranslationStorage storage = MOD.translationManager().getTranslationOverride(wiki);

// ...

if (storage != null && storage.hasTranslation(translationKey)) {
  // ...
}

But at the same time, wisp-forest/owo-lib inject hasTranslation the following implementation.

@Inject(method = "hasTranslation", at = @At("HEAD"), cancellable = true)
private void hasTranslation(String key, CallbackInfoReturnable<Boolean> cir) {
if (this.owo$textMap.containsKey(key))
cir.setReturnValue(true);
}

So I guess that when heywiki mod execute storage.hasTranslation(translationKey), the owo$textMap is not initialized yet, and it leads to the NullPointerException and crash the game.

I am not familiar with Java, and have no enough time to investigate further, could anyone check how should we init owo$textMap correctly?

commented

Funnily enough, I fixed it on my end in a fork of the 1.21.1 version(That only contains that change) by simply never setting the owo textmap to null and instead blindly passing it along regardless. This is 1000% not the correct way to fix it(and thus this issue in the master repo will stay), but it did manage to stop the crash and I haven't encountered further issues.🤷‍♀️

commented

Author of Hey Wiki here. I suppose a simple null check on this.owo$textMap should fix this?