Skip to content

Strip colon prefix when calling register_on_register_item function

I noticed the following issues recently:

  • My mod crashed with a custom error "Unknown node :nc_doors:panel_bricks_shellstone_bonded".
  • NodeCore Naturae registers another concrete type and brick block, but there's no panel for it somehow.
  • nc_doors does not correctly handle the case when the item's name was prefixed with a colon.

So from what I understand, when you register an item with a colon prefix, it ignores name restrictions, allowing the node to be registered under a different mod name than the one currently executing. However, the canonical name of the item does not include the colon.

Instead of fixing the issue in nc_doors only, I figured I'll address this at the root cause: minetest.register_item does not strip the colon before passing the name of the registered item to the functions registered with register_on_register_item. I believe the colon should be stripped, since the item is likely to come from another mod anyway, and may or may not include the colon prefix, and it just complicates things unnecessarily.

Merge request reports