From dd360363342d54e05e00b38e7048f0c5f0cb4059 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Sun, 8 Aug 2021 12:36:08 +0100 Subject: [PATCH] Allow players to /plot home from non-plot-areas if per-world-teleport is enabled --- .../main/java/com/plotsquared/core/command/HomeCommand.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Core/src/main/java/com/plotsquared/core/command/HomeCommand.java b/Core/src/main/java/com/plotsquared/core/command/HomeCommand.java index d8ffa2a91..e0b47358e 100644 --- a/Core/src/main/java/com/plotsquared/core/command/HomeCommand.java +++ b/Core/src/main/java/com/plotsquared/core/command/HomeCommand.java @@ -212,8 +212,10 @@ public class HomeCommand extends Command { } private void sortBySettings(PlotQuery plotQuery, PlotPlayer player) { - if (Settings.Teleport.PER_WORLD_VISIT) { - plotQuery.relativeToArea(player.getApplicablePlotArea()) + // Player may not be in a plot world when attempting to get to a plot home + PlotArea area = player.getApplicablePlotArea(); + if (Settings.Teleport.PER_WORLD_VISIT && area != null) { + plotQuery.relativeToArea(area) .withSortingStrategy(SortingStrategy.SORT_BY_CREATION); } else { plotQuery.withSortingStrategy(SortingStrategy.SORT_BY_TEMP);