mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-11 11:49:12 +00:00
parent
0b4ee9e73e
commit
8f86849aec
1 changed files with 7 additions and 4 deletions
|
@ -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 a new issue