Skip to content

Commit

Permalink
Added adjustable wand item.
Browse files Browse the repository at this point in the history
  • Loading branch information
sk89q committed Nov 16, 2010
1 parent c6033a7 commit a8972e9
Showing 1 changed file with 6 additions and 31 deletions.
37 changes: 6 additions & 31 deletions src/WorldEditListener.java
Expand Up @@ -79,43 +79,16 @@ public class WorldEditListener extends PluginListener {
*/
private GroupRestrictionsManager restrictions = new GroupRestrictionsManager();

/**
* True to time operations.
*/
private boolean profile;
/**
* List of allowed blocks.
*/
private HashSet<Integer> allowedBlocks;
/**
* Default maximum number of blocks that can be changed in one operation.
*/
private int defaultChangeLimit = -1;
/**
* Shell script save type.
*/
private String shellSaveType;
/**
* Snapshot repository used for restoring from backups. This may be null
* if snapshot restoration is not configured.
*/
private SnapshotRepository snapshotRepo;
/**
* Max radius for commands that use a radius.
*/
private int maxRadius = -1;
/**
* Max super pick axe size.
*/
private int maxSuperPickaxeSize = 5;
/**
* Indicates whether commands should be logged to the console.
*/
private boolean logComands = false;
/**
* True to register the commands with the help system.
*/
private boolean registerHelp = true;
private int wandItem = 271;

/**
* Construct an instance of the plugin.
Expand Down Expand Up @@ -534,7 +507,7 @@ public boolean performCommand(WorldEditPlayer player,
// Edit wand
} else if (split[0].equalsIgnoreCase("//wand")) {
checkArgs(split, 0, 0, split[0]);
player.giveItem(271, 1);
player.giveItem(wandItem, 1);
player.print("Left click: select pos #1; Right click: select pos #2");
return true;

Expand Down Expand Up @@ -1504,7 +1477,7 @@ public boolean onBlockCreate(Player modPlayer, Block blockPlaced,

WorldEditSession session = getSession(player);

if (itemInHand == 271 && session.isToolControlEnabled()) {
if (itemInHand == wandItem && session.isToolControlEnabled()) {
Vector cur = Vector.toBlockPoint(blockClicked.getX(),
blockClicked.getY(),
blockClicked.getZ());
Expand Down Expand Up @@ -1552,7 +1525,7 @@ public boolean onBlockDestroy(Player modPlayer, Block blockClicked) {
WorldEditPlayer player = new WorldEditPlayer(modPlayer);
WorldEditSession session = getSession(player);

if (player.getItemInHand() == 271) {
if (player.getItemInHand() == wandItem) {
if (session.isToolControlEnabled()) {
Vector cur = Vector.toBlockPoint(blockClicked.getX(),
blockClicked.getY(),
Expand Down Expand Up @@ -1787,6 +1760,8 @@ public void loadConfiguration() {

profile = properties.getBoolean("debug-profile", false);

wandItem = properties.getInt("wand-item", 271);

// Get allowed blocks
allowedBlocks = new HashSet<Integer>();
for (String b : properties.getString("allowed-blocks",
Expand Down

0 comments on commit a8972e9

Please sign in to comment.