Class GardenPatchGenerator
java.lang.Object
com.sk89q.worldedit.function.generator.GardenPatchGenerator
- All Implemented Interfaces:
RegionFunction
Generates patches of fruit (i.e. pumpkin patches).
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
apply
(BlockVector3 position) Apply the function to the given position.int
Get the number of affected blocks.static Pattern
Get a pattern that creates melons.getPlant()
Get the plant pattern that is placed.static Pattern
Get a pattern that creates pumpkins with different faces.void
Set the plant pattern that is placed.
-
Constructor Details
-
GardenPatchGenerator
Create a new instance.- Parameters:
editSession
- the edit session
-
-
Method Details
-
getPlant
Get the plant pattern that is placed.- Returns:
- the plant pattern
-
setPlant
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
Description copied from interface:RegionFunction
Apply the function to the given position.- Specified by:
apply
in interfaceRegionFunction
- Parameters:
position
- the position- Returns:
- true if something was changed
- Throws:
WorldEditException
- thrown on an error
-
getPumpkinPattern
Get a pattern that creates pumpkins with different faces.- Returns:
- a pumpkin pattern
-
getMelonPattern
Get a pattern that creates melons.- Returns:
- a melon pattern
-