Added the navigation wand.

Dieser Commit ist enthalten in:
sk89q 2011-01-19 02:43:26 -08:00
Ursprung 669a1911af
Commit 43f9acb690
3 geänderte Dateien mit 12 neuen und 0 gelöschten Zeilen

Datei anzeigen

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

Datei anzeigen

@ -1913,6 +1913,14 @@ public class WorldEditController {
player, session, null); player, session, null);
return true; 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; return false;

Datei anzeigen

@ -61,6 +61,8 @@ public class BukkitConfiguration extends LocalConfiguration {
useInventoryOverride = config.getBoolean("use-inventory.allow-override", useInventoryOverride = config.getBoolean("use-inventory.allow-override",
useInventoryOverride); useInventoryOverride);
maxBrushRadius = config.getInt("limits.max-brush-radius", maxBrushRadius); 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)); disallowedBlocks = new HashSet<Integer>(config.getIntList("limits.disallowed-blocks", null));