Disallow vanilla on_timer, Player API notes

This commit is contained in:
Aaron Suen 2020-06-21 09:58:01 -04:00
parent 7e5f70da9b
commit b70ea7d2c8
2 changed files with 19 additions and 20 deletions

View File

@ -9,6 +9,18 @@ ISSUES-CODE: Issues related to code quality and APIs
# # # # # # # # # # # #
#### # #### # ###### ###### # # ####
- Unify Player API
- Because nc_player_setup is currently expensive.
- Combine existing globalsteps, wrap with metadata to do one
set of set_properties, physics, anim, etc calls at the end.
- All perplayer globalsteps maybe?
- Skybox, sunlight
- Physics, zoom, run speed
- Visuals, anims
- Move step hook into API layer
- Use prio system like recipes/mapgen_shared for moddability
- Reorg nc_player_* mods, simplify?
- Continue to chisel away at ABM perf issues.
- Simplify or optimize existing ABMs
- Convert things to DNTs.
@ -114,11 +126,6 @@ ISSUES-CODE: Issues related to code quality and APIs
- API for recursing through embedded inventories, e.g. in totes.
- Lux reaction cannot sense other lux inside totes.
- Player APIs:
- Things we override like physics.
- Skybox, sunlight.
- Could be used by skyrealm for separate skybox.
- Scripts to validate dependency graph.
- Tag deps directly in code at place of use.
- Auto-generate mod.conf / depends.txt

View File

@ -98,22 +98,14 @@ function nodecore.dnt_set(pos, name, time)
return save()
end
-- function nodecore.dnt_reset(pos, name, time)
-- local data, save = dntload(pos)
-- local prev = data[name]
-- if prev and prev == time then return end
-- data[name] = time
-- return save()
-- end
-- function nodecore.dnt_clear(pos, name)
-- local data, save = dntload(pos)
-- if not data[name] then return end
-- data[name] = nil
-- return save()
-- end
minetest.nodedef_default.on_timer = function(pos)
local _, save = dntload(pos)
return save()
end
nodecore.register_on_register_item(function(def)
if def.on_timer then
return error("on_timer hook is disallowed in "
.. nodecore.product .. "; use DNT instead")
end
end)