diff --git a/Core/src/main/java/com/plotsquared/core/command/Move.java b/Core/src/main/java/com/plotsquared/core/command/Move.java index 85dd26fb3..c0e9d3a7b 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Move.java +++ b/Core/src/main/java/com/plotsquared/core/command/Move.java @@ -105,13 +105,17 @@ public class Move extends SubCommand { return CompletableFuture.completedFuture(false); } + // Set strings here as the plot objects are mutable (the PlotID changes after being moved). + String p1 = plot1.toString(); + String p2 = plot2.toString(); + return plot1.getPlotModificationManager().move(plot2, player, () -> { }, false).thenApply(result -> { if (result) { player.sendMessage( TranslatableCaption.of("move.move_success"), - Template.of("origin", plot1.toString()), - Template.of("target", plot2.toString()) + Template.of("origin", p1), + Template.of("target", p2) ); return true; } else { diff --git a/Core/src/main/java/com/plotsquared/core/command/Swap.java b/Core/src/main/java/com/plotsquared/core/command/Swap.java index 3003226ec..ea63a358e 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Swap.java +++ b/Core/src/main/java/com/plotsquared/core/command/Swap.java @@ -82,11 +82,17 @@ public class Swap extends SubCommand { return CompletableFuture.completedFuture(false); } + // Set strings here as the plot objects are mutable (the PlotID changes after being moved). + String p1 = plot1.toString(); + String p2 = plot2.toString(); + return plot1.getPlotModificationManager().move(plot2, player, () -> { }, true).thenApply(result -> { if (result) { - player.sendMessage(TranslatableCaption.of("swap.swap_success"), Template.of("origin", String.valueOf(plot1)), - Template.of("target", String.valueOf(plot2)) + player.sendMessage( + TranslatableCaption.of("swap.swap_success"), + Template.of("origin", p1), + Template.of("target", p2) ); return true; } else {