From c9d210bd64382b122d5f918311e3d4ce26ac1292 Mon Sep 17 00:00:00 2001 From: SirYwell Date: Wed, 21 Dec 2022 16:08:09 +0100 Subject: [PATCH] Simplify isOwner check --- Core/src/main/java/com/plotsquared/core/plot/Plot.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 cc4dc4047..6f38f0047 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/Plot.java +++ b/Core/src/main/java/com/plotsquared/core/plot/Plot.java @@ -578,7 +578,14 @@ public class Plot { return false; } final Set connected = getConnectedPlots(); - return connected.stream().anyMatch(current -> uuid.equals(current.getOwner())); + for (Plot current : connected) { + // can skip ServerPlotFlag check in getOwner() + // as flags are synchronized between plots + if (uuid.equals(current.getOwnerAbs())) { + return true; + } + } + return false; } /**