Use Java Edition username when getting player in bukkit world manager

This commit is contained in:
RednedEpic 2020-05-04 13:00:32 -05:00
parent da02989967
commit 3c7e89ba3f

View file

@ -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());
}
}