3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-12-26 00:00:41 +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
Dieser Commit ist enthalten in:
chris 2023-12-25 20:43:13 +01:00 committet von GitHub
Ursprung b0ccf45cd4
Commit 592a58a0c8
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -197,7 +197,11 @@ public class GeyserSpigotWorldManager extends WorldManager {
@Override
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