diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugRoadRegen.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugRoadRegen.java index 1880cd6b0..7d69db823 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugRoadRegen.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugRoadRegen.java @@ -4,6 +4,7 @@ import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; import com.github.intellectualsites.plotsquared.plot.config.Captions; import com.github.intellectualsites.plotsquared.plot.object.Location; import com.github.intellectualsites.plotsquared.plot.object.Plot; +import com.github.intellectualsites.plotsquared.plot.object.PlotArea; import com.github.intellectualsites.plotsquared.plot.object.PlotManager; import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; @@ -16,13 +17,17 @@ public class DebugRoadRegen extends SubCommand { @Override public boolean onCommand(PlotPlayer player, String[] args) { Location loc = player.getLocation(); - PlotManager manager = loc.getPlotArea().getPlotManager(); + PlotArea area = loc.getPlotArea(); + if (area == null) { + return sendMessage(player, Captions.NOT_IN_PLOT_WORLD); + } Plot plot = player.getCurrentPlot(); if (plot == null) { Captions.NOT_IN_PLOT.send(player); } else if (plot.isMerged()) { Captions.REQUIRES_UNMERGED.send(player); } else { + PlotManager manager = area.getPlotManager(); manager.createRoadEast(plot); manager.createRoadSouth(plot); manager.createRoadSouthEast(plot);