From 6025931c7d7728f104676f3bacfd898f3d64fcb2 Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Sat, 15 Jun 2024 22:40:29 -0400 Subject: [PATCH] Properly translate player entity UUID for vaults --- .../level/block/entity/VaultBlockEntityTranslator.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/VaultBlockEntityTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/VaultBlockEntityTranslator.java index 5f39451ac..50fd64202 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/VaultBlockEntityTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/VaultBlockEntityTranslator.java @@ -76,9 +76,13 @@ public class VaultBlockEntityTranslator extends BlockEntityTranslator { LongList bedrockPlayers = new LongArrayList(connectedPlayers.size()); for (int[] player : connectedPlayers) { UUID uuid = uuidFromIntArray(player); - PlayerEntity playerEntity = session.getEntityCache().getPlayerEntity(uuid); - if (playerEntity != null) { - bedrockPlayers.add(playerEntity.getGeyserId()); + if (uuid.equals(session.getPlayerEntity().getUuid())) { + bedrockPlayers.add(session.getPlayerEntity().getGeyserId()); + } else { + PlayerEntity playerEntity = session.getEntityCache().getPlayerEntity(uuid); + if (playerEntity != null) { + bedrockPlayers.add(playerEntity.getGeyserId()); + } } } bedrockNbt.putList("connected_players", NbtType.LONG, bedrockPlayers);