Fixed multiplayer servers not working

This commit is contained in:
coolGi
2022-12-20 20:27:47 +10:30
parent 05dbe0f07e
commit 2d2ea5b44f
2 changed files with 2 additions and 0 deletions
@@ -121,6 +121,7 @@ public class ClientProxy
public void worldLoadEvent(Level level)
{
if (Minecraft.getInstance().screen instanceof TitleScreen) return;
if (Minecraft.getInstance().getConnection() == null) return; // In 1.19.3, the multiplayer world load is called twice. The first time is before it actually connects to the multiplayer server (so stuff like ip and name arent sent out yet)
if (level != null) {
eventApi.worldLoadEvent(WorldWrapper.getWorldWrapper(level));
}
@@ -96,6 +96,7 @@ public class ForgeClientProxy
#endif
{
if (Minecraft.getInstance().screen instanceof TitleScreen) return;
if (Minecraft.getInstance().getConnection() == null) return; // In 1.19.3, the multiplayer world load is called twice. The first time is before it actually connects to the multiplayer server (so stuff like ip and name arent sent out yet)
#if PRE_MC_1_19_1
if (event.getWorld() != null) {
eventApi.worldLoadEvent(WorldWrapper.getWorldWrapper(event.getWorld()));