aboutsummaryrefslogtreecommitdiff
path: root/src/mapgen/mapgen.h
Commit message (Expand)AuthorAge
* Make Mapgen::spreadLight use a queue (#8838)DS2019-08-23
* Re-order mapgens in mainmenu and 'all settings' mapgen selection (#8705)Paramat2019-07-25
* Document the deprecation of hardcoded cave liquids (#8692)Paramat2019-07-20
* Dungeongen: Remove most hardcoded dungeon nodes (#8594)Paramat2019-06-30
* Dungeons: Settable density noise, move number calculation to mapgens (#8473)Paramat2019-06-01
* Fix commentsLoic Blot2019-03-31
* Mapgen flags: Add 'biomes' global mapgen flag (#7355)Paramat2018-06-08
* Mapgen caves: Re-order generation to fix cavern bugParamat2018-04-29
* Biome API / dungeons: Add biome-defined dungeon nodesParamat2018-04-07
* Generate Notifier: Clear events once after all 'on generated' functionsparamat2018-03-03
* SAO limits: Allow SAOs to exist outside the set 'mapgen limit'paramat2018-02-26
* Node definition manager refactor (#7016)Dániel Juhász2018-02-10
* Mapgen folder: Update and improve copyright information of filesparamat2018-01-15
* Use std::vector instead of dynamic C-Array (#6744)adrido2017-12-10
* Move files to subdirectories (#6599)Vitaliy2017-11-08
span> hash = math.floor(hash / 65536) local y = (hash % 65536) - 32768 hash = math.floor(hash / 65536) local z = (hash % 65536) - 32768 return vector.new(x, y, z) end function core.get_item_group(name, group) if not core.registered_items[name] or not core.registered_items[name].groups[group] then return 0 end return core.registered_items[name].groups[group] end function core.get_node_group(name, group) core.log("deprecated", "Deprecated usage of get_node_group, use get_item_group instead") return core.get_item_group(name, group) end function core.setting_get_pos(name) local value = core.settings:get(name) if not value then return nil end return core.string_to_pos(value) end -- See l_env.cpp for the other functions function core.get_artificial_light(param1) return math.floor(param1 / 16) end -- PNG encoder safety wrapper local o_encode_png = core.encode_png function core.encode_png(width, height, data, compression) if type(width) ~= "number" then error("Incorrect type for 'width', expected number, got " .. type(width)) end if type(height) ~= "number" then error("Incorrect type for 'height', expected number, got " .. type(height)) end local expected_byte_count = width * height * 4 if type(data) ~= "table" and type(data) ~= "string" then error("Incorrect type for 'data', expected table or string, got " .. type(data)) end local data_length = type(data) == "table" and #data * 4 or string.len(data) if data_length ~= expected_byte_count then error(string.format( "Incorrect length of 'data', width and height imply %d bytes but %d were provided", expected_byte_count, data_length )) end if type(data) == "table" then local dataBuf = {} for i = 1, #data do dataBuf[i] = core.colorspec_to_bytes(data[i]) end data = table.concat(dataBuf) end return o_encode_png(width, height, data, compression or 6) end