badasintended / wthit

what the hell is that?
https://docs.bai.lol/wthit
Other
121 stars 21 forks source link

match kebab case mod IDs with snake case namespaces #246

Closed sisby-folk closed 8 months ago

sisby-folk commented 8 months ago

This covers off the case where a mod has the ID cool-mod but uses the namespace cool_mod because dashes aren't legal package names - this usually causes their mod name to show as a namespace in the overlay.

It'd be nice to also do:

.orElse(new ModInfo(false, namespace, WordUtils.capitalizeFully(namespace.replace("_", " "), null));

So that even if no mod info is found at all, a friendly similarly-formatted name can be used - But this would require changing the contract such that the return type of createModInfo to ModInfo, so I felt it might drag this PR down.

deirn commented 8 months ago

I think the better place to patch is in ModInfo: https://github.com/badasintended/wthit/blob/02e897952adf43bbe8fd0af7cbd131a5fc9cd058/src/main/java/mcp/mobius/waila/util/ModInfo.java#L29-L31

sisby-folk commented 8 months ago

can do! one moment.

sisby-folk commented 8 months ago

turns out that spot lets me add the fallback just fine - looking extra nice!