Fixed /jumpto and the help for //expand and //contract.

This commit is contained in:
sk89q
2010-11-10 01:54:07 -08:00
parent 586ae69467
commit b0330aa83c
2 changed files with 24 additions and 3 deletions

View File

@ -315,6 +315,27 @@ public class WorldEditPlayer {
return new Vector(block.getX(), block.getY(), block.getZ());
}
/**
* Get the point of the block being looked at. May return null.
*
* @param range
* @return point
*/
public Vector getSolidBlockTrace(int range) {
HitBlox hitBlox = new HitBlox(player, range, 0.2);
Block block = null;
while (hitBlox.getNextBlock() != null
&& BlockType.canPassThrough(hitBlox.getCurBlock().getType()));
block = hitBlox.getCurBlock();
if (block == null) {
return null;
}
return new Vector(block.getX(), block.getY(), block.getZ());
}
/**
* Get the player's cardinal direction (N, W, NW, etc.).
*