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:
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user