Interface TerrainObject

All Known Implementing Classes:
AcaciaTree, BigOakTree, BigTree, BirchTree, BlockPatch, BrownMushroomTree, Cactus, CocoaTree, DarkOakTree, DoubleTallPlant, Flower, GenericTree, GlowStructure, GlowTemple, IceSpike, JungleBush, JungleTree, Lake, MegaJungleTree, MegaPineTree, MegaRedwoodTree, MegaSpruceTree, ObsidianPillar, OreVein, RedMushroomTree, RedwoodTree, StoneBoulder, SugarCane, SwampTree, TallBirchTree, TallGrass, TallRedwoodTree
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface TerrainObject
A terrain feature that can randomly generate itself at specified locations, replacing blocks.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final SortedSet<org.bukkit.Material>
    Plant block types.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    generate(org.bukkit.World world, Random random, int sourceX, int sourceY, int sourceZ)
    Generates this feature.
    static boolean
    killPlantAbove(org.bukkit.block.Block block)
    Removes the grass, shrub, flower or mushroom directly above the given block, if present.
  • Field Details

    • PLANT_TYPES

      static final SortedSet<org.bukkit.Material> PLANT_TYPES
      Plant block types.
  • Method Details

    • killPlantAbove

      static boolean killPlantAbove(org.bukkit.block.Block block)
      Removes the grass, shrub, flower or mushroom directly above the given block, if present. Does not drop an item.
      Parameters:
      block - the block to update
      Returns:
      true if a plant was removed; false if none was present
    • generate

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