1
0
mirror of https://github.com/GeyserMC/Geyser.git synced 2025-12-28 03:09:08 +00:00

Turn daylight cycle off when showing configuration dialog, send empty chunks when starting configuration

This commit is contained in:
Eclipse
2025-06-06 11:53:01 +00:00
parent c92c706558
commit 8fe102c2ff
3 changed files with 8 additions and 1 deletions

View File

@@ -1823,7 +1823,7 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
/**
* Changes the daylight cycle gamerule on the client
* This is used in the login screen along-side normal usage
* This is used in login and configuration screens along-side normal usage
*
* @param doCycle If the cycle should continue
*/

View File

@@ -29,6 +29,7 @@ import org.geysermc.geyser.erosion.GeyserboundHandshakePacketHandler;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.translator.protocol.PacketTranslator;
import org.geysermc.geyser.translator.protocol.Translator;
import org.geysermc.geyser.util.ChunkUtils;
import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.ClientboundStartConfigurationPacket;
@Translator(packet = ClientboundStartConfigurationPacket.class)
@@ -42,5 +43,7 @@ public class JavaStartConfigurationTranslator extends PacketTranslator<Clientbou
session.setErosionHandler(new GeyserboundHandshakePacketHandler(session));
erosionHandler.close();
}
ChunkUtils.sendEmptyChunks(session, session.getPlayerEntity().position().toInt(), session.getServerRenderDistance(), false);
}
}

View File

@@ -39,6 +39,10 @@ public class JavaShowDialogueConfigurationTranslator extends PacketTranslator<Cl
if (!session.isSentSpawnPacket()) {
session.connect();
}
// Disable time progression whilst the dialog is open
// Once logged into the game this is set correctly when receiving a time packet from the server
session.setDaylightCycle(false);
session.getDialogManager().openDialog(Holder.ofCustom(packet.getDialog()));
}
}