aboutsummaryrefslogtreecommitdiff
path: root/src/scriptapi.cpp
Commit message (Expand)AuthorAge
...
* Rename InvStack to ItemStackPerttu Ahola2012-01-02
* Add InvRef and InvStack (currently untested and unusable)Perttu Ahola2012-01-02
* Add EnvRef:get_objects_inside_radius(pos, radius)Perttu Ahola2011-12-28
* Add get_look_dir(), get_look_pitch() and get_look_yaw() for playersPerttu Ahola2011-12-28
* Fix minetest.env:get_player_by_name(nil) causing segfault and similar thingsPerttu Ahola2011-12-28
* Add minetest.get_modpath(modname)Perttu Ahola2011-12-11
* Enforce modname naming conventionPerttu Ahola2011-12-04
* Rename EnvRef:add_luaentity to EnvRef:add_entityPerttu Ahola2011-12-04
* Add EnvRef:get_node_light(pos, timeofday)Perttu Ahola2011-12-04
* Determine light_propagates from paramtypePerttu Ahola2011-12-04
* Craftitem aliasesPerttu Ahola2011-12-04
* Tool aliasesPerttu Ahola2011-12-04
* Node definition aliasesPerttu Ahola2011-12-03
* Rename cookresult_item to cookresult_itemstringPerttu Ahola2011-12-03
* add EnvRef:get_node_or_nil()Perttu Ahola2011-12-03
* Add ABM required neighbor checkPerttu Ahola2011-12-03
* Change naming convention to be modname:* instead of modname_* (sorry modders!)Perttu Ahola2011-12-03
* Enforced mod global naming convention and better error reportingPerttu Ahola2011-12-03
* Fix script error reporting a bitPerttu Ahola2011-12-02
* Script-defined creative inventoryPerttu Ahola2011-12-02
* Add time_from_last_punch to Lua APIPerttu Ahola2011-12-02
* Fix the previous commitPerttu Ahola2011-12-02
* Enforce PLAYER_INVENTORY_SIZE in ObjectRef::l_inventory_set_listPerttu Ahola2011-12-02
* Players are more like objects + related stuffPerttu Ahola2011-12-01
* Player-is-SAO WIPPerttu Ahola2011-12-01
* ObjectRef:get_player_name, ObjectRef:inventory_set_list, ObjectRef:inventory_...Perttu Ahola2011-11-30
* Add ObjectRef:punch and ObjectRef:right_click to Lua APIPerttu Ahola2011-11-30
* Add get_wielded_itemstring, get_wielded_item, damage_wielded_item and make ge...Perttu Ahola2011-11-30
* Create the necessary API for /giveme and /give and implement those commands; ...Perttu Ahola2011-11-29
* CraftItem rework and Lua interfaceKahrl2011-11-29
* Add NULL terminations to EnumString definitionsPerttu Ahola2011-11-29
* GenericNodeMetadata and an example furnacePerttu Ahola2011-11-29
* Initial NodeMetaRef stuffPerttu Ahola2011-11-29
* Lua interface for ActiveBlockModifierPerttu Ahola2011-11-29
* Remove creation of builtin.lua defined minetest.registered_* tables in CPerttu Ahola2011-11-29
* For consistency, implement calling of on_chat_message callbacks in CPerttu Ahola2011-11-29
* Implement callback registration in Lua instead of CPerttu Ahola2011-11-29
* Add chat message callback and send functionsPerttu Ahola2011-11-29
* Improve luaentity sprite functionality (and add some random stuff)Perttu Ahola2011-11-29
* Add on_generated hookPerttu Ahola2011-11-29
* Reshape LuaEntityCAO implementation a bit and make TNT to blinkPerttu Ahola2011-11-29
* Exception handling in Lua setting getPerttu Ahola2011-11-29
* Lua setting getterPerttu Ahola2011-11-29
* remove get_nodedefPerttu Ahola2011-11-29
* on_newplayer and on_respawnplayer callbacksPerttu Ahola2011-11-29
* Make node definitions available to LuaPerttu Ahola2011-11-29
* Add node definitions in Lua and do not use content_mapnode_init anymore (exce...Kahrl2011-11-29
* Fix random node definition stuffPerttu Ahola2011-11-29
* Add object reference to Lua on_place/dig/punchnode parametersPerttu Ahola2011-11-29
* Duplicate last tile image automatically to all for lua node definitionsPerttu Ahola2011-11-29
reathbar = player:hud_add(hud_def) end elseif hud.id_breathbar ~= nil then player:hud_remove(hud.id_breathbar) hud.id_breathbar = nil end end local function cleanup_builtin_statbars(player) if not player:is_player() then return end local name = player:get_player_name() if name == "" then return end hud_ids[name] = nil end local function player_event_handler(player,eventname) assert(player:is_player()) local name = player:get_player_name() if name == "" then return end if eventname == "health_changed" then initialize_builtin_statbars(player) if hud_ids[name].id_healthbar ~= nil then player:hud_change(hud_ids[name].id_healthbar, "number", scaleToDefault(player, "hp")) return true end end if eventname == "breath_changed" then initialize_builtin_statbars(player) if hud_ids[name].id_breathbar ~= nil then player:hud_change(hud_ids[name].id_breathbar, "number", 2 * scaleToDefault(player, "breath")) return true end end if eventname == "hud_changed" then initialize_builtin_statbars(player) return true end return false end function core.hud_replace_builtin(name, definition) if definition == nil or type(definition) ~= "table" or definition.hud_elem_type ~= "statbar" then return false end if name == "health" then health_bar_definition = definition for name,ids in pairs(hud_ids) do local player = core.get_player_by_name(name) if player and hud_ids[name].id_healthbar then player:hud_remove(hud_ids[name].id_healthbar) initialize_builtin_statbars(player) end end return true end if name == "breath" then breath_bar_definition = definition for name,ids in pairs(hud_ids) do local player = core.get_player_by_name(name) if player and hud_ids[name].id_breathbar then player:hud_remove(hud_ids[name].id_breathbar) initialize_builtin_statbars(player) end end return true end return false end core.register_on_joinplayer(initialize_builtin_statbars) core.register_on_leaveplayer(cleanup_builtin_statbars) core.register_playerevent(player_event_handler)