[no squash] Improve building into spot dug same cycle - #133
Merged
Conversation
SmallJoker
reviewed
Aug 22, 2026
This fixes failure to build nodes with on_place callbacks checking for air or buildable_to (e.g. default:torch) into blocks that were dug in the same cycle. Co-authored-by: SmallJoker <mk939@ymail.com>
j-r
force-pushed
the
build_into_dug_same_cycle
branch
from
August 28, 2026 12:56
0ee4c5e to
9af5c55
Compare
Contributor
Author
|
Hopefully improved the comment. It is still a bit longer than your suggestion, because a reminder that the dug node isn't removed yet would have helped me back then. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NOTE: this PR also includes two mostly unrelated changes, because they touch the same code, but I'll remove the second change if requested
Digging and building in the same cycle doesn't remove the dug node, but directly tries to place the new node. Unfortunately when the new node requires its custom
on_placeto be called this will often not work, because thaton_placewill typically check for the target position to beairorbuildable_towhich for a node dug in the same cycle mostly won't be the case.There doesn't seem to be an issue for that, but it is easily reproduced using
default:torch:core.item_place_nodeis logged)This PR fixes this by explicitly removing the dug node before invoking
on_placeof the new node.Now that the code knows whether it builds into a spot dug the same cycle, this PR also introduces a small, but neat feature: allow extrusion to be zero, meaning to only build, if the target position was dug the same cycle. This e.g. allows to use soft material digger to detect an unstable roof and have the builder seal it using stone, but not build a roof if there is air above (e.g. in a large cave). This change is really small, so I included it here, but I can submit it separately (if the fix is merged).