mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-12-28 07:20:28 +01:00
Use uuid for bukkit api permission checks (#4363)
* lookup players by uuid instead of name * Fix: look up Players by UUID for permissions, dont throw if a player can't be found (e.g. disconnected) * use api method
This commit is contained in:
parent
b0ccf45cd4
commit
592a58a0c8
1 changed files with 5 additions and 1 deletions
|
@ -197,7 +197,11 @@ public class GeyserSpigotWorldManager extends WorldManager {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasPermission(GeyserSession session, String permission) {
|
public boolean hasPermission(GeyserSession session, String permission) {
|
||||||
return Objects.requireNonNull(Bukkit.getPlayer(session.getPlayerEntity().getUsername())).hasPermission(permission);
|
Player player = Bukkit.getPlayer(session.javaUuid());
|
||||||
|
if (player != null) {
|
||||||
|
return player.hasPermission(permission);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue