1
0
mirror of https://github.com/GeyserMC/Floodgate.git synced 2026-01-04 15:31:48 +00:00

Return the value of optional and not the optional itself (#301)

This commit is contained in:
Hugo Planque
2022-05-15 23:18:49 +02:00
committed by GitHub
parent 5034c5f5a9
commit b2d2efcedd

View File

@@ -90,13 +90,13 @@ public final class VelocityCommandUtil extends CommandUtil {
@Override
public Object getPlayerByUuid(@NonNull UUID uuid) {
Optional<Player> player = server.getPlayer(uuid);
return player.isPresent() ? player : uuid;
return player.isPresent() ? player.get() : uuid;
}
@Override
public Object getPlayerByUsername(@NonNull String username) {
Optional<Player> player = server.getPlayer(username);
return player.isPresent() ? player : username;
return player.isPresent() ? player.get() : username;
}
@Override