Java Code Examples for net.minecraft.util.ChunkCoordinates#getDistanceSquared()

The following examples show how to use net.minecraft.util.ChunkCoordinates#getDistanceSquared() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SubChunkUtils.java    From LookingGlass with GNU General Public License v3.0 4 votes vote down vote up
public static final boolean withinDistance(ChunkCoordinates c1, int x, int y, int z, int distance) {
	return distance * distance >= c1.getDistanceSquared(x, y, z);
}
 
Example 2
Source File: SubChunkUtils.java    From LookingGlass with GNU General Public License v3.0 4 votes vote down vote up
public static final boolean withinRange(ChunkCoordinates c1, int x, int y, int z, int d1, int d2) {
	float cDistance = c1.getDistanceSquared(x, y, z);
	return d2 * d2 >= cDistance && d1 * d1 <= cDistance;
}