16 Commits

Author SHA1 Message Date
Aaron Suen
eaa1f34c3f Fix peat auto-fermenting bug
Peat should never ferment on its own, it should require face
contact with some kind of soil.  Unifying it with tree growth rate
code caused it to ferment on its own because the assumption that
tree roots contain their own soil and base moisture.  Peat should
only have its own moisture but not its own soil.

This also allows peat to be used as an emergency "moist" node on
its own in e.g. skyrealms for cultivating flora, as long as it's
contained so that only its moisture can leak out but it cannot
be exposed to fermenting microorganisms from nearby soil.
2023-05-06 19:48:28 -04:00
Aaron Suen
166cfe5f14 Mitigate excess server block sends
The problem was pointed out by Josh
(gitlab.com/krazy-j) in merge request !22.
Apparently MT is not very smart about marking
mapblocks dirty to send to clients based on
calling mt.set_node(), i.e. it will mark them
dirty presumptively even if you set the node to
the same value it had already been.

This behavior can be confirmed by registering
an ABM against a common node like grass and
setting action = minetest.set_node.  This
causes every mapblock containing that node
to be invalidated every interval, causing a big
spike in the packets received each interval
that you can clearly see on the F5 graph.

Rather than just fixing it for the most easily
observed case (fire checks), add utlity functions
to check this for ALL node change situations,
and apply it more or less universally anywhere
that we are not certain that the node is being
changed and we don't need to worry about the
extra overhead cost of the check.

Note that we don't need a
nodecore.set_loud_check call, as set_loud was
only ever being used already in cases where
we were pretty sure we were actually changing
a node.
2022-08-24 20:44:14 -04:00
Aaron Suen
7a21096731 Accelerate leaf decay
When leaves decay, they accelerate checks for
decay of nearby leaves, so overall tree leaves
decay much faster, but without increasing load
at steady-state i.e. for stable trees.
2021-02-28 16:45:02 -05:00
Aaron Suen
0cb72f7f2b Updated code standards. 2020-02-27 19:11:12 -05:00
Aaron Suen
6db8d9fc26 Adjust things to work in twilight.
- Lenses no longer produce light from sun at all;
  artificial light is always needed.
- Grass and trees survive, don't do dual-time check.
- Breeze sounds work in twilight.
- Sponge drying only requires twilight, now also can
  happen under artificial light.
- Peat to grass happens under twilight.
2020-02-22 16:55:42 -05:00
Aaron Suen
c7a322941e Experimental new natural light system.
- No day/night cycle, no sun/moon.
- Get rid of clouds too.
- Skybox is now 100% texture-packable.
- Natural light diminishes with depth.

Night-time no longer disrupts gameplay topside, but
skylights are no longer useful to an infinite depth and
artificial light is necessary for all deep mining.
2020-02-22 10:38:03 -05:00
Aaron Suen
9de5fcfb5a Fix tree growth intrusion.
- Tree trunk growth now stops if blocked.
- Fix eligibility check for /growtrees cmd.
- Tree trunk growth rate now API-ified.
2020-01-17 13:38:59 -05:00
Aaron Suen
f9fe2027b8 Standardize leaf placement, fix bugs. 2020-01-15 23:01:11 -05:00
Aaron Suen
aca630ee32 Fix leaves blocking eggcorn soaking. 2019-12-28 22:04:34 -05:00
Aaron Suen
ec723ea6d2 Tree growth requires adequate light and space. 2019-10-19 11:00:18 -04:00
Aaron Suen
90dd2c259b Fix and clean up tree growth and composting. 2019-10-06 09:26:18 -04:00
Aaron Suen
52de19a28c Unified falling check, check after craft. 2019-09-09 07:05:01 -04:00
Aaron Suen
39dea8a2ae MAJOR: Code quality audit using luacheck.
- Removed lots of unused variables, a few shadowed identifiers.
- Removed a few sections of dead code.
2019-08-31 09:26:53 -04:00
Aaron Suen
fe2c153f9e Clean up all lua code style.
Formatting rules based on Paul Kulchenko's perl-based formatter...
http://notebook.kulchenko.com/programming/lua-beautifier-in-55-lines-of-perl
...using a single tab for indent.

Mostly pure whitespace changes.
2019-08-27 19:14:51 -04:00
Aaron Suen
2d3b468c65 Knock out a bunch of small low-hanging issues.
- Eggcorn cleanup.  They look a little better falling out of the
  tree, and we don't have so many now.
- Crushing damage fixes.  Crushing is nuanced now, and most things
  don't smush you, and many do reduced damage.  A few may do more.
- Item stack convenience.  Items landing on a stack or right-
  clicked onto one attempt to merge into it.
- Ladders now fall (they don't connect to sides).  Use the new
  full-scale frames for ones that don't.
2019-01-29 20:41:29 -05:00
Aaron Suen
e2dd2de5ba Leaf decay, woodcraft wears tools. 2019-01-05 23:11:38 -05:00