This commit is contained in:
MisterE123 2023-01-07 12:23:00 -05:00
parent 0aade85168
commit db274ec3f0
2 changed files with 11 additions and 7 deletions

View File

@ -13,9 +13,9 @@ local c_stone = minetest.get_content_id("default:stone")
local c_water = minetest.get_content_id("default:water_source")
local water_level = 0
local old_logic = luamap.logic
function luamap.logic(noise_vals,x,y,z,seed)
function luamap.logic(noise_vals,x,y,z,seed,original_content)
-- get any terrain defined in another mod
local content = old_logic(noise_vals,x,y,z,seed)
local content = old_logic(noise_vals,x,y,z,seed,original_content)
-- use our own logic to add to that logic
-- make any nodes below sea level water and below stone level stone
if y < water_level then
@ -54,9 +54,9 @@ local c_stone = minetest.get_content_id("default:stone")
local c_water = minetest.get_content_id("default:water_source")
local water_level = 0
local old_logic = luamap.logic
function luamap.logic(noise_vals,x,y,z,seed)
function luamap.logic(noise_vals,x,y,z,seed,original_content)
-- get any terrain defined in another mod
local content = old_logic(noise_vals,x,y,z,seed)
local content = old_logic(noise_vals,x,y,z,seed,original_content)
if y < water_level then
content = c_water
@ -92,7 +92,7 @@ luamap.register_noise("terrainmap",{
### luamap.logic
```lua
luamap.logic(noise_vals,x,y,z,seed)
luamap.logic(noise_vals,x,y,z,seed,original_content)
```
DESCRIPTION: Override this function to define mapgen logic. Best practice is to
@ -121,6 +121,10 @@ The coordinates of the position to set the content for
The seed passed to minetest.register_on_generated()
`original_content`
The original content of the mapgen
RETURNS:
should return a content id such as that gotten from

View File

@ -26,10 +26,10 @@ local water_level = 0
local old_logic = luamap.logic
function luamap.logic(noise_vals,x,y,z,seed)
function luamap.logic(noise_vals,x,y,z,seed,original_content)
-- get any terrain defined in another mod
local content = old_logic(noise_vals,x,y,z,seed)
local content = old_logic(noise_vals,x,y,z,seed,original_content)
if y < water_level then
content = c_water