A serverside-only Fabric mod that adds the corresponding mod name to items in the lore
Why would you need it?
If you host a serverside modpack (via PolyMC for example) mods like REI won't display the right mod name inside item tooltips; this mod replicates the intended behaviour, even for Vanilla clients.
### ⚠️ THIS IS A PRE-RELEASE! LITTLE TO NO TESTING HAS BEEN DONE! PROCEED WITH CAUTION!
_Actually it's fine, I am pretty confident that this works well enough but I haven't properly tested some edge cases, but it should be fine_
Heyo!
This release fixes a `NullPointerException` that causes players to crash and menus to break when *some mods* misuse the `LoreComponent` by setting the `styledLines` parameter to `null`.
Since the mod uses the styled lines to determine if a mod/datapack tag is present under the item (eg. Blockus or Incendium) for better precision, a workaround was implemented to supply said lore text when not available (Mojang pls fix).
### ⚠️ THIS IS A PRE-RELEASE! LITTLE TO NO TESTING HAS BEEN DONE! PROCEED WITH CAUTION!
This release required a bit of a rework regarding appennding lore to the item packet as well as figuring out how components work in the Java API, because of this new issues might pop out and the update is far from complete in my opinion, I want to add a more secure and robust check against creative mode overwrites and I want to be 100% sure that I am not corrupting any data inside components.
As of this release, as long as you don't go into creative and leave stuff in chests it should be fine, holding items in the inventory and switching back to survival should trigger the cleaning function but I am not sure if it works 100%.
This update includes important fixes and and two (and a half) new features!
### Features
- Now requires Fabric 0.15.0 (this mod can still work on pre-0.15.0 but you need to change the fabric.json manually)
- Two new configuration files
- `wayf.flags`
- Every config option or toggle for the mod will be found here
- `wayf.ignore`
- You can use this file to add lore exclusions for the mod
- Added the ability to disable the "Minecraft" and "Unknown" tooltips (`wayf.flags` -> `annotateVanilla` & `annotateUnknown`)
- Added the ability to change the name of the "Unknown" tooltip (`wayf.flags` -> `unknownTooltipName`)
- Added the Ignore List
- This feature allows you to add terms that the mod will search for inside the item lore in order to disable itself for that specific item stack; this is useful for compatability with datapacks that add their name to the lore such as Incendium or Stellarity.
- Igored terms can be added inside `wayf.ignore` separated by a new line.
- This feature can be disabled inside `wayf.flags` -> `ignoreListEnabled`, this is reccomended if you don't need the feature since it will (marginally) improve server performance.
### Fixes
- Removed Fabric API as a dependency
- Removed some leftover logging
- Avoid deleting the lore when joining the server/switching gamemodes
- Avoid crashing the client in the edge-case where the item lore is malformed
Merry Christmas!
This update brings the mod to 1.20.4 as well as finally fixing the bug that caused the mod name to leak into the item lore (it was caused by creative mode).
As a bonus feature, you can now configure redirects for mod ids for when the item namespace and the modid don't match up (eg. Go-Fish has `go-fish` as modid and `gofish` as item namespace)
This version fixes two critical bugs with how items are handled:
- Now it won't actually try to modify the _actual_ item to add the mod name but a copy of it
- By modifying the copy of the item, netty won't scream and it won't cause a Concurrent Modification Exception (kicking the player)
!! THIS MOD IS SERVERSIDE ONLY !!
v1.0.1 - Lore Fix + Mod Name Duplication Prevention
This version fixes custom lore being 🦀 from items (oops...) and checks if mod name is already present on the item before adding it to prevent duplication, shouldn't happen but better safe than sorry!