Skip to content

Soft changes to item + entity + LBM + ABM registration, return of definition table on success#17009

Open
TubberPupper wants to merge 3 commits intoluanti-org:masterfrom
TubberPupper:registering_items
Open

Soft changes to item + entity + LBM + ABM registration, return of definition table on success#17009
TubberPupper wants to merge 3 commits intoluanti-org:masterfrom
TubberPupper:registering_items

Conversation

@TubberPupper
Copy link

@TubberPupper TubberPupper commented Mar 9, 2026

(I don't imagine I was supposed to just copy the template, but, I'm tired and lazy RN :wheeze:)

Goal of the PR

Add a more informative error for if an invalid itemdef is given for the wrapper variants of register_item

Have get_current_modname be called once instead of twice per registration, reuse for check_modname_prefix (might even make it quicker???)

Return the definition tables upon successful registration

How does the PR work?

Well, as described in the goal of the PR! :D

Does it resolve any reported issue?

To my knowledge, no. It was a pet peeve of mine to see itemdef.type = in the wrapper with no check for if it's a table. I was about to do similar for all other registration as well but thought "hmmm, maybe there's a reason, like performance?"

Does this relate to a goal in the roadmap?

From what I quickly read, no, it does not relate to any engine goals

If not a bug fix, why is this PR needed? What usecases does it solve?

Make a more informative error, use get_current_modname less if unnecessary, QoL with returning definition table on success

If you have used an LLM/AI to help with code or assets, you must disclose this.

None at all :3c

To do

This PR is Ready for Review.

How to test

Just register any item, entity, LBM, or ABM :D - should expect a return from them as well

Should this returning of the definition on success be documented?

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