From bb5eb5576182e60b4d8a367f727f30fcc78c4836 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Sun, 22 Feb 2015 17:13:52 +1100 Subject: [PATCH] hybrid --- .../plot/commands/CreateRoadSchematic.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/CreateRoadSchematic.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/CreateRoadSchematic.java index 4591cdce2..42ef8e481 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/CreateRoadSchematic.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/CreateRoadSchematic.java @@ -22,8 +22,11 @@ package com.intellectualcrafters.plot.commands; import com.intellectualcrafters.plot.PlotSquared; import com.intellectualcrafters.plot.config.C; +import com.intellectualcrafters.plot.generator.BukkitHybridUtils; import com.intellectualcrafters.plot.generator.HybridPlotManager; 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.PlotPlayer; import com.intellectualcrafters.plot.util.MainUtil; @@ -36,18 +39,17 @@ public class CreateRoadSchematic extends SubCommand { @Override public boolean execute(final PlotPlayer player, final String... args) { - if (!BukkitPlayerFunctions.isInPlot(player)) { - MainUtil.sendMessage(BukkitUtil.getPlayer(player), C.NOT_IN_PLOT); - return false; + Location loc = player.getLocation(); + Plot plot = MainUtil.getPlot(loc); + 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); } - final Plot plot = MainUtil.getPlot(loc); - final HybridPlotManager manager = (HybridPlotManager) PlotSquared.getPlotManager(player.getWorld()); - manager.setupRoadSchematic(plot); - MainUtil.update(BukkitUtil.getLocation(entity)); - MainUtil.sendMessage(BukkitUtil.getPlayer(player), "&6Saved new road schematic"); + HybridUtils.manager.setupRoadSchematic(plot); + MainUtil.update(loc); + MainUtil.sendMessage(player, "&6Saved new road schematic"); return true; } }