mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00: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
This commit is contained in:
parent
e4cff743ef
commit
efc7e43e02
1 changed files with 9 additions and 4 deletions
|
@ -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);
|
||||||
|
|
||||||
|
// Fixes https://bugs.mojang.com/browse/MCPE-94012 because of the delay
|
||||||
|
session.getConnector().getGeneralThreadPool().schedule(() -> {
|
||||||
ServerSettingsResponsePacket serverSettingsResponsePacket = new ServerSettingsResponsePacket();
|
ServerSettingsResponsePacket serverSettingsResponsePacket = new ServerSettingsResponsePacket();
|
||||||
serverSettingsResponsePacket.setFormData(session.getSettingsForm().getJSONData());
|
serverSettingsResponsePacket.setFormData(session.getSettingsForm().getJSONData());
|
||||||
serverSettingsResponsePacket.setFormId(SettingsUtils.SETTINGS_FORM_ID);
|
serverSettingsResponsePacket.setFormId(SettingsUtils.SETTINGS_FORM_ID);
|
||||||
session.sendUpstreamPacket(serverSettingsResponsePacket);
|
session.sendUpstreamPacket(serverSettingsResponsePacket);
|
||||||
|
}, 1, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue