Class OreVein

java.lang.Object
net.glowstone.generator.objects.OreVein
All Implemented Interfaces:
TerrainObject

public class OreVein extends Object implements TerrainObject
  • Field Summary

    Fields inherited from interface net.glowstone.generator.objects.TerrainObject

    PLANT_TYPES
  • Constructor Summary

    Constructors
    Constructor
    Description
    OreVein(OreType oreType)
    Creates the instance for a given ore type.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    generate(org.bukkit.World world, Random random, int sourceX, int sourceY, int sourceZ)
    Generates this feature.
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OreVein

      public OreVein(OreType oreType)
      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: TerrainObject
      Generates this feature.
      Specified by:
      generate in interface TerrainObject
      Parameters:
      world - the world to generate in
      random - the PRNG that will choose the size and a few details of the shape
      sourceX - the base X coordinate
      sourceY - the base Y coordinate
      sourceZ - 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 spheroid
      radius - the spheroid's radius on this axis
      x - the raw coordinate
      Returns:
      the square of the normalized coordinate