2082 Commits

Author SHA1 Message Date
Aaron Suen
8edd665b68 Revert "Make grass node undersides subtly distinguishable from dirt"
This reverts commit b1661c976e3a6420c3917a5322ee72e0dd9ddb6d.

This was done inconsistently and the problem extends to a number
of nodes, which should probably all be fixed at the same time.
2021-12-04 21:31:08 -05:00
Aaron Suen
7f5155f91d Glowing lens slow-start
Lenses enter a "glowing" state to propagate signal
immediately as before, but now they don't actually
produce light until powered steadily for 2 seconds.

This should mitigate the risk of "strobe" circuits that
cause excess lighting recalculations and irritate some
sensitive players.
2021-12-03 23:04:58 -05:00
Aaron Suen
8bf23e6f0a Fix DNTs not being reset on node replace
Invalidate DNT cache when nodes are changed and
force it to be re-read from meta, as meta was also
likely cleared during that operation.
2021-12-03 23:02:31 -05:00
Aaron Suen
8d38fe5421 Make mature sedges easier to spot
Use a taller, fully square selection box for them,
adding 1 extra level worth of box height (from 4/8
to 6/8 instead of 4/8 to 5/8).
2021-12-03 22:41:39 -05:00
Aaron Suen
b1661c976e Make grass node undersides subtly distinguishable from dirt
Add grass root texture to underside (and visible part of dirt
on sides) of grass node.  The difference in node sounds but same
visuals was always an inconsistency, and since touchtips became
looktips, players being able to distinguish grass from dirt from
the underside didn't make sense without an actual visual
difference.
2021-12-03 08:15:56 -05:00
Aaron Suen
34a2562964 Polyfill for player:get_velocity, clean up other hooks
This gets rid of the 5.4+ "deprecated get_player_velocity" warning
and modernizes the code to use get_velocity() everywhere, while
still remaining compatible with 5.3 for now (tested).  The polyfill
had to be on joinplayer because the nc_player_pickup auto-one-time
method of using after() won't reliably patch the player before some
other globalstep tries to read player velocity.

When MT 5.5 is released and 5.3 support ends, the polyfill just
needs to be removed to clean it up.

Also tidied up and consistentized the logging for other hooks.
2021-12-03 08:09:57 -05:00
Aaron Suen
7aaf383f70 Annealed lode forms 2021-12-02 22:07:13 -05:00
Aaron Suen
a861cb7cba Wet things also suffocate grass
Wet or living sponges on top of grass will not allow
air in and will suffocate grass.
2021-12-02 18:39:34 -05:00
Aaron Suen
0f0f4efbff Make leaves and other non-walkables press-diggable
Check for a dig recipe first before attempting to
catapult item through the node.  This should make all
non-solid nodes diggable including loose leaves,
sedges, rushes, flowers, etc.
2021-12-02 18:33:24 -05:00
Aaron Suen
13e71e5c53 Disallow forms inside other storeboxes
Consistent with other shelves
2021-12-02 18:28:14 -05:00
Aaron Suen
af44989f7a Add simple "current tab" indicator 2021-12-02 07:33:01 -05:00
Aaron Suen
44b2aa4b25 Formal API for pushing events into inventory tabs
Mods that are responsible for inventory tabs can setup their
own event hooks, then call inventory_notify to alert inventory
tabs of certain events.

Inventory tabs can include registered handlers for specific events
allowing them to e.g. clear caches, and then if the handler
evaluates to true, the tab is updated.
2021-12-02 07:09:07 -05:00
Aaron Suen
6866bade5b Remember player's last inventory tab
Note that some tabs may have time-dependent contents (e.g. the
hints/challenges tab, or add-on mod tabs) and need to be notified
of this in the event that they are the current tab.  It will
be the responsibility of each tab to watch for appropriate events
and perform background updates as necessary.  The hint tab does
this on an event-driven basis from player discovery.
2021-12-02 06:55:09 -05:00
Aaron Suen
ce27780dd4 Preserve raw forms of ALL base APIs 2021-12-02 06:19:38 -05:00
Aaron Suen
b9d9efe0c1 Make stack columns work with catapult from forms 2021-12-01 20:51:37 -05:00
Aaron Suen
96ba8342ea Fix items tunneling upward from confined spaces
Items being "bumped up" upon landing due to the new column
preserving falling mechanics will never be lifted to higher than
the local maximum posiiton from which they fell.

This should prevent e.g. planks tunneling up several nodes from
a log chopping machine if there isn't enough room for the planks
to escape and the chopping machine is enclosed from above.  Items
can still tunnel using the normal "settling" mechanics, but will
not have the strong upward bias that the column settling mechanic
gave them.
2021-12-01 07:57:08 -05:00
Aaron Suen
36d30ee1aa Storeboxes are always door-diggable from below 2021-12-01 07:46:07 -05:00
Aaron Suen
4acedd01a3 Fix door press crafting recipes
The door could not handle recipes with duplicate
labels, which now includes the anvil recipes.

Switch to just identifying them by reference.
2021-11-30 21:13:41 -05:00
Aaron Suen
413641aa71 Fix delayed witness, finish known form use-cases 2021-11-29 23:10:22 -05:00
Aaron Suen
bba0a17abe Flexible craft discovery API
- Flexible discovery list format for discover and
  witness APIs
- Add "discover" key to recipes that contains a list
  of discoveries to give players so they can act like
  recipe groups and allow different recipes to
  complete hints

