From 18c92bea3885c9360f79e8f920235bf296b19f13 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Thu, 5 Jul 2018 19:33:17 +1000 Subject: [PATCH] Allow specifying area for move command --- .../java/com/intellectualcrafters/plot/commands/Move.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Core/src/main/java/com/intellectualcrafters/plot/commands/Move.java b/Core/src/main/java/com/intellectualcrafters/plot/commands/Move.java index 905ff9140..9fdb3be46 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/commands/Move.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/commands/Move.java @@ -1,8 +1,10 @@ package com.intellectualcrafters.plot.commands; +import com.intellectualcrafters.plot.PS; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.object.Location; import com.intellectualcrafters.plot.object.Plot; +import com.intellectualcrafters.plot.object.PlotArea; import com.intellectualcrafters.plot.object.PlotPlayer; import com.intellectualcrafters.plot.util.MainUtil; import com.intellectualcrafters.plot.util.Permissions; @@ -35,7 +37,10 @@ public class Move extends SubCommand { } Plot plot2 = MainUtil.getPlotFromString(player, args[0], true); if (plot2 == null) { - return false; + PlotArea area = PS.get().getPlotAreaByString(args[0]); + if (area == null) + return false; + plot2 = area.getPlotAbs(plot1.getId()); } if (plot1.equals(plot2)) { MainUtil.sendMessage(player, C.NOT_VALID_PLOT_ID);