From ca9e37106740d0dfb4a1bd8b71957da3b415faeb Mon Sep 17 00:00:00 2001 From: SirYwell Date: Mon, 21 Jun 2021 18:19:50 +0200 Subject: [PATCH] Teleport all players from plot on clear and delete (fixes #3102) --- Core/src/main/java/com/plotsquared/core/command/Clear.java | 6 ++++-- Core/src/main/java/com/plotsquared/core/command/Delete.java | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Core/src/main/java/com/plotsquared/core/command/Clear.java b/Core/src/main/java/com/plotsquared/core/command/Clear.java index 75c380b55..ac141779a 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Clear.java +++ b/Core/src/main/java/com/plotsquared/core/command/Clear.java @@ -104,8 +104,10 @@ public class Clear extends Command { .hasPermission(player, "plots.continue"), TranslatableCaption.of("done.done_already_done")); confirm.run(this, () -> { if (Settings.Teleport.ON_CLEAR) { - plot.teleportPlayer(player, TeleportCause.COMMAND, result -> { - }); + plot.getPlayersInPlot().forEach(playerInPlot -> plot.teleportPlayer(playerInPlot, TeleportCause.COMMAND, + result -> { + } + )); } BackupManager.backup(player, plot, () -> { final long start = System.currentTimeMillis(); diff --git a/Core/src/main/java/com/plotsquared/core/command/Delete.java b/Core/src/main/java/com/plotsquared/core/command/Delete.java index 3992c377f..86ed9a944 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Delete.java +++ b/Core/src/main/java/com/plotsquared/core/command/Delete.java @@ -107,8 +107,10 @@ public class Delete extends SubCommand { } final long start = System.currentTimeMillis(); if (Settings.Teleport.ON_DELETE) { - plot.teleportPlayer(player, TeleportCause.COMMAND, result -> { - }); + plot.getPlayersInPlot().forEach(playerInPlot -> plot.teleportPlayer(playerInPlot, TeleportCause.COMMAND, + result -> { + } + )); } boolean result = plot.getPlotModificationManager().deletePlot(player, () -> { plot.removeRunning();