This commit is contained in:
boy0001 2015-02-22 17:13:52 +11:00
parent 3852df4fd2
commit bb5eb55761

View File

@ -22,8 +22,11 @@ package com.intellectualcrafters.plot.commands;
import com.intellectualcrafters.plot.PlotSquared; import com.intellectualcrafters.plot.PlotSquared;
import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.generator.BukkitHybridUtils;
import com.intellectualcrafters.plot.generator.HybridPlotManager; import com.intellectualcrafters.plot.generator.HybridPlotManager;
import com.intellectualcrafters.plot.generator.HybridPlotWorld; import com.intellectualcrafters.plot.generator.HybridPlotWorld;
import com.intellectualcrafters.plot.generator.HybridUtils;
import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotPlayer; import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.MainUtil; import com.intellectualcrafters.plot.util.MainUtil;
@ -36,18 +39,17 @@ public class CreateRoadSchematic extends SubCommand {
@Override @Override
public boolean execute(final PlotPlayer player, final String... args) { public boolean execute(final PlotPlayer player, final String... args) {
if (!BukkitPlayerFunctions.isInPlot(player)) { Location loc = player.getLocation();
MainUtil.sendMessage(BukkitUtil.getPlayer(player), C.NOT_IN_PLOT); Plot plot = MainUtil.getPlot(loc);
return false; if (plot == null) {
return sendMessage(player, C.NOT_IN_PLOT);
} }
if (!(PlotSquared.getPlotWorld(player.getWorld()) instanceof HybridPlotWorld)) { if (!(PlotSquared.getPlotWorld(loc.getWorld()) instanceof HybridPlotWorld)) {
return sendMessage(player, C.NOT_IN_PLOT_WORLD); return sendMessage(player, C.NOT_IN_PLOT_WORLD);
} }
final Plot plot = MainUtil.getPlot(loc); HybridUtils.manager.setupRoadSchematic(plot);
final HybridPlotManager manager = (HybridPlotManager) PlotSquared.getPlotManager(player.getWorld()); MainUtil.update(loc);
manager.setupRoadSchematic(plot); MainUtil.sendMessage(player, "&6Saved new road schematic");
MainUtil.update(BukkitUtil.getLocation(entity));
MainUtil.sendMessage(BukkitUtil.getPlayer(player), "&6Saved new road schematic");
return true; return true;
} }
} }