mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
parent
2953ea9513
commit
b0baf1670d
2 changed files with 11 additions and 4 deletions
|
@ -30,6 +30,7 @@ import org.geysermc.geyser.session.auth.AuthType;
|
||||||
import org.geysermc.geyser.session.GeyserSession;
|
import org.geysermc.geyser.session.GeyserSession;
|
||||||
import org.geysermc.geyser.translator.protocol.PacketTranslator;
|
import org.geysermc.geyser.translator.protocol.PacketTranslator;
|
||||||
import org.geysermc.geyser.translator.protocol.Translator;
|
import org.geysermc.geyser.translator.protocol.Translator;
|
||||||
|
import org.geysermc.geyser.util.InventoryUtils;
|
||||||
import org.geysermc.geyser.util.LoginEncryptionUtils;
|
import org.geysermc.geyser.util.LoginEncryptionUtils;
|
||||||
|
|
||||||
@Translator(packet = SetLocalPlayerAsInitializedPacket.class)
|
@Translator(packet = SetLocalPlayerAsInitializedPacket.class)
|
||||||
|
@ -47,8 +48,13 @@ public class BedrockSetLocalPlayerAsInitializedTranslator extends PacketTranslat
|
||||||
// else we were able to log the user in
|
// else we were able to log the user in
|
||||||
}
|
}
|
||||||
if (session.isLoggedIn()) {
|
if (session.isLoggedIn()) {
|
||||||
// Sigh
|
// Sigh - as of Bedrock 1.18
|
||||||
session.getEntityCache().updateBossBars();
|
session.getEntityCache().updateBossBars();
|
||||||
|
|
||||||
|
// Double sigh - https://github.com/GeyserMC/Geyser/issues/2677 - as of Bedrock 1.18
|
||||||
|
if (session.getOpenInventory() != null && session.getOpenInventory().isPending()) {
|
||||||
|
InventoryUtils.openInventory(session, session.getOpenInventory());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,9 +66,10 @@ public class InventoryUtils {
|
||||||
|
|
||||||
public static void openInventory(GeyserSession session, Inventory inventory) {
|
public static void openInventory(GeyserSession session, Inventory inventory) {
|
||||||
session.setOpenInventory(inventory);
|
session.setOpenInventory(inventory);
|
||||||
if (session.isClosingInventory()) {
|
if (session.isClosingInventory() || !session.getUpstream().isInitialized()) {
|
||||||
// Wait for close confirmation from client before opening the new inventory.
|
// Wait for close confirmation from client before opening the new inventory.
|
||||||
// Handled in BedrockContainerCloseTranslator
|
// Handled in BedrockContainerCloseTranslator
|
||||||
|
// or - client hasn't yet loaded in; wait until inventory is shown
|
||||||
inventory.setPending(true);
|
inventory.setPending(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue