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 e6288d3e3..fe9aa6b84 100644 --- a/Core/src/main/java/com/plotsquared/core/command/HomeCommand.java +++ b/Core/src/main/java/com/plotsquared/core/command/HomeCommand.java @@ -140,7 +140,7 @@ public class HomeCommand extends Command { ); return CompletableFuture.completedFuture(false); } - query.withSortingStrategy(SortingStrategy.SORT_BY_TEMP); + sortBySettings(query, player); break; } // either plot id or alias @@ -202,7 +202,7 @@ public class HomeCommand extends Command { query.withPlot(plot); break; case 0: - query.withSortingStrategy(SortingStrategy.SORT_BY_TEMP); + sortBySettings(query, player); break; } if (basePlotOnly) { @@ -212,6 +212,15 @@ public class HomeCommand extends Command { return CompletableFuture.completedFuture(true); } + private void sortBySettings(PlotQuery plotQuery, PlotPlayer player) { + if (Settings.Teleport.PER_WORLD_VISIT) { + plotQuery.relativeToArea(player.getApplicablePlotArea()) + .withSortingStrategy(SortingStrategy.SORT_BY_CREATION); + } else { + plotQuery.withSortingStrategy(SortingStrategy.SORT_BY_TEMP); + } + } + @Override public Collection tab(PlotPlayer player, String[] args, boolean space) { final List completions = new ArrayList<>(); diff --git a/Core/src/main/java/com/plotsquared/core/command/Visit.java b/Core/src/main/java/com/plotsquared/core/command/Visit.java index d9a493c7c..e014eef3e 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Visit.java +++ b/Core/src/main/java/com/plotsquared/core/command/Visit.java @@ -98,8 +98,13 @@ public class Visit extends Command { return; } - if (sortByArea != null) { - query.relativeToArea(sortByArea).withSortingStrategy(SortingStrategy.SORT_BY_CREATION); + PlotArea relativeArea = sortByArea; + if (Settings.Teleport.PER_WORLD_VISIT && sortByArea == null) { + relativeArea = player.getApplicablePlotArea(); + } + + if (relativeArea != null) { + query.relativeToArea(relativeArea).withSortingStrategy(SortingStrategy.SORT_BY_CREATION); } else { query.withSortingStrategy(SortingStrategy.SORT_BY_TEMP); } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4d9ca1649..442d9132e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists