* Feature: Use the builtin profiler to automatically make zones for mod callback functions.
* Doc: Basic doc for builtin profiler, and better `/profiler` chatcommand help.
* Fix: `register_functions` (table of callback register function names), and `entity_instrumentation` is no longer outdated.
* Fix: Builtin profiler output is no longer printed to debug.txt or to file in world with translation escapes.
* Fix: Entity callback name generation used `obj_def.label` (normally non-existing field), now it uses the entity name.
* Small code improvements, like use of new `Settings.get_bool` with default.
* Provide tool and digger to get_node_drops
This gives games/mods the ability to modify node drops depending on item
and/or player metadata without overriding node_dig or other workarounds.
* Copy wielded item to prevent modification in get_node_drops
* Also pass node pos to get_node_drops
Allowing properties of the node and its surroundings to affect node drops.
* Copy pos to prevent modification in get_node_drops
Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
* Don't pass empty item stack to get_node_drops if wielded is nil
---------
Co-authored-by: sfan5 <sfan5@live.de>
Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
This lets modders avoid alpha blending rendering bugs as well as potential (future) performance issues.
The appropriate blend modes are also used for node dig particles.
---------
Co-authored-by: sfan5 <sfan5@live.de>
* Skip invalid objects in raycasts
* Add `ObjectRef:is_valid` method
* Add object inside radius / area iterators which skip invalid objects
* Update docs to clarify object invalidation and how to deal with it
---------
Co-authored-by: sfan5 <sfan5@live.de>
Since this is fixed overhead for every entity, this is important to optimize.
This optimizes one very common case.
before:
push_collision_move_result [us] _____________ 64512x 3.562
after:
push_collision_move_result [us] _____________ 72636x 0.831