Recipe group system should be easier to setup for
hints than having to list all hints individually.  We
can use them especially in recipes that are loop
generated.
2021-11-29 21:08:34 -05:00
Aaron Suen
9120c78511 Compact mod list formatting
Make it easier to fit long lists of related mods in
the About box if possible
2021-11-29 20:41:09 -05:00
Aaron Suen
16022542d9 List non-game mods directly on About screen 2021-11-27 22:03:18 -05:00
Aaron Suen
d0edf8bc38 Fix crash: item settling must always return stacks 2021-11-27 19:57:38 -05:00
Aaron Suen
9235744612 Items can cool in storeboxes, but not cook
Cooking recipes run in all visinv nodes, not just
item stacks, BUT non-stack-only nodes (i.e. all
storeboxes) block flame touchgroups so things
in boxes cannot be heated/melted.

This allows items dropped into boxes from ore
melting to cool, but prevents sand from being
melted in a box which would naively replace
the box with the molten glass entirely.

This also fixes an old rumored bug where forcing
glowing lode items into a shelf with a door would
cause them to stay hot indefinitely.

N.B. lode cooking/cooling used to assume it could
replace the entire node, and deleted the thing
as a fail-safe when an item of the given temper
was not found (e.g. tools w/ handles).  This is
now gone, and invalid tempers will throw errors
if they can ever be achieved in practice.
2021-11-27 19:26:31 -05:00
Aaron Suen
919eec3e1b Wooden forms are choppy
Either dig them with a hatchet/adze, or "collapse"
them back to frames to move them by hand.
Even though it's the same basic material as the
wooden frame, having them too easy to dig
makes it to easy to accidentally dig while trying
to pull items from it.
2021-11-27 18:47:59 -05:00
Aaron Suen
6bbec211e7 Merge branch 'dev' into pezredo 2021-11-27 18:37:56 -05:00
Aaron Suen
c4f79c2f6d Disallow form->frame when occupied
This was destroying the stack inside the form.
2021-11-27 18:37:48 -05:00
Aaron Suen
3a6dab2b62 Fix blockage detection w/ forms 2021-11-27 18:30:15 -05:00
Aaron Suen
597ad823ae New smarter stack settling recursion
When an ent settles, start an iterative process
of checking each ent near it for settling, bumping
ents upward as needed (during the process only)
and keeping them ordered by their starting height
so that things that start lower settle earlier (and
thus remain lower) even if ents have fallen and
bunched up together due to physics and large
timesteps.

Seems to work fully for falling_nodes (keeps
them in a column and settles them in order), and
partially for items (keeps them in a column but
does not always settle them in order).
2021-11-27 18:25:10 -05:00
Aaron Suen
b33769d56f Remove legacy pez dispenser handling
This puts all falling item and node entities on a
level field with items falling through forms again.
2021-11-27 17:39:38 -05:00
Aaron Suen
148790bdcb Merge branch 'dev' into fallthrureform 2021-11-27 16:16:11 -05:00
Aaron Suen
2f5b2daf93 Add lode ladders and frames 2021-11-27 16:14:25 -05:00
Aaron Suen
a0bc9a2bed Merge branch 'dev' into fallthrureform 2021-11-27 15:50:22 -05:00
Aaron Suen
ab79dd9949 Nerf rush farming dirt consumption
Only consume soil quality 1/4 times
2021-11-27 15:49:38 -05:00
Aaron Suen
24e16a97d8 Make thatch use grassy sounds too 2021-11-27 15:48:44 -05:00
Aaron Suen
61a494d297 Make sedges use grassy sounds 2021-11-27 15:48:27 -05:00
Aaron Suen
5b076d1c6d Columns of items now fall through forms 2021-11-27 15:43:44 -05:00
Aaron Suen
2e13a95e82 Standardize items falling out of shelves 2021-11-27 15:38:03 -05:00
Aaron Suen
443bade6d6 Unified custom falling checks 2021-11-27 15:21:11 -05:00
Aaron Suen
ce99412270 Item entities properly fall thru forms 2021-11-27 15:08:40 -05:00
Aaron Suen
591aca0ced More sedge fixes 2021-11-27 13:45:42 -05:00
Aaron Suen
3c071dba09 Merge branch 'dev' into fallthrureform 2021-11-27 13:37:00 -05:00
Aaron Suen
5392a2ab3a Fix sedge farming
Instead of trying to always drop a sedge, then sometimes drop
another (didn't seem to work), just drop 2 sedges 25% of the time,
and 1 sedge the rest of the time if the 2 didn't drop.
2021-11-27 13:36:08 -05:00
Aaron Suen
6741c7cc50 Notify nodes upon stack change 2021-11-27 11:49:10 -05:00
Aaron Suen
3233b7e32e Rework stack settling API 2021-11-27 11:27:56 -05:00
Aaron Suen
69889ee292 Start reforming stacks falling in/thru boxes
- Retire items_fall_thru group
- Add on_settle_item callback
- Open-topped storeboxes automatically capture
  items settling on top of them
- Start converting form into storebox
2021-11-27 09:59:27 -05:00
Aaron Suen
7da2ed13df Fix crosshairs/looktips in the void
It seems like Minetest actually generates terrain
beyond the map limit boundaries and raycast
and get_node can retrieve them server-side, even
though they aren't rendered client-side and air is
still filled with ignores.  This causes players to see
"stone" with looktips looking thru the bottom of
the world.  Fix it with an explicit check for world
bounds.
2021-11-27 09:24:28 -05:00
Aaron Suen
01b3867c81 Stackapply recipes work on storeboxes too 2021-11-27 08:57:03 -05:00
Aaron Suen
c138dec78b Make stackapply recipes synchronous
This allows them to be used with the same item as
is already in the stack rather than having those items
combine into the stack FIRST and the recipe run later
with an empty weilditem.
2021-11-27 08:52:25 -05:00
Aaron Suen
a5985dd43e Don't push player out of item stack nodes 2021-11-27 08:41:29 -05:00