From 3c7e89ba3f0033013368a80f3a953d62e88c5cef Mon Sep 17 00:00:00 2001 From: RednedEpic Date: Mon, 4 May 2020 13:00:32 -0500 Subject: [PATCH] Use Java Edition username when getting player in bukkit world manager --- .../platform/bukkit/world/GeyserBukkitWorldManager.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bootstrap/bukkit/src/main/java/org/geysermc/platform/bukkit/world/GeyserBukkitWorldManager.java b/bootstrap/bukkit/src/main/java/org/geysermc/platform/bukkit/world/GeyserBukkitWorldManager.java index 6172b831..07fc3136 100644 --- a/bootstrap/bukkit/src/main/java/org/geysermc/platform/bukkit/world/GeyserBukkitWorldManager.java +++ b/bootstrap/bukkit/src/main/java/org/geysermc/platform/bukkit/world/GeyserBukkitWorldManager.java @@ -37,6 +37,9 @@ public class GeyserBukkitWorldManager extends WorldManager { @Override public BlockState getBlockAt(GeyserSession session, int x, int y, int z) { - return BlockTranslator.getJavaIdBlockMap().get(Bukkit.getPlayer(session.getName()).getWorld().getBlockAt(x, y, z).getBlockData().getAsString()); + if (session.getPlayerEntity() == null) { + return BlockTranslator.AIR; + } + return BlockTranslator.getJavaIdBlockMap().get(Bukkit.getPlayer(session.getPlayerEntity().getUsername()).getWorld().getBlockAt(x, y, z).getBlockData().getAsString()); } }