player_api/mods
MarkuBu 60e5b299af Leafdecay: Node timer based implementation, API
This implements a node-timer based leafdecay mechanism, and exposes
an API to use it in mods.

The API is documented in game_api.txt.

`default.register_leafdecay(leafdecaydef)`

`leafdecaydef` is a table, with following members:
{
	trunks = { "default:tree"}, -- nodes considered trunks
	leaves = { "default:leaves", "default:apple"}, -- nodes considered leaves
	radius = 3, -- activates leafdecay this far from the trunk
}

The algorithm will drop `leaves` items in the area if no `trunks` are found
in the `trunk_radius` sized area around the position of the leaf. If a node
listed in `leaves` has a group `leafdecay_drop > 0`, then the item is dropped,
otherwise the item is removed but not dropped.

The algorithm also implements a value `default.leafdecay_speed` (default
15) which can be modified to increase or decrease of the leaf decay. The
algorithm will vary the actual speed a bit to introduce randomness.

Leaf decay is randomized by 0.1 seconds to reduce the chance that
decay happens many times on the same second interval. This requires
nodetimer_interval to be set to values lower than 1.0 to have an
effect.

The leaves will decay between 2 and 10 seconds after digging the trunk,
and happen at non-integer second intervals.

-- The API was added by sofar.
2017-02-25 03:50:15 +00:00
..
beds Add support for custom bed sounds 2017-01-12 12:42:38 -08:00
boats Boats: Avoid crash if boat pos over limit 2016-12-21 13:42:23 +00:00
bones Bones: Search for nearby 'air' for fallback bones placement 2016-09-10 05:19:15 +01:00
bucket Bucket: Allow buckets to trigger the on_punch of entities and nodes 2016-11-02 12:39:56 +00:00
carts Carts: Fix the rail table overwrite behaviour 2017-02-12 11:39:52 -08:00
creative Creative: Cache creative mode setting 2017-02-01 17:51:35 +00:00
default Leafdecay: Node timer based implementation, API 2017-02-25 03:50:15 +00:00
doors Textures: Strip color profiles from some textures 2017-01-22 07:43:12 +00:00
dye Dye: Simplify recipes. 2017-01-11 23:53:44 -08:00
farming Make drop logic work better for non-8-step-plants. (#1544) 2017-02-08 15:59:25 -08:00
fire Textures: Strip color profiles from some textures 2017-01-22 07:43:12 +00:00
flowers Waterlily: Avoid z-fighting of base texture with water surface 2017-02-12 01:23:53 +00:00
give_initial_stuff Change WTFPL to MIT (part 3) 2016-09-07 04:44:53 +01:00
killme Add /killme chat command 2017-01-07 22:01:19 +00:00
nyancat Nyancat: Make nyancat and rainbow light sources 2016-11-10 08:10:41 +00:00
screwdriver Change WTFPL to MIT (part 3) 2016-09-07 04:44:53 +01:00
sethome Fix whitespace errors to silence luacheck. 2016-11-19 19:39:51 -08:00
sfinv Add sfinv.set_page, plus other helper functions 2017-02-10 23:54:57 +00:00
stairs Stairs: Fix smooth lighting of stair mesh 2017-01-26 17:55:16 +00:00
tnt TNT: Log explosions and player igniting tnt or gunpowder 2017-01-19 21:57:34 -08:00
vessels Do not show item overlay if slot is occupied by item (bookshelf, vessels shelf) 2016-11-14 20:03:49 +01:00
walls Licenses: (Part 4) Remove overlooked WTFPL text. Cleanup 2016-09-08 06:17:05 +01:00
wool Change WTFPL to MIT (part 3) 2016-09-07 04:44:53 +01:00
xpanes Xpanes: Improve bars texture 2016-12-04 06:35:39 +00:00