Merge branch 'v5' into v6

This commit is contained in:
NotMyFault 2021-04-03 22:31:54 +02:00
commit 496fe09f78
No known key found for this signature in database
GPG Key ID: 158F5701A6AAD00C
3 changed files with 19 additions and 5 deletions

View File

@ -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<Command> tab(PlotPlayer player, String[] args, boolean space) {
final List<Command> completions = new ArrayList<>();

View File

@ -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);
}

View File

@ -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