mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-08-03 21:15:27 +02:00
Compare commits
10 Commits
renovate/j
...
main
Author | SHA1 | Date | |
---|---|---|---|
![]() |
58016bb1c8 | ||
![]() |
e5943ba627 | ||
![]() |
07dfdeef2c | ||
![]() |
025b08e716 | ||
![]() |
921435689e | ||
![]() |
aae154b23a | ||
![]() |
0f33465d76 | ||
![]() |
438f1d9656 | ||
![]() |
cb38aeef93 | ||
![]() |
7be0655b86 |
@@ -283,24 +283,35 @@ public class MainCommand extends Command {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private CompletableFuture<Optional<CommandExecutionData>> preparePlotArgument(@Nullable Plot newPlot,
|
private CompletableFuture<Optional<CommandExecutionData>> preparePlotArgument(
|
||||||
|
@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())) {
|
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)
|
return fetchPlotCenterLocation(newPlot)
|
||||||
.thenApply(newLoc -> {
|
.thenApply(newLoc -> {
|
||||||
if (!data.player().canTeleport(newLoc)) {
|
if (!player.canTeleport(newLoc)) {
|
||||||
data.player().sendMessage(TranslatableCaption.of("border.denied"));
|
player.sendMessage(TranslatableCaption.of("border.denied"));
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
}
|
}
|
||||||
// Save meta
|
// Save meta
|
||||||
var originalCommandMeta = setCommandScope(data.player(), new TemporaryCommandMeta(newLoc, newPlot));
|
var originalCommandMeta = setCommandScope(player, new TemporaryCommandMeta(newLoc, newPlot));
|
||||||
return Optional.of(new CommandExecutionData(
|
return Optional.of(new CommandExecutionData(
|
||||||
data.player(),
|
player,
|
||||||
Arrays.copyOfRange(data.args(), 1, data.args().length), // Trimmed command
|
Arrays.copyOfRange(data.args(), 1, data.args().length), // Trimmed command
|
||||||
data.confirm(),
|
data.confirm(),
|
||||||
data.whenDone(),
|
data.whenDone(),
|
||||||
@@ -308,8 +319,6 @@ public class MainCommand extends Command {
|
|||||||
));
|
));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return CompletableFuture.completedFuture(Optional.of(data));
|
|
||||||
}
|
|
||||||
|
|
||||||
private Optional<CommandExecutionData> prepareFlagArgument(@Nonnull CommandExecutionData data, @Nonnull PlotArea area) {
|
private Optional<CommandExecutionData> prepareFlagArgument(@Nonnull CommandExecutionData data, @Nonnull PlotArea area) {
|
||||||
if (data.args().length >= 2 && !data.args()[0].isEmpty() && data.args()[0].charAt(0) == '-') {
|
if (data.args().length >= 2 && !data.args()[0].isEmpty() && data.args()[0].charAt(0) == '-') {
|
||||||
|
@@ -352,7 +352,7 @@ public class Plot {
|
|||||||
* @param arg The search term
|
* @param arg The search term
|
||||||
* @param message If a message should be sent to the player if a plot cannot be found
|
* @param message If a message should be sent to the player if a plot cannot be found
|
||||||
* @return The plot if only 1 result is found, or null
|
* @return The plot if only 1 result is found, or null
|
||||||
* @since TODO
|
* @since 7.5.5
|
||||||
*/
|
*/
|
||||||
public static @Nullable Plot getPlotFromStringUnchecked(
|
public static @Nullable Plot getPlotFromStringUnchecked(
|
||||||
final @Nullable PlotPlayer<?> player,
|
final @Nullable PlotPlayer<?> player,
|
||||||
@@ -434,7 +434,7 @@ public class Plot {
|
|||||||
* @param string plot id/area + id
|
* @param string plot id/area + id
|
||||||
* @param player {@link PlotPlayer} player to notify if plot is invalid (outside bounds)
|
* @param player {@link PlotPlayer} player to notify if plot is invalid (outside bounds)
|
||||||
* @return New or existing plot object
|
* @return New or existing plot object
|
||||||
* @since TODO
|
* @since 7.5.5
|
||||||
*/
|
*/
|
||||||
public static @Nullable Plot fromString(
|
public static @Nullable Plot fromString(
|
||||||
final @Nullable PlotArea defaultArea,
|
final @Nullable PlotArea defaultArea,
|
||||||
@@ -457,7 +457,7 @@ public class Plot {
|
|||||||
* @param defaultArea if no area is specified
|
* @param defaultArea if no area is specified
|
||||||
* @param string plot id/area + id
|
* @param string plot id/area + id
|
||||||
* @return New or existing plot object
|
* @return New or existing plot object
|
||||||
* @since TODO
|
* @since 7.5.5
|
||||||
*/
|
*/
|
||||||
public static @Nullable Plot fromStringUnchecked(final @Nullable PlotArea defaultArea, final @NonNull String string) {
|
public static @Nullable Plot fromStringUnchecked(final @Nullable PlotArea defaultArea, final @NonNull String string) {
|
||||||
final String[] split = string.split("[;,]");
|
final String[] split = string.split("[;,]");
|
||||||
|
@@ -371,8 +371,7 @@ public final class PlotModificationManager {
|
|||||||
manager.createRoadSouthEast(current, queue);
|
manager.createRoadSouthEast(current, queue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else if (current.isMerged(Direction.SOUTH)) {
|
||||||
if (current.isMerged(Direction.SOUTH)) {
|
|
||||||
manager.createRoadSouth(current, queue);
|
manager.createRoadSouth(current, queue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -67,7 +67,7 @@ public class PlotTitle {
|
|||||||
* Provides a string representation of this plot title value (used in placeholders).
|
* Provides a string representation of this plot title value (used in placeholders).
|
||||||
*
|
*
|
||||||
* @return the plot title representation in the format {@code "<title>" "<subtitle>"}
|
* @return the plot title representation in the format {@code "<title>" "<subtitle>"}
|
||||||
* @since TODO
|
* @since 7.5.5
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
@@ -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.5-SNAPSHOT"
|
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.0"
|
adventure-bukkit = "4.4.1"
|
||||||
log4j = "2.19.0"
|
log4j = "2.19.0"
|
||||||
|
|
||||||
# Plugins
|
# Plugins
|
||||||
@@ -35,7 +35,7 @@ serverlib = "2.3.7"
|
|||||||
# Gradle plugins
|
# Gradle plugins
|
||||||
shadow = "8.3.8"
|
shadow = "8.3.8"
|
||||||
grgit = "4.1.1"
|
grgit = "4.1.1"
|
||||||
spotless = "7.2.0"
|
spotless = "7.2.1"
|
||||||
publish = "0.34.0"
|
publish = "0.34.0"
|
||||||
runPaper = "2.3.1"
|
runPaper = "2.3.1"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user