aboutsummaryrefslogtreecommitdiff
path: root/src/map.h
Commit message (Expand)AuthorAge
* Fixed objects being sometimes not able to be stored statically in a block whe...Perttu Ahola2011-07-01
* map unloading is now a whole lot betterPerttu Ahola2011-06-27
* fixed block unloading from memory (a better fix coming next)Perttu Ahola2011-06-26
* even more code refactoringPerttu Ahola2011-06-26
* more reorganizing of map codePerttu Ahola2011-06-26
* cleaned map stuffPerttu Ahola2011-06-26
* moved mapgen stuff around abitPerttu Ahola2011-06-25
* New map generator added (and SQLite, messed up the commits at that time...) (...Perttu Ahola2011-06-25
* farmesh is now usable.Perttu Ahola2011-06-18
* ...and the map part of thatPerttu Ahola2011-06-05
* Reduced server CPU usage on NodeMetadata step()s. Also furnace now cooks whil...Perttu Ahola2011-05-31
* New map directory structure that avoids map size being limited by filesystemCiaran Gultnieks2011-05-18
* random comment updatesPerttu Ahola2011-04-30
* Optimized map saving and sending (server-side)Perttu Ahola2011-04-26
* Some work-in-progress in hp and mobs and a frightening amount of random fixes.Perttu Ahola2011-04-21
* fixed warnings reported by cppcheckPerttu Ahola2011-04-11
* better support for old mapsPerttu Ahola2011-04-10
* Map generation is now properly threaded and doesn't block block placement and...Perttu Ahola2011-04-10
* a commit before starting to reorganize the map loading/generation logicPerttu Ahola2011-04-10
* initial workings of the furnacePerttu Ahola2011-04-05
* Node metadata frameworkPerttu Ahola2011-04-04
* commit before some more radical changesPerttu Ahola2011-04-03
* Revert mapgen to best working version (2)Perttu Ahola2011-04-03
* Mapgen is better now. Not a lot, but a bit!Perttu Ahola2011-04-02
* commit before some radical changesPerttu Ahola2011-04-02
* mapgen work-in-progressPerttu Ahola2011-03-02
* tweaked mapgenPerttu Ahola2011-02-28
* A third try on terrain generation. No trees yet.Perttu Ahola2011-02-28
* mainly work on object scripting apiPerttu Ahola2011-02-23
* preliminary lua scripting framework for objectsPerttu Ahola2011-02-21
* Temporary commit; lots of test code and stuffPerttu Ahola2011-02-21
* some fixes to make compiling on some bsd easierPerttu Ahola2011-02-11
* now it works nicelyPerttu Ahola2011-02-11
* fully working i guessPerttu Ahola2011-02-11
* work-in-progress texture atlas optimizationPerttu Ahola2011-02-10
* mapgen stuffPerttu Ahola2011-02-05
* added sand to map generatorPerttu Ahola2011-02-04
* This map generator is starting to look pretty good now... also, disabled load...Perttu Ahola2011-02-01
* partly working chunk-based map generator (doesn't save properly, spawn is pre...Perttu Ahola2011-02-01
* map generation framework under development... not quite operational at this p...Perttu Ahola2011-01-30
* Reworked texture, material, mineral and whatever handlingPerttu Ahola2011-01-26
* Faster lighting at map generation timePerttu Ahola2011-01-24
* minecraft-style water done (but no texture animation or sound)Perttu Ahola2011-01-17
* old water removed, some fixes here and therePerttu Ahola2011-01-17
* fine-tuning of map generator and server and stuff.Perttu Ahola2011-01-17
* Initial commit of mapgen v.2. Lacks configuration and saving to disk.Perttu Ahola2011-01-16
* removing unused code and commentsPerttu Ahola2011-01-07
* drawing range updater update and myrand() (but not usage of it)Perttu Ahola2010-12-26
* new viewing range updater algorithmPerttu Ahola2010-12-26
* better cavesPerttu Ahola2010-12-25
ass="hl opt">(hud.id_healthbar, "number", number) end elseif hud.id_healthbar then player:hud_remove(hud.id_healthbar) hud.id_healthbar = nil end local show_breathbar = flags.breathbar and enable_damage and not immortal local breath = player:get_breath() local breath_max = player:get_properties().breath_max if show_breathbar and breath <= breath_max then local number = 2 * scaleToDefault(player, "breath") if not hud.id_breathbar and breath < breath_max then local hud_def = table.copy(breath_bar_definition) hud_def.number = number hud.id_breathbar = player:hud_add(hud_def) elseif hud.id_breathbar then player:hud_change(hud.id_breathbar, "number", number) end end if hud.id_breathbar and (not show_breathbar or breath == breath_max) then minetest.after(1, function(player_name, breath_bar) local player = minetest.get_player_by_name(player_name) if player then player:hud_remove(breath_bar) end end, name, hud.id_breathbar) hud.id_breathbar = nil end end local function cleanup_builtin_statbars(player) 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 == "" or not hud_ids[name] then return end if eventname == "health_changed" then update_builtin_statbars(player) if hud_ids[name].id_healthbar then return true end end if eventname == "breath_changed" then update_builtin_statbars(player) if hud_ids[name].id_breathbar then return true end end if eventname == "hud_changed" or eventname == "properties_changed" then update_builtin_statbars(player) return true end return false end function core.hud_replace_builtin(hud_name, definition) if type(definition) ~= "table" or definition.hud_elem_type ~= "statbar" then return false end if hud_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 ids.id_healthbar then player:hud_remove(ids.id_healthbar) ids.id_healthbar = nil update_builtin_statbars(player) end end return true end if hud_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 ids.id_breathbar then player:hud_remove(ids.id_breathbar) ids.id_breathbar = nil update_builtin_statbars(player) end end return true end return false end -- Append "update_builtin_statbars" as late as possible -- This ensures that the HUD is hidden when the flags are updated in this callback core.register_on_mods_loaded(function() core.register_on_joinplayer(update_builtin_statbars) end) core.register_on_leaveplayer(cleanup_builtin_statbars) core.register_playerevent(player_event_handler)