Fix some reported bugs regarding teleportation. (#3433)

Fixes #3420
Fixes #3430
This commit is contained in:
Josh Roy 2020-06-30 12:00:20 -04:00 committed by GitHub
parent 60f54ee37d
commit b7f38517ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 3 deletions

View file

@ -1,5 +1,6 @@
package com.earth2me.essentials.commands;
import com.earth2me.essentials.OfflinePlayer;
import com.earth2me.essentials.Trade;
import com.earth2me.essentials.User;
import com.earth2me.essentials.utils.StringUtil;
@ -41,7 +42,7 @@ public class Commandhome extends EssentialsCommand {
}
try {
if ("bed".equalsIgnoreCase(homeName) && user.isAuthorized("essentials.home.bed")) {
if (!player.getBase().isOnline()) {
if (!player.getBase().isOnline() || player.getBase() instanceof OfflinePlayer) {
throw new Exception(tl("bedOffline"));
}
PaperLib.getBedSpawnLocationAsync(player.getBase(), true).thenAccept(location -> {