mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-08-03 13:05:29 +02:00
Compare commits
1 Commits
main
...
renovate/g
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2106561739 |
@@ -283,41 +283,32 @@ public class MainCommand extends Command {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private CompletableFuture<Optional<CommandExecutionData>> preparePlotArgument(
|
private CompletableFuture<Optional<CommandExecutionData>> preparePlotArgument(@Nullable Plot newPlot,
|
||||||
@Nullable Plot newPlot,
|
@Nonnull CommandExecutionData data,
|
||||||
@Nonnull CommandExecutionData data,
|
@Nullable PlotArea area) {
|
||||||
@Nullable PlotArea area
|
if (newPlot != null && (data.player() instanceof ConsolePlayer
|
||||||
) {
|
|| (area != null && area.equals(newPlot.getArea()))
|
||||||
if (newPlot == null) {
|
|| data.player().hasPermission(Permission.PERMISSION_ADMIN)
|
||||||
return CompletableFuture.completedFuture(Optional.of(data));
|
|| data.player().hasPermission(Permission.PERMISSION_ADMIN_AREA_SUDO))
|
||||||
|
&& !newPlot.isDenied(data.player().getUUID())) {
|
||||||
|
return fetchPlotCenterLocation(newPlot)
|
||||||
|
.thenApply(newLoc -> {
|
||||||
|
if (!data.player().canTeleport(newLoc)) {
|
||||||
|
data.player().sendMessage(TranslatableCaption.of("border.denied"));
|
||||||
|
return Optional.empty();
|
||||||
|
}
|
||||||
|
// Save meta
|
||||||
|
var originalCommandMeta = setCommandScope(data.player(), new TemporaryCommandMeta(newLoc, newPlot));
|
||||||
|
return Optional.of(new CommandExecutionData(
|
||||||
|
data.player(),
|
||||||
|
Arrays.copyOfRange(data.args(), 1, data.args().length), // Trimmed command
|
||||||
|
data.confirm(),
|
||||||
|
data.whenDone(),
|
||||||
|
originalCommandMeta
|
||||||
|
));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
final PlotPlayer<?> player = data.player();
|
return CompletableFuture.completedFuture(Optional.of(data));
|
||||||
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));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return fetchPlotCenterLocation(newPlot)
|
|
||||||
.thenApply(newLoc -> {
|
|
||||||
if (!player.canTeleport(newLoc)) {
|
|
||||||
player.sendMessage(TranslatableCaption.of("border.denied"));
|
|
||||||
return Optional.empty();
|
|
||||||
}
|
|
||||||
// Save meta
|
|
||||||
var originalCommandMeta = setCommandScope(player, new TemporaryCommandMeta(newLoc, newPlot));
|
|
||||||
return Optional.of(new CommandExecutionData(
|
|
||||||
player,
|
|
||||||
Arrays.copyOfRange(data.args(), 1, data.args().length), // Trimmed command
|
|
||||||
data.confirm(),
|
|
||||||
data.whenDone(),
|
|
||||||
originalCommandMeta
|
|
||||||
));
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Optional<CommandExecutionData> prepareFlagArgument(@Nonnull CommandExecutionData data, @Nonnull PlotArea area) {
|
private Optional<CommandExecutionData> prepareFlagArgument(@Nonnull CommandExecutionData data, @Nonnull PlotArea area) {
|
||||||
|
@@ -415,7 +415,6 @@
|
|||||||
"deny.denied_added": "<prefix><dark_aqua>You successfully denied the player from this plot.</dark_aqua>",
|
"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.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.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>",
|
"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.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>",
|
"kick.cannot_kick_player": "<prefix><red>You cannot kick the player <gray><player></gray>.</red>",
|
||||||
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
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
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
2
gradlew
vendored
2
gradlew
vendored
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright © 2015-2021 the original authors.
|
# Copyright © 2015 the original authors.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
|
Reference in New Issue
Block a user