Compare commits

..

1 Commits

Author SHA1 Message Date
renovate[bot]
2106561739 Update dependency gradle to v9 2025-07-31 17:51:31 +00:00
5 changed files with 27 additions and 37 deletions

View File

@@ -283,35 +283,24 @@ public class MainCommand extends Command {
}
}
private CompletableFuture<Optional<CommandExecutionData>> preparePlotArgument(
@Nullable Plot newPlot,
private CompletableFuture<Optional<CommandExecutionData>> preparePlotArgument(@Nullable Plot newPlot,
@Nonnull CommandExecutionData data,
@Nullable PlotArea area
) {
if (newPlot == null) {
return CompletableFuture.completedFuture(Optional.of(data));
}
final PlotPlayer<?> player = data.player();
final boolean isAdmin = player instanceof ConsolePlayer || player.hasPermission(Permission.PERMISSION_ADMIN);
final boolean isDenied = newPlot.isDenied(player.getUUID());
if (!isAdmin) {
if (isDenied) {
throw new CommandException(TranslatableCaption.of("deny.cannot_interact"));
}
if (area != null && area.equals(newPlot.getArea()) && !player.hasPermission(Permission.PERMISSION_ADMIN_AREA_SUDO)) {
return CompletableFuture.completedFuture(Optional.of(data));
}
}
@Nullable PlotArea area) {
if (newPlot != null && (data.player() instanceof ConsolePlayer
|| (area != null && area.equals(newPlot.getArea()))
|| data.player().hasPermission(Permission.PERMISSION_ADMIN)
|| data.player().hasPermission(Permission.PERMISSION_ADMIN_AREA_SUDO))
&& !newPlot.isDenied(data.player().getUUID())) {
return fetchPlotCenterLocation(newPlot)
.thenApply(newLoc -> {
if (!player.canTeleport(newLoc)) {
player.sendMessage(TranslatableCaption.of("border.denied"));
if (!data.player().canTeleport(newLoc)) {
data.player().sendMessage(TranslatableCaption.of("border.denied"));
return Optional.empty();
}
// Save meta
var originalCommandMeta = setCommandScope(player, new TemporaryCommandMeta(newLoc, newPlot));
var originalCommandMeta = setCommandScope(data.player(), new TemporaryCommandMeta(newLoc, newPlot));
return Optional.of(new CommandExecutionData(
player,
data.player(),
Arrays.copyOfRange(data.args(), 1, data.args().length), // Trimmed command
data.confirm(),
data.whenDone(),
@@ -319,6 +308,8 @@ public class MainCommand extends Command {
));
});
}
return CompletableFuture.completedFuture(Optional.of(data));
}
private Optional<CommandExecutionData> prepareFlagArgument(@Nonnull CommandExecutionData data, @Nonnull PlotArea area) {
if (data.args().length >= 2 && !data.args()[0].isEmpty() && data.args()[0].charAt(0) == '-') {

View File

@@ -415,7 +415,6 @@
"deny.denied_added": "<prefix><dark_aqua>You successfully denied the player from this plot.</dark_aqua>",
"deny.no_enter": "<prefix><red>You are denied from the plot <red><gold><plot></gold><red> and therefore not allowed to enter.</red>",
"deny.you_got_denied": "<prefix><red>You are denied from the plot you were previously on, and got teleported to spawn.</red>",
"deny.cannot_interact": "<prefix><red>You are denied from the plot <red><gold><plot></gold><red> and therefore cannot interact with it.</red>",
"deny.cant_remove_owner": "<prefix><red>You can't remove the plot owner.</red>",
"kick.player_not_in_plot": "<prefix><red>The player <gray><player></gray> is not on this plot.</red>",
"kick.cannot_kick_player": "<prefix><red>You cannot kick the player <gray><player></gray>.</red>",

Binary file not shown.

View File

@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME

2
gradlew vendored
View File

@@ -1,7 +1,7 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
# Copyright © 2015 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.