mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-08-03 21:15:27 +02:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
58016bb1c8 | ||
![]() |
e5943ba627 | ||
![]() |
07dfdeef2c |
@@ -15,12 +15,6 @@ repositories {
|
|||||||
name = "EssentialsX"
|
name = "EssentialsX"
|
||||||
url = uri("https://repo.essentialsx.net/releases/")
|
url = uri("https://repo.essentialsx.net/releases/")
|
||||||
}
|
}
|
||||||
// To be removed when "adventure-platform-bukkit" cuts a new release of 4.4.1 or higher
|
|
||||||
maven("https://central.sonatype.com/repository/maven-snapshots/") {
|
|
||||||
content {
|
|
||||||
includeGroup("net.kyori")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
@@ -283,32 +283,41 @@ public class MainCommand extends Command {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private CompletableFuture<Optional<CommandExecutionData>> preparePlotArgument(@Nullable Plot newPlot,
|
private CompletableFuture<Optional<CommandExecutionData>> preparePlotArgument(
|
||||||
@Nonnull CommandExecutionData data,
|
@Nullable Plot newPlot,
|
||||||
@Nullable PlotArea area) {
|
@Nonnull CommandExecutionData data,
|
||||||
if (newPlot != null && (data.player() instanceof ConsolePlayer
|
@Nullable PlotArea area
|
||||||
|| (area != null && area.equals(newPlot.getArea()))
|
) {
|
||||||
|| data.player().hasPermission(Permission.PERMISSION_ADMIN)
|
if (newPlot == null) {
|
||||||
|| data.player().hasPermission(Permission.PERMISSION_ADMIN_AREA_SUDO))
|
return CompletableFuture.completedFuture(Optional.of(data));
|
||||||
&& !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
|
|
||||||
));
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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,6 +415,7 @@
|
|||||||
"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>",
|
||||||
|
@@ -20,7 +20,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "com.intellectualsites.plotsquared"
|
group = "com.intellectualsites.plotsquared"
|
||||||
version = "7.5.6"
|
version = "7.5.7-SNAPSHOT"
|
||||||
|
|
||||||
if (!File("$rootDir/.git").exists()) {
|
if (!File("$rootDir/.git").exists()) {
|
||||||
logger.lifecycle("""
|
logger.lifecycle("""
|
||||||
|
@@ -8,7 +8,7 @@ gson = "2.10"
|
|||||||
guava = "31.1-jre"
|
guava = "31.1-jre"
|
||||||
snakeyaml = "2.0"
|
snakeyaml = "2.0"
|
||||||
adventure = "4.23.0"
|
adventure = "4.23.0"
|
||||||
adventure-bukkit = "4.4.1-SNAPSHOT"
|
adventure-bukkit = "4.4.1"
|
||||||
log4j = "2.19.0"
|
log4j = "2.19.0"
|
||||||
|
|
||||||
# Plugins
|
# Plugins
|
||||||
|
Reference in New Issue
Block a user