height parameter for debugroadregen

This commit is contained in:
boy0001 2015-08-05 03:08:15 +10:00
parent 6944471ad6
commit 0d03e9a1d9

View File

@ -31,6 +31,7 @@ import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.object.PlotWorld;
import com.intellectualcrafters.plot.util.MainUtil;
import com.intellectualcrafters.plot.util.MathMan;
import com.plotsquared.general.commands.CommandDeclaration;
@CommandDeclaration(
@ -54,7 +55,19 @@ public class DebugRoadRegen extends SubCommand {
Plot plot = player.getCurrentPlot();
if (plot == null) {
final ChunkLoc chunk = new ChunkLoc(loc.getX() >> 4, loc.getZ() >> 4);
boolean result = HybridUtils.manager.regenerateRoad(world, chunk, 0);
int extend = 0;
if (args.length == 1) {
if (MathMan.isInteger(args[0])) {
try {
extend = Integer.parseInt(args[0]);
}
catch (Exception e) {
C.NOT_VALID_NUMBER.send(player, "(0, <EXTEND HEIGHT>)");
return false;
}
}
}
boolean result = HybridUtils.manager.regenerateRoad(world, chunk, extend);
MainUtil.sendMessage(player, "&6Regenerating chunk: " + chunk.x + "," + chunk.z + "\n&6 - Result: " + (result == true ? "&aSuccess" : "&cFailed"));
}
else {