yet another tree-cutting mod
differences from other tree-cutting mods
- no lag
- cuts from the top down
- recognizes specific species of tree (new trees must be registered)
- recognizes tree boundaries (very approximate, but can be extended)
- axes must be whitelisted (commonly known axe names are whitelisted by default)
- respects protection
- can be "on by default"
- will automatically stop before breaking your axe
- digs nodes in proportion to the axe's true speed, and will "catch up" if there's lag.
- differentiates player-built and natural trees when possible (NOTE: this only applies to structures built after this mod is installed)
toggles whether you have to hold down "sneak" to enable choppy, or whether it will be enabled by default.
register a tool that will work as an axe
unregister a tool that will work as an axe
returns "true" if choppy mode is enabled for a player. this means that existing processes will continue, and new processes can be started.
toggles whether the player has to hold down "sneak" to enable choppy, or whether it will be enabled by default.
choppy.api.register_on_choppy_start(function(process, player, start_pos, tree_node))
called when a choppy process is started. return "true" to abort the process.
called when a choppy process is stopped.
choppy.api.register_on_before_chop(function(process, player, pos, node))
called before chopping a node. return "true" to skip the node.
register a tree "shape", which allows limited ways of preventing multiple trees from being felled simultaneously. def includes two callbacks:
in_bounds = function(pos, start_pos, shape)
called for each node which may be chopped.
player_in_bounds = function(player_pos, start_pos, shape)
called to check whether the player has wandered away from the tree
register a tree. def defines a shape and a map of nodes to their type (trunk, leaves, etc.)
removes a tree from the registry