Added range command for brushes. Thanks Nichts

This commit is contained in:
Wizjany
2011-06-22 18:28:56 -04:00
parent 45302859ef
commit 021e99c252
6 changed files with 86 additions and 4 deletions

View File

@@ -302,6 +302,19 @@ public abstract class LocalPlayer {
pos.getY() - 1, pos.getZ());
}
/**
* Get the point of the block being looked at. May return null.
* Will return the farthest away air block if useLastBlock is true and no other block is found.
*
* @param range
* @param useLastBlock
* @return point
*/
public WorldVector getBlockTrace(int range, boolean useLastBlock) {
TargetBlock tb = new TargetBlock(this, range, 0.2);
return (useLastBlock ? tb.getAnyTargetBlock() : tb.getTargetBlock());
}
/**
* Get the point of the block being looked at. May return null.
*
@@ -309,8 +322,7 @@ public abstract class LocalPlayer {
* @return point
*/
public WorldVector getBlockTrace(int range) {
TargetBlock tb = new TargetBlock(this, range, 0.2);
return tb.getTargetBlock();
return getBlockTrace(range, false);
}
/**