Allow unsafe homes when force-disable-teleport-safety is enabled (#4650)

This commit is contained in:
Josh Roy 2021-11-25 14:47:42 -05:00 committed by GitHub
parent 3f857e3183
commit 3c60bcf2de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -51,7 +51,7 @@ public class Commandsethome extends EssentialsCommand {
}
final Location location = user.getLocation();
if (!ess.getSettings().isTeleportSafetyEnabled() && LocationUtil.isBlockUnsafeForUser(usersHome, location.getWorld(), location.getBlockX(), location.getBlockY(), location.getBlockZ())) {
if ((!ess.getSettings().isTeleportSafetyEnabled() || !ess.getSettings().isForceDisableTeleportSafety()) && LocationUtil.isBlockUnsafeForUser(usersHome, location.getWorld(), location.getBlockX(), location.getBlockY(), location.getBlockZ())) {
throw new Exception(tl("unsafeTeleportDestination", location.getWorld().getName(), location.getBlockX(), location.getBlockY(), location.getBlockZ()));
}