mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-04 06:28:49 +00:00
Correct error handling on player destination resolution logic
This commit is contained in:
1 parent
a5ffd223cf
commit
5874bc9992
2 files changed
+11
-5
No files matched your search
@@ -226,12 +226,12 @@ public class TeleportBuilder {
|
||||
return Optional.empty();
|
||||
}
|
||||
return plugin.getNetworkMessenger()
|
||||
.sendMessage(executor, new Message(Message.MessageType.POSITION_REQUEST, executor.username,
|
||||
playerName, MessagePayload.empty(), Message.RelayType.MESSAGE,
|
||||
plugin.getSettings().clusterId))
|
||||
.sendMessage(executor, new Message(Message.MessageType.POSITION_REQUEST,
|
||||
executor.username, playerName, MessagePayload.empty(),
|
||||
Message.RelayType.MESSAGE, plugin.getSettings().clusterId))
|
||||
.orTimeout(3, TimeUnit.SECONDS)
|
||||
.exceptionally(throwable -> null)
|
||||
.thenApply(reply -> Optional.ofNullable(reply.payload.position)).join();
|
||||
.thenApply(reply -> Optional.ofNullable(reply == null ? null : reply.payload.position)).join();
|
||||
});
|
||||
}
|
||||
return CompletableFuture.supplyAsync(Optional::empty);
|
||||
|
||||
Reference in new issue
Block a user