mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-22 16:11:22 +01:00
parent
0b4ee9e73e
commit
8f86849aec
@ -62,11 +62,9 @@ public class Commandhome extends EssentialsCommand {
|
||||
}
|
||||
goHome(user, player, homeName.toLowerCase(Locale.ENGLISH), charge, getNewExceptionFuture(user.getSource(), commandLabel));
|
||||
} catch (NotEnoughArgumentsException e) {
|
||||
if (!player.getBase().isOnline() || player.getBase() instanceof OfflinePlayer) {
|
||||
throw new Exception(tl("bedOffline"));
|
||||
}
|
||||
final User finalPlayer = player;
|
||||
PaperLib.getBedSpawnLocationAsync(player.getBase(), true).thenAccept(bed -> {
|
||||
CompletableFuture<Location> message = new CompletableFuture<>();
|
||||
message.thenAccept(bed -> {
|
||||
final List<String> homes = finalPlayer.getHomes();
|
||||
if (homes.isEmpty() && finalPlayer.equals(user)) {
|
||||
if (ess.getSettings().isSpawnIfNoHome()) {
|
||||
@ -94,6 +92,11 @@ public class Commandhome extends EssentialsCommand {
|
||||
user.sendMessage(tl("homes", StringUtil.joinList(homes), count, getHomeLimit(finalPlayer)));
|
||||
}
|
||||
});
|
||||
if (!player.getBase().isOnline() || player.getBase() instanceof OfflinePlayer) {
|
||||
message.complete(null);
|
||||
return;
|
||||
}
|
||||
PaperLib.getBedSpawnLocationAsync(player.getBase(), true).thenAccept(message::complete);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user