Apothic Enchanting

Apothic Enchanting

341k Downloads

Compatibility issue with Apothic Enchanting and Enchantment Sort

Closed this issue ยท 3 comments

commented

Bit of an odd error, seems to be tied to Apothic Enchanting and Enchantment Sort not playing nice together....

The error is while connecting to a server, when you click to connect, you get an error message, you just have to go back to the selection screen and connect again, and it works the 2nd time. They released an update/work around yesterday (Enchantment Sort 1.21.1 - 2.1.5) after i brought it to their attention, but the work around doesn't work well with all of Apothic's Enchantment levels. They claim its on Apothic Enchanting.

Client and server both using NeoForge 1.21.1-21.1.92
Apothic Enchanting 1.21.1-1.2.5
Enchantment Sort 1.21.1-2.1.4

See error log attached and picture of error message.
image
dicconnect_error.txt

commented

It appears that Enchantment Sort is directly calling into EnchHooks.getMaxLevel before the enchantment info has been received by the client. There's not anything I can do from my end (I cannot send the data any earlier than it already is), and changing the method to not throw an exception would create easy-to-miss errors where the non-config-backed max level is used in places where it is not meant to be.

If Enchantment Sort wants to retrieve the vanilla max level, ignoring the config level, they should not be calling this method, and if they want to retrieve the apoth-adjusted max level, they need to defer calling this method until the data has been received by the client.

commented

Thank you for the reply, i'll pass this along.

commented

EntityJoinLevel runs into a crash
TagsUpdatedEvent has the registry with the entries but your mod can't find the holder (so it's null)

not sure what else there is for a client-only mod

your map has the entries but it has holders for keys for some reason
nevermind, was apparently still stored after a rejoin
so that event is also not usable for this

no clue whats available for initializing sth. enchantment related when using apothic enchanting

(feels like resource keys would be less problematic)
and I can't pass them myself

So my option at the moment seems to be to call ApothicEnchanting.getEnchInfo(holder).getMaxLevel() myself