From 5e8d8629c2abf2399fc980d3f46eb78d1d836cb6 Mon Sep 17 00:00:00 2001 From: Jordan Date: Fri, 12 Apr 2024 20:55:22 +0200 Subject: [PATCH] fix: skip valid location check for world plots (#4388) - Checking location on teleport to a single plot means the bukkit world is attempted to be accessed before it is loaded - we can just skip this check because we know the player will teleport to a reasonable location --- Core/src/main/java/com/plotsquared/core/plot/Plot.java | 2 +- .../java/com/plotsquared/core/plot/world/SinglePlotManager.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/src/main/java/com/plotsquared/core/plot/Plot.java b/Core/src/main/java/com/plotsquared/core/plot/Plot.java index 27ef4b318..21ee3db05 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/Plot.java +++ b/Core/src/main/java/com/plotsquared/core/plot/Plot.java @@ -2574,7 +2574,7 @@ public class Plot { */ public void teleportPlayer(final PlotPlayer player, TeleportCause cause, Consumer resultConsumer) { Plot plot = this.getBasePlot(false); - if (!WorldUtil.isValidLocation(plot.getBottomAbs())) { + if ((getArea() == null || !(getArea() instanceof SinglePlotArea)) && !WorldUtil.isValidLocation(plot.getBottomAbs())) { // prevent from teleporting into unsafe regions player.sendMessage(TranslatableCaption.of("border.denied")); resultConsumer.accept(false); diff --git a/Core/src/main/java/com/plotsquared/core/plot/world/SinglePlotManager.java b/Core/src/main/java/com/plotsquared/core/plot/world/SinglePlotManager.java index cc580a2cc..7c81fc2ff 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/world/SinglePlotManager.java +++ b/Core/src/main/java/com/plotsquared/core/plot/world/SinglePlotManager.java @@ -37,7 +37,7 @@ import java.util.List; public class SinglePlotManager extends PlotManager { - private static final int MAX_COORDINATE = 30000000; + private static final int MAX_COORDINATE = 20000000; public SinglePlotManager(final @NonNull PlotArea plotArea) { super(plotArea);