Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-26 00:00:41 +01:00
Fix settings not displaying due to bedrock bug by delaying 1s (#2010)
* Fix settings not displaying due to bedrock bug by delaying 1s * Update BedrockServerSettingsRequestTranslator.java
Dieser Commit ist enthalten in:
Ursprung
e4cff743ef
Commit
efc7e43e02
@ -32,6 +32,8 @@ import org.geysermc.connector.network.translators.PacketTranslator;
|
|||||||
import org.geysermc.connector.network.translators.Translator;
|
import org.geysermc.connector.network.translators.Translator;
|
||||||
import org.geysermc.connector.utils.SettingsUtils;
|
import org.geysermc.connector.utils.SettingsUtils;
|
||||||
|
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
@Translator(packet = ServerSettingsRequestPacket.class)
|
@Translator(packet = ServerSettingsRequestPacket.class)
|
||||||
public class BedrockServerSettingsRequestTranslator extends PacketTranslator<ServerSettingsRequestPacket> {
|
public class BedrockServerSettingsRequestTranslator extends PacketTranslator<ServerSettingsRequestPacket> {
|
||||||
|
|
||||||
@ -39,9 +41,12 @@ public class BedrockServerSettingsRequestTranslator extends PacketTranslator<Ser
|
|||||||
public void translate(ServerSettingsRequestPacket packet, GeyserSession session) {
|
public void translate(ServerSettingsRequestPacket packet, GeyserSession session) {
|
||||||
SettingsUtils.buildForm(session);
|
SettingsUtils.buildForm(session);
|
||||||
|
|
||||||
ServerSettingsResponsePacket serverSettingsResponsePacket = new ServerSettingsResponsePacket();
|
// Fixes https://bugs.mojang.com/browse/MCPE-94012 because of the delay
|
||||||
serverSettingsResponsePacket.setFormData(session.getSettingsForm().getJSONData());
|
session.getConnector().getGeneralThreadPool().schedule(() -> {
|
||||||
serverSettingsResponsePacket.setFormId(SettingsUtils.SETTINGS_FORM_ID);
|
ServerSettingsResponsePacket serverSettingsResponsePacket = new ServerSettingsResponsePacket();
|
||||||
session.sendUpstreamPacket(serverSettingsResponsePacket);
|
serverSettingsResponsePacket.setFormData(session.getSettingsForm().getJSONData());
|
||||||
|
serverSettingsResponsePacket.setFormId(SettingsUtils.SETTINGS_FORM_ID);
|
||||||
|
session.sendUpstreamPacket(serverSettingsResponsePacket);
|
||||||
|
}, 1, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren