Package com.zetaplugins.timberz.service
Class TreeDetectionService
java.lang.Object
com.zetaplugins.timberz.service.TreeDetectionService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsLog
(org.bukkit.Material blockType) void
Fetches the log-to-leaf mapping from the configuration file.org.bukkit.Material
getLeafType
(org.bukkit.Material logType) Get the corresponding leaf type for a log typeSet
<org.bukkit.block.Block> identifyTreeStructure
(org.bukkit.block.Block sourceBlock) Core algorithm to identify a complete tree structure from a source log block.
-
Constructor Details
-
TreeDetectionService
-
-
Method Details
-
fetchLogToLeaveMap
public void fetchLogToLeaveMap()Fetches the log-to-leaf mapping from the configuration file. -
identifyTreeStructure
Core algorithm to identify a complete tree structure from a source log block.- Parameters:
sourceBlock
- The log block that was broken by a player- Returns:
- A set of all blocks that make up the tree, or empty set if not a valid tree
-
containsLog
public boolean containsLog(org.bukkit.Material blockType) -
getLeafType
public org.bukkit.Material getLeafType(org.bukkit.Material logType) Get the corresponding leaf type for a log type
-