mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 15:16:45 +01:00
Fix move command
This commit is contained in:
parent
6005501320
commit
33256e0ea4
@ -34,6 +34,7 @@ public enum Command {
|
||||
// (Rating system) (ratings can be stored as the average, and number of
|
||||
// ratings)
|
||||
// - /plot rate <number out of 10>
|
||||
MOVE("move", ""),
|
||||
FLAG("flag", "f"),
|
||||
TARGET("target"),
|
||||
CLUSTER("cluster", "clusters"),
|
||||
|
@ -21,6 +21,7 @@
|
||||
package com.intellectualcrafters.plot.commands;
|
||||
|
||||
import com.intellectualcrafters.plot.PlotSquared;
|
||||
import com.intellectualcrafters.plot.commands.SubCommand.CommandCategory;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.object.Location;
|
||||
import com.intellectualcrafters.plot.object.Plot;
|
||||
@ -37,7 +38,7 @@ import com.intellectualcrafters.plot.util.Permissions;
|
||||
*/
|
||||
public class Move extends SubCommand {
|
||||
public Move() {
|
||||
super("debugmove", "plots.move", "Move a plot", "move", "", CommandCategory.ACTIONS, true);
|
||||
super(Command.MOVE, "Move a plot", "debugmove", CommandCategory.ACTIONS, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -77,6 +78,9 @@ public class Move extends SubCommand {
|
||||
world2 = world;
|
||||
}
|
||||
Plot plot2 = MainUtil.getPlot(world2, plot2id);
|
||||
|
||||
System.out.print(plot1 + " | " + plot2);
|
||||
|
||||
if (plot1.equals(plot2)) {
|
||||
MainUtil.sendMessage(plr, C.NOT_VALID_PLOT_ID);
|
||||
MainUtil.sendMessage(plr, C.COMMAND_SYNTAX, "/plot move <X;Z>");
|
||||
|
@ -859,7 +859,7 @@ public class MainUtil {
|
||||
|
||||
public static boolean move(final Plot plot1, final Plot plot2, final Runnable whenDone) {
|
||||
final com.intellectualcrafters.plot.object.Location bot1 = MainUtil.getPlotBottomLoc(plot1.world, plot1.id);
|
||||
final com.intellectualcrafters.plot.object.Location bot2 = MainUtil.getPlotBottomLoc(plot1.world, plot1.id);
|
||||
final com.intellectualcrafters.plot.object.Location bot2 = MainUtil.getPlotBottomLoc(plot2.world, plot1.id);
|
||||
final Location top = MainUtil.getPlotTopLoc(plot1.world, plot1.id);
|
||||
if (plot1.owner == null) {
|
||||
TaskManager.runTaskLater(whenDone, 1);
|
||||
@ -883,6 +883,9 @@ public class MainUtil {
|
||||
plot.id.y += offset_y;
|
||||
PlotSquared.getPlots(plot2.world).put(plot.id, plot);
|
||||
}
|
||||
System.out.print("BOT: " + bot1);
|
||||
System.out.print("TOP: " + top);
|
||||
System.out.print(" -> " + bot2);
|
||||
ChunkManager.manager.copyRegion(bot1, top, bot2, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
Loading…
Reference in New Issue
Block a user