Skip to content

protection check + remove only entities spawned by this mod - #4

Open
a-tour-ist wants to merge 1 commit into
hkzorman:masterfrom
a-tour-ist:fix_protection
Open

protection check + remove only entities spawned by this mod#4
a-tour-ist wants to merge 1 commit into
hkzorman:masterfrom
a-tour-ist:fix_protection

Conversation

@a-tour-ist

Copy link
Copy Markdown

What the title says.

Why/how does the protection check work:

on_dig defaults to core.node_dig.

core.node_dig does a búnch of very important stuff:

  • protection check
  • logging
  • add wear to tools
  • run further callbacks from the node def
  • run the callbacks from core.registered_on_dignodes (p.ex rewarding xp, ...)

if you provide a custom on_dig function, you have to make sure your node implements these features correctly too.

But there is no need to provide a custom on_dig here, after_dig_node can do the job as well. (In fact it is called by core.node_dig once that function has made sure that the node can be removed)

providing a custom on_dig will disable the protection check from builtin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant