Added /toggleplace which lets you perform actions that require one point to use position #1 rather than your feet.

This commit is contained in:
sk89q
2010-10-14 02:14:18 -07:00
parent 9739336730
commit 5f1a014bfb
2 changed files with 42 additions and 5 deletions

View File

@@ -28,6 +28,7 @@ import java.util.LinkedList;
*/
public class WorldEditSession {
public static final int MAX_HISTORY_SIZE = 15;
private boolean placeAtPos1 = false;
private Vector pos1, pos2;
private Region region;
private LinkedList<EditSession> history = new LinkedList<EditSession>();
@@ -282,4 +283,26 @@ public class WorldEditSession {
superPickAxe = !superPickAxe;
return superPickAxe;
}
/**
* @return position
* @throws IncompleteRegionException
*/
public Vector getPlacementPosition(WorldEditPlayer player)
throws IncompleteRegionException {
if (!placeAtPos1) {
return player.getBlockIn();
}
checkPos1();
return pos1;
}
/**
* Toggle placement position;
*/
public boolean togglePlacementPosition() {
placeAtPos1 = !placeAtPos1;
return placeAtPos1;
}
}