From c027e56fc4f166f662bdab19baf80db3b59b4c0d Mon Sep 17 00:00:00 2001 From: Moulberry Date: Fri, 17 Nov 2023 00:18:28 +0800 Subject: [PATCH] PlotSquared: Change isPlotWorld logic to check for non-zero PlotArea count --- .../plotsquared/PlotSquaredIntegrationImpl.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/moulberry/axiom/integration/plotsquared/PlotSquaredIntegrationImpl.java b/src/main/java/com/moulberry/axiom/integration/plotsquared/PlotSquaredIntegrationImpl.java index 44ab1bd..e530e0d 100644 --- a/src/main/java/com/moulberry/axiom/integration/plotsquared/PlotSquaredIntegrationImpl.java +++ b/src/main/java/com/moulberry/axiom/integration/plotsquared/PlotSquaredIntegrationImpl.java @@ -128,16 +128,9 @@ public class PlotSquaredIntegrationImpl { return plotWorldCache.get(world); } - boolean isPlotWorld = false; - String worldName = world.getName(); - for (String plotWorld : PlotSquared.get().getPlotAreaManager().getAllWorlds()) { - if (plotWorld.equals(worldName)) { - isPlotWorld = true; - break; - } - } - + PlotArea[] plotAreas = PlotSquared.get().getPlotAreaManager().getPlotAreas(worldName, null); + boolean isPlotWorld = plotAreas.length > 0; plotWorldCache.put(world, isPlotWorld); return isPlotWorld; }