Class GardenPatchGenerator

java.lang.Object
com.sk89q.worldedit.function.generator.GardenPatchGenerator
All Implemented Interfaces:
RegionFunction

public class GardenPatchGenerator extends Object implements RegionFunction
Generates patches of fruit (i.e. pumpkin patches).
  • Constructor Details

    • GardenPatchGenerator

      public GardenPatchGenerator(EditSession editSession)
      Create a new instance.
      Parameters:
      editSession - the edit session
  • Method Details

    • getPlant

      public Pattern getPlant()
      Get the plant pattern that is placed.
      Returns:
      the plant pattern
    • setPlant

      public void setPlant(Pattern plant)
      Set the plant pattern that is placed.
      Parameters:
      plant - the plant pattern
    • getAffected

      public int getAffected()
      Get the number of affected blocks.
      Returns:
      affected count
    • apply

      public boolean apply(BlockVector3 position) throws WorldEditException
      Description copied from interface: RegionFunction
      Apply the function to the given position.
      Specified by:
      apply in interface RegionFunction
      Parameters:
      position - the position
      Returns:
      true if something was changed
      Throws:
      WorldEditException - thrown on an error
    • getPumpkinPattern

      public static Pattern getPumpkinPattern()
      Get a pattern that creates pumpkins with different faces.
      Returns:
      a pumpkin pattern
    • getMelonPattern

      public static Pattern getMelonPattern()
      Get a pattern that creates melons.
      Returns:
      a melon pattern