Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow other mods to register their node functionality for compatibility #1

Open
hkzorman opened this issue Jan 9, 2017 · 0 comments
Assignees
Milestone

Comments

@hkzorman
Copy link
Owner

hkzorman commented Jan 9, 2017

While Advanced NPC provides compatibility with Sokomine's cottages mod, other mods that provide nodes usable by NPCs (like doors, beds, chairs, differently-operated furnaces, etc.) and want to support this mod should be able to do so by registering how their nodes work.

For example, if a mod has doors that do not use the default doors API, then a mod can tell advanced_npc how to detect their own doors are open/closed, by using some kind of register function like the following:

npc.actions.register_door({
  name_prefix: "other_mod:door",
  is_door_open = function(pos) {
    local node_meta = minetest.get_meta(pos)
    return meta:get_string("door_state") == "open"
  }
}
@hkzorman hkzorman added this to the 1.0 milestone Jan 11, 2017
@hkzorman hkzorman self-assigned this Jan 11, 2017
@hkzorman hkzorman mentioned this issue Jun 17, 2017
17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant