Reorganized code, made exceptions inherit from WorldEditException, added /setchangelimit.

This commit is contained in:
sk89q
2010-10-04 16:39:35 -07:00
parent 1f7b39b8e3
commit 713f23d0de
13 changed files with 211 additions and 50 deletions

View File

@@ -36,6 +36,7 @@ public class WorldEditSession {
private boolean toolControl = true;
private int[] lastToolPos1 = new int[3];
private long lastToolClick = 0;
private int maxBlocksChanged = -1;
/**
* Clear history.
@@ -337,4 +338,21 @@ public class WorldEditSession {
public void triggerToolClick() {
lastToolClick = System.currentTimeMillis();
}
/**
* Get the maximum number of blocks that can be changed in an edit session.
* @return
*/
public int getBlockChangeLimit() {
return maxBlocksChanged;
}
/**
* Set the maximum number of blocks that can be changed.
*
* @param maxBlocksChanged
*/
public void setBlockChangeLimit(int maxBlocksChanged) {
this.maxBlocksChanged = maxBlocksChanged;
}
}