Thanks to Kimapr for the basic approach, and proving
the concept.
Doors pressing a single-item stack now place that
item as a node, and trigger placement recipes. Doors
pressing nodes that don't have a single item stack
node form (sticks, leaves) also trigger placement
craft recipes.
All craft pressing recipes require some form of
backstop to provide pressure.
Hints themselves have not been tided up
much, but this makes the project of fixing the
hints for each mod a little more manageable
and breaks up the hard-to-navigate single
monolithic hints file in the old guide mod.
The old guide mod has now been completely
retired. Hints are now a full-fledged API-layer
standard feature.
- Move hint handling down to API layer
- Simplify stat data; old nc_stats counting can
be moved out to a separate mod. We only
need whether the player has seen or not.
- Invert inventory tab responsibility.
- Merge witness system in from crafting.
TODO:
- Redistribute hint registration responsibility
to individual mods.
- Test external mod compat.
- Retire old nc_stats and nc_guide systems.
- Add a way to reset hints.
For some reason pos_to_string gives us correct
behavior, but hash_node_position does not, even
though we check to make sure that nodes are
properly rounded so non-integer issues should not
apply here.
By restricting the recipes we check based
on the name of the central object being
checked, we can do many fewer craft
checks per item and avoid expensive
checks.
Register a "rootmatch" property for all
recipes that represents a broader, quicker
test for recipe eligibility. False positives are
allowed but false negatives are not.
Since most recipes are eligible, we can
use this to build an index for fast lookups
of subsets of recipes to run and skip most
of the other ones.
- New Delayed Node Trigger API that allows
the use of multiple externally-defined node
timer events, as long as on_timer of a node
is not explicitly overridden.
- Use the new DNT system to make door
ablation reliable.
Before, ABM firing was delayed by up to a full
interval, but the fulfillment timer could wander
around relative to the trigger, which could lead
to unreliable door ablation.
Instead, just always run the ABM fulfilment
triggers on the next tick, so limted_abm is
ONLY doing the limiting for events that arrive
within the same tick, as most ABMs do.
When 3rd-party mods try to register extensions, don't
crash on trying to register in wrong namespace.
Keep registrations to original mod namespace for now,
as I'm not certain whether I actually made assumptions
about mod name in some logic.
- Register groups for chiseling doors.
- Make recipe digging not use player inventory, but drop
as an item unconditionally. N.B. the old "replace with air
then drop item" method only worked with explicit item
names and not group detection.
Instead of instantly digging the rod, which makes it look like
it disappeared, try just "loosening" it into an item so it can be
scooped up without the pick.
It was always also possible to place the rod as an item and
pound that in, making it easier to pick up, but this may not
have been obvious to most players.
Treat all API mods as a "layer", and use the new
nc_api_all registration to indicate that a mod depends
on the NC API (which ALL NC mods assume they do).
This means that each non-API mod does not need to
worry about which API mods it really needs and which
it does not, nor will they need to be updated for any
internal API restructures.
This is a game, not a modpack, so all mods will be
loaded anyway, and we only care about order. That
means that we don't really need to worry about
having excess dependencies because any mod we
don't actually need will be needed by something that's
loaded anyway. If somebody wants to reuse a
component elsewhere, they're likely to need to do
some work to untangle it anyway, because of the
amount that NodeCore mechanics interact and
interdepend.
This created a ton of dependency inversions, which
necessitated moving a number of API functions up into
higher layers, and restructuring dependency lists for
a number of mods.
BOLO: non-deterministic load errors due to missed
dependencies.
The press will now search a small distance through falling
nodes to find a solid node, as long as there are no air gaps
in the pack of falling nodes.
This makes aggregate automation possible.
- Packing recipes blocked by stack node visinv ents.
- Item duplication between sliding/falling nodes.
A little sloppy still, but at least it seems to fix the issues.
This should help mitigate issues that can cause falling_nodes to
clobber doors. It may make some builds that were working
unreliably before now not work at all, but after a redesign, they
may work more safely now.
- No graphite lubrication needed.
- Just insert pin instead of pounding it in.
- Pins must be inserted into end face.
- Node will not spin from using pin on wrong face.
There are other situations where we right-click on things and
expect a non-placement action, and that action fails. We should
probably be more consistent about not placing in these cases, as
players may be surprised by it, and be left in trouble due to
not having a tool to dig it back up. Requiring sneak is safer.
Now technically shelves violate this principle, but their
violation is much narrower in scope, i.e. only placement of
containers.
This reverts commit 4795a63116782fe47e72847dd308468a345b9369.