mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-01 22:16:08 +00:00
Fixed blocking calls to #getPosition causing crashes in rare cases
This commit is contained in:
1 parent
25d90530d3
commit
46c36f3b34
4 files changed
+114
-104
No files matched your search
@@ -19,13 +19,12 @@ public class SetSpawnCommand extends CommandBase {
|
||||
|
||||
@Override
|
||||
public void onExecute(@NotNull OnlineUser onlineUser, @NotNull String[] args) {
|
||||
if (args.length > 0) {
|
||||
plugin.getLocales().getLocale("error_invalid_syntax", "/setspawn")
|
||||
.ifPresent(onlineUser::sendMessage);
|
||||
return;
|
||||
}
|
||||
|
||||
CompletableFuture.runAsync(() -> {
|
||||
if (args.length > 0) {
|
||||
plugin.getLocales().getLocale("error_invalid_syntax", "/setspawn")
|
||||
.ifPresent(onlineUser::sendMessage);
|
||||
return;
|
||||
}
|
||||
final Position position = onlineUser.getPosition();
|
||||
if (plugin.getSettings().crossServer && plugin.getSettings().globalSpawn) {
|
||||
final Optional<Warp> warp = plugin.getDatabase().getWarp(plugin.getSettings().globalSpawnName).join();
|
||||
|
||||
Reference in new issue
Block a user