Added BlockVector a la WorldEdit as requested by #246. This BlockVector is safe to be used as keys in hash sets and hash maps, but it is mutable and careful attention must be paid to not modify the vector post-insertion into a set or map.
This commit is contained in:
@@ -563,6 +563,15 @@ public class Vector implements Cloneable {
|
||||
public Location toLocation(World world, float yaw, float pitch) {
|
||||
return new Location(world, x, y, z, yaw, pitch);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the block vector of this vector.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public BlockVector toBlockVector() {
|
||||
return new BlockVector(x, y, z);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the threshold used for equals().
|
||||
|
||||
Reference in New Issue
Block a user