Fix: Show the correct port that Geyser started on when using Geyser-Fabric on a client. (#4335)

This commit is contained in:
chris 2023-12-12 22:44:13 +01:00 committed by GitHub
parent d63a70daa9
commit 3d05181a13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -32,6 +32,7 @@ import net.minecraft.client.server.IntegratedServer;
import net.minecraft.network.chat.Component;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.level.GameType;
import org.geysermc.geyser.GeyserImpl;
import org.geysermc.geyser.platform.fabric.GeyserFabricMod;
import org.geysermc.geyser.platform.fabric.GeyserServerPortGetter;
import org.geysermc.geyser.text.GeyserLocale;
@ -62,7 +63,7 @@ public class IntegratedServerMixin implements GeyserServerPortGetter {
// Give indication that Geyser is loaded
Objects.requireNonNull(this.minecraft.player);
this.minecraft.player.displayClientMessage(Component.literal(GeyserLocale.getPlayerLocaleString("geyser.core.start",
this.minecraft.options.languageCode, "localhost", String.valueOf(this.publishedPort))), false);
this.minecraft.options.languageCode, "localhost", String.valueOf(GeyserImpl.getInstance().bedrockListener().port()))), false);
}
}