Added the navigation wand.

This commit is contained in:
sk89q 2011-01-19 02:43:26 -08:00
parent 669a1911af
commit 43f9acb690
3 changed files with 12 additions and 0 deletions

View File

@ -52,6 +52,8 @@ public abstract class LocalConfiguration {
public boolean noDoubleSlash = false;
public boolean useInventory = false;
public boolean useInventoryOverride = false;
public int navigationWand = 345;
public int navigationWandMaxDistance = 50;
/**
* Loads the configuration.

View File

@ -1913,6 +1913,14 @@ public class WorldEditController {
player, session, null);
return true;
}
} else if (player.getItemInHand() == config.navigationWand
&& config.navigationWandMaxDistance > 0) {
WorldVector pos = player.getSolidBlockTrace(config.navigationWandMaxDistance);
if (pos != null) {
player.findFreePosition(pos);
} else {
player.printError("No block in sight (or too far)!");
}
}
return false;

View File

@ -61,6 +61,8 @@ public class BukkitConfiguration extends LocalConfiguration {
useInventoryOverride = config.getBoolean("use-inventory.allow-override",
useInventoryOverride);
maxBrushRadius = config.getInt("limits.max-brush-radius", maxBrushRadius);
navigationWand = config.getInt("navigation-wand-item", navigationWand);
navigationWandMaxDistance = config.getInt("navigation-wand-max-distance", navigationWandMaxDistance);
disallowedBlocks = new HashSet<Integer>(config.getIntList("limits.disallowed-blocks", null));