mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-03 14:38:53 +00:00
Fix tphere not returning an error for unresolved players
This commit is contained in:
1 parent
8854d3569f
commit
10b398b783
9 files changed
+56
-24
No files matched your search
@@ -87,7 +87,7 @@ public class TeleportBuilder {
|
||||
*/
|
||||
public TeleportBuilder setTeleporter(@NotNull String teleporterUsername) {
|
||||
this.teleporter = CompletableFuture.supplyAsync(() -> plugin
|
||||
.findPlayer(teleporterUsername)
|
||||
.findOnlinePlayer(teleporterUsername)
|
||||
.map(onlineUser -> (User) onlineUser)
|
||||
.or(() -> {
|
||||
if (plugin.getSettings().crossServer) {
|
||||
@@ -229,7 +229,7 @@ public class TeleportBuilder {
|
||||
* @return future optionally supplying the player's position, if the player could be found
|
||||
*/
|
||||
private CompletableFuture<Optional<Position>> getPlayerPosition(@NotNull String playerName) {
|
||||
final Optional<OnlineUser> localPlayer = plugin.findPlayer(playerName);
|
||||
final Optional<OnlineUser> localPlayer = plugin.findOnlinePlayer(playerName);
|
||||
if (localPlayer.isPresent()) {
|
||||
return CompletableFuture.supplyAsync(() -> Optional.of(localPlayer.get().getPosition()));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user