Mob Grinding Utils

Mob Grinding Utils

80M Downloads

Invalid IClientFluidTypeExtensions resulting in failure to connect to server with Moonlight Lib installed

Johni0702 opened this issue ยท 0 comments

commented

TLDR: You need to implement getFlowingTexture(), not getFlowingTexture(...)

It would appear that the 1.19 version of MGU registers an invalid implementation of IClientFluidTypeExtensions for its fluix_xp fluid type.
As per method documentation, getFlowingTexture() is mandatory to implement and must not return null for any regular fluid, however it appears to do so for xp fluid.
Note that there are overloads with extra arguments for that method, these appear to be optional as their default implementation delegates to the no-argument variant. Implementing one of the extra-argument overloads is not sufficient to fulfill the requirements because any of the other methods will still return null. If you do not require the extra arguments, then it seems like simply overriding the no-arg variant is sufficient given all the other overloads delegate to it by default.

When combined with another mod that relies on these methods returning non-null, such as Moonlight Lib, this can cause issues. In the case of Moonlight, it creates a registry derived from registered fluids and then tries to send that registry with the login packet. This then fails with a NPE disconnecting the client, making it impossible for any client to connect to the server (I've only tested this with Open To LAN and I'm not familiar with Moonlight, so I'm not sure if it'll happen with a dedicated server as well).

To reproduce, install MGU 1.19-0.4.44 and Moonlight Lib 1.19.2-2.0.29, open a world to lan and then try to connect to it with a second client. You will be disconnected with Internal Exception: io.netty.handler.codec.EncoderException: java.lang.NullPointerException and will find the corresponding stacktrace pointing into mojang's serialization library in the host's log (error message says "receiving packet" but that's incorrect, it's actually "sending packet").