Package net.glowstone.generator.objects
Class OreVein
java.lang.Object
net.glowstone.generator.objects.OreVein
- All Implemented Interfaces:
TerrainObject
-
Field Summary
Fields inherited from interface net.glowstone.generator.objects.TerrainObject
PLANT_TYPES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanGenerates this feature.protected static doublenormalizedSquaredCoordinate(double origin, double radius, int x) The square of the percentage of the radius that is the distance between the given block's center and the center of an orthogonal ellipsoid.
-
Constructor Details
-
OreVein
Creates the instance for a given ore type.- Parameters:
oreType- the ore type
-
-
Method Details
-
generate
public boolean generate(org.bukkit.World world, Random random, int sourceX, int sourceY, int sourceZ) Description copied from interface:TerrainObjectGenerates this feature.- Specified by:
generatein interfaceTerrainObject- Parameters:
world- the world to generate inrandom- the PRNG that will choose the size and a few details of the shapesourceX- the base X coordinatesourceY- the base Y coordinatesourceZ- the base Z coordinate- Returns:
- true if successfully generated
-
normalizedSquaredCoordinate
protected static double normalizedSquaredCoordinate(double origin, double radius, int x) The square of the percentage of the radius that is the distance between the given block's center and the center of an orthogonal ellipsoid. A block's center is inside the ellipsoid if and only if its normalizedSquaredCoordinate values add up to less than 1.- Parameters:
origin- the center of the spheroidradius- the spheroid's radius on this axisx- the raw coordinate- Returns:
- the square of the normalized coordinate
-