Hows this?

This commit is contained in:
boy0001
2015-09-13 14:04:31 +10:00
parent 1cccdd9d4d
commit 5137b23357
379 changed files with 18471 additions and 28437 deletions

View File

@ -41,31 +41,25 @@ requiredType = RequiredType.NONE,
description = "Regenerate all roads based on the road schematic",
category = CommandCategory.DEBUG,
permission = "plots.debugroadregen")
public class DebugRoadRegen extends SubCommand
{
public class DebugRoadRegen extends SubCommand {
@Override
public boolean onCommand(final PlotPlayer player, final String... args)
{
public boolean onCommand(final PlotPlayer player, final String... args) {
final Location loc = player.getLocation();
final String world = loc.getWorld();
final PlotWorld plotworld = PS.get().getPlotWorld(world);
if (!(plotworld instanceof HybridPlotWorld)) { return sendMessage(player, C.NOT_IN_PLOT_WORLD); }
if (!(plotworld instanceof HybridPlotWorld)) {
return sendMessage(player, C.NOT_IN_PLOT_WORLD);
}
final Plot plot = player.getCurrentPlot();
if (plot == null)
{
if (plot == null) {
final ChunkLoc chunk = new ChunkLoc(loc.getX() >> 4, loc.getZ() >> 4);
int extend = 0;
if (args.length == 1)
{
if (MathMan.isInteger(args[0]))
{
try
{
if (args.length == 1) {
if (MathMan.isInteger(args[0])) {
try {
extend = Integer.parseInt(args[0]);
}
catch (final Exception e)
{
} catch (final Exception e) {
C.NOT_VALID_NUMBER.send(player, "(0, <EXTEND HEIGHT>)");
return false;
}
@ -74,9 +68,7 @@ public class DebugRoadRegen extends SubCommand
final boolean result = HybridUtils.manager.regenerateRoad(world, chunk, extend);
MainUtil.sendMessage(player, "&6Regenerating chunk: " + chunk.x + "," + chunk.z + "\n&6 - Result: " + (result == true ? "&aSuccess" : "&cFailed"));
MainUtil.sendMessage(player, "&cTo regenerate all roads: /plot regenallroads");
}
else
{
} else {
final HybridPlotManager manager = (HybridPlotManager) PS.get().getPlotManager(world);
manager.createRoadEast(plotworld, plot);
manager.createRoadSouth(plotworld, plot);