From c0180de823528a654cf8da15b6c860e738137e69 Mon Sep 17 00:00:00 2001 From: Treer Date: Fri, 15 Jan 2021 00:05:32 +1100 Subject: [PATCH] Update README.md --- README.md | 25 +++++++++++++++++++++---- mapgen.lua | 8 ++++---- mapgen_mantle.lua | 8 ++++---- portal_api.txt | 3 +++ 4 files changed, 32 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index dca4ca7..0b856af 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,27 @@ -Nether Mod for Minetest, with Portals API. +# Nether Mod for Minetest, with Portals API. + +Enables Nether portals to be built, opening a gateway between the surface +realm and one of lava and netherrack, with rumors of a passageway to a great +magma ocean. + +To view the options provided by this mod, see settingtypes.txt or +go to "Settings"->"All Settings"->"Mods"->"nether" in the game. + +A Nether portal is built as a rectangular vertical frame of obsidian, 4 blocks +wide and 5 blocks high. Once constructed, a Mese crystal fragment can be +right-click/used on the frame to activate it. + + +## Modders and game designers See portal_api.txt for how to create custom portals to your own realms. -See settingtypes.txt or go to "Settings"->"All Settings"->"Mods"->"nether" -in the game to view the options provided by this mod. - +This mod provides Nether basalts (natural, hewn, and chiseled) as nodes which +require a player to journey to the magma ocean to obtain, so these can be used +for gating progression through a game. For example, a portal to another realm +might need to be constructed from basalt, thus requiring a journey through +the nether first, or basalt might be a crafting ingredient required to reach +a particular branch of the tech-tree. ## License of source code: diff --git a/mapgen.lua b/mapgen.lua index 4b712be..c82a7db 100644 --- a/mapgen.lua +++ b/mapgen.lua @@ -161,7 +161,7 @@ minetest.register_node("nether:native_mapgen", {}) minetest.register_biome({ name = "nether_caverns", node_stone = "nether:native_mapgen", -- nether:native_mapgen is used here to prevent the native mapgen from placing ores and decorations. - node_filler = "nether:native_mapgen", -- The lua on_generate will transform nether:rack_native into nether:rack then decorate and add ores. + node_filler = "nether:native_mapgen", -- The lua on_generate will transform nether:native_mapgen into nether:rack then decorate and add ores. node_dungeon = "nether:brick", node_dungeon_alt = "nether:brick_cracked", node_dungeon_stair = "stairs:stair_nether_brick", @@ -525,7 +525,7 @@ local function on_generated(minp, maxp, seed) for y = y0, y1 do -- Y loop first to minimise tcave & lava-sea calculations - local sea_level, cavern_limit_distance = mapgen.find_nearest_lava_sealevel(y) + local sea_level, cavern_limit_distance = mapgen.find_nearest_lava_sealevel(y) -- function provided by mapgen_mantle.lua local above_lavasea = y > sea_level local below_lavasea = y < sea_level @@ -534,7 +534,7 @@ local function on_generated(minp, maxp, seed) local tmantle = CENTER_REGION_LIMIT + centerRegionLimit_adj -- cavern_noise_adj already contains central_region_limit_adj, so tmantle is only for comparisons when cavern_noise_adj hasn't been added to the noise value local cavern_noise_adj = CENTER_REGION_LIMIT * (cavern_limit_distance * cavern_limit_distance * cavern_limit_distance) - - centerRegionLimit_adj -- cavern_noise_adj gets added to noise value instead of added to the limit np_noise is compared against, so subtract centerRegionLimit_adj so subtract centerRegionLimit_adj instead of adding + centerRegionLimit_adj -- cavern_noise_adj gets added to noise value instead of added to the limit np_noise is compared against, so subtract centerRegionLimit_adj instead of adding for z = z0, z1 do local vi = area:index(x0, y, z) -- Initial voxelmanip index @@ -548,7 +548,7 @@ local function on_generated(minp, maxp, seed) if cave_noise > tcave then -- Prime region -- This was the only region in initial versions of the Nether mod. - -- It is the only region that portals from the surface will open into. + -- It is the only region which portals from the surface will open into. data[vi] = c_air contains_nether = true diff --git a/mapgen_mantle.lua b/mapgen_mantle.lua index 0add888..e453e19 100644 --- a/mapgen_mantle.lua +++ b/mapgen_mantle.lua @@ -286,7 +286,7 @@ function excavate_pathway(data, area, nether_pos, center_pos, minp, maxp) radiusLimit = math_min(radiusLimit, vector_min(vector.subtract(maxp, stopPos))) if radiusLimit < 4 then -- This is a logic check, ignore it. It could be commented out - -- 4 is (79 - 75), and shouldn't be possible if sampling-skip was 10 + -- 4 is (79 - 75), and values less than 4 shouldn't be possible if sampling-skip was 10 -- i.e. if sampling-skip was 10 then {5, 15, 25, 35, 45, 55, 65, 75} should be sampled from possible positions 0 to 79 debugf("Error: radiusLimit %s is smaller then half the sampling distance. min %s, max %s, start %s, stop %s", radiusLimit, minp, maxp, startPos, stopPos) end @@ -304,7 +304,7 @@ function excavate_pathway(data, area, nether_pos, center_pos, minp, maxp) local sizeAdj = 1 - (distFromMiddle * distFromMiddle * distFromMiddle) local radius = math_min(radiusLimit, math.random(50 - (25 * sizeAdj), 80 - (45 * sizeAdj)) / 10) - local radiusCubed = radius * radius + local radiusSquared = radius * radius local radiusCeil = math_floor(radius + 0.5) linedata[i].radius = radius -- Needed in third pass @@ -315,7 +315,7 @@ function excavate_pathway(data, area, nether_pos, center_pos, minp, maxp) local vi_z = vi + z * zstride for y = -radiusCeil, radiusCeil do local vi_zy = vi_z + y * ystride - local xSquaredLimit = radiusCubed - (z * z + y * y) + local xSquaredLimit = radiusSquared - (z * z + y * y) for x = -radiusCeil, radiusCeil do if x * x < xSquaredLimit then data[vi_zy + x] = c_air @@ -327,7 +327,7 @@ function excavate_pathway(data, area, nether_pos, center_pos, minp, maxp) end -- Third pass: decorate - -- Add glowstones to make tunnels to the mantle easyier to find + -- Add glowstones to make tunnels to the mantle easier to find -- https://i.imgur.com/sRA28x7.jpg for i = start_index, stop_index, 3 do if linedata[i].distFromEnds < 0.3 then diff --git a/portal_api.txt b/portal_api.txt index 74bfbb2..ecac500 100644 --- a/portal_api.txt +++ b/portal_api.txt @@ -22,6 +22,9 @@ one kind of portal with the same frame material — such as obsidian — provide the size of the PortalShape is distinct from any other type of portal that is using the same node for its frame, and portal sizes remain small. +The Nether provides three variants of Nether basalt to ensure there are +alternatives to obsidian for other mods to use as portalstones. + Realms ------