Remove realm limits, fix lighting outside limits. Spawnplayer function: create noise objects only once, move to init.lua. New LGPL, CC BY-SA licenses. Improve code style. Add info to readme

master
paramat 2015-08-26 00:16:47 +01:00
parent 6623438509
commit 68409fa5cf
5 changed files with 273 additions and 295 deletions

View File

@ -1,6 +1,9 @@
riverdev 0.7.2 by paramat
For latest stable Minetest back to 0.4.8
Depends default
Licenses: code WTFPL
riverdev 0.7.3 by paramat
For Minetest 0.4.12 and later
Depends default stairs bucket
Licenses: Code LGPL 2.1, textures CC BY-SA
Update spawnplayer function, 2D perlinmap z-size = 1.
This mod is my 'watershed' mapgen (https://forum.minetest.net/viewtopic.php?f=11&t=8609) with fewer biomes, 2 path/bridge networks, tunnels/fissures/caves, boulders, improved magma channels and mini-volcanos.
The mod will automatically select 'singlenode' mapgen and will spawn players at the surface but also scattered up to 1280n from world centre
To make your first torches search for coal in tunnel entrances, near sea level or rivers these entrances are sometimes sealed by stone (result of protecting against underground flooding).
Ores are a few nodes underground to prevent easy surface mining in the rocky mountains.

View File

@ -290,10 +290,10 @@ minetest.register_abm({
local y = pos.y
local z = pos.z
local vm = minetest.get_voxel_manip()
local pos1 = {x=x-2, y=y-2, z=z-2}
local pos2 = {x=x+2, y=y+5, z=z+2}
local pos1 = {x = x - 2, y = y - 2, z = z - 2}
local pos2 = {x = x + 2, y = y + 5, z = z + 2}
local emin, emax = vm:read_from_map(pos1, pos2)
local area = VoxelArea:new({MinEdge=emin, MaxEdge=emax})
local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax})
local data = vm:get_data()
riverdev_appletree(x, y, z, area, data)
@ -315,10 +315,10 @@ minetest.register_abm({
local y = pos.y
local z = pos.z
local vm = minetest.get_voxel_manip()
local pos1 = {x=x-2, y=y-4, z=z-2}
local pos2 = {x=x+2, y=y+17, z=z+2}
local pos1 = {x = x - 2, y = y - 4, z = z - 2}
local pos2 = {x = x + 2, y = y + 17, z = z + 2}
local emin, emax = vm:read_from_map(pos1, pos2)
local area = VoxelArea:new({MinEdge=emin, MaxEdge=emax})
local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax})
local data = vm:get_data()
riverdev_pinetree(x, y, z, area, data)
@ -340,10 +340,10 @@ minetest.register_abm({
local y = pos.y
local z = pos.z
local vm = minetest.get_voxel_manip()
local pos1 = {x=x-2, y=y-5, z=z-2}
local pos2 = {x=x+2, y=y+23, z=z+2}
local pos1 = {x = x - 2, y = y - 5, z = z - 2}
local pos2 = {x = x + 2, y = y + 23, z = z + 2}
local emin, emax = vm:read_from_map(pos1, pos2)
local area = VoxelArea:new({MinEdge=emin, MaxEdge=emax})
local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax})
local data = vm:get_data()
-- check temp/humid
riverdev_jungletree(x, y, z, area, data)
@ -365,10 +365,10 @@ minetest.register_abm({
local y = pos.y
local z = pos.z
local vm = minetest.get_voxel_manip()
local pos1 = {x=x-4, y=y-3, z=z-4}
local pos2 = {x=x+4, y=y+7, z=z+4}
local pos1 = {x = x - 4, y = y - 3, z = z - 4}
local pos2 = {x = x + 4, y = y + 7, z = z + 4}
local emin, emax = vm:read_from_map(pos1, pos2)
local area = VoxelArea:new({MinEdge=emin, MaxEdge=emax})
local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax})
local data = vm:get_data()
riverdev_acaciatree(x, y, z, area, data)
vm:set_data(data)
@ -376,148 +376,3 @@ minetest.register_abm({
vm:update_map()
end,
})
-- Set mapgen parameters
minetest.register_on_mapgen_init(function(mgparams)
minetest.set_mapgen_params({mgname="singlenode", flags="nolight"})
end)
-- Spawn player. Only works with chunksize = 5 mapblocks
function spawnplayer(player)
local PSCA = 16 -- Player scatter. Maximum distance in chunks (80 nodes) of player spawn from (0, 0, 0)
local YWATER = 1
local YTER = -64 -- Deepest seabed y
local TERSCA = 512 -- Terrain vertical scale in nodes
local BASAMP = 0.3 -- Base amplitude relative to 3D noise amplitude. Ridge network structure
local MIDAMP = 0.05 -- Mid amplitude relative to 3D noise amplitude. River valley structure
local np_terrain = {
offset = 0,
scale = 1,
spread = {x=384, y=192, z=384},
seed = 5900033,
octaves = 5,
persist = 0.67
}
local np_mid = {
offset = 0,
scale = 1,
spread = {x=1536, y=1536, z=1536},
seed = 85546,
octaves = 6,
persist = 0.4
}
local np_base = {
offset = 0,
scale = 1,
spread = {x=3072, y=3072, z=3072},
seed = -990054,
octaves = 3,
persist = 0.4
}
local np_patha = {
offset = 0,
scale = 1,
spread = {x=768, y=768, z=768},
seed = 7000023,
octaves = 4,
persist = 0.4
}
local np_pathb = {
offset = 0,
scale = 1,
spread = {x=768, y=768, z=768},
seed = 23,
octaves = 4,
persist = 0.4
}
local xsp
local ysp
local zsp
for chunk = 1, 128 do
print ("[riverdev] searching for spawn "..chunk)
local x0 = 80 * math.random(-PSCA, PSCA) - 32
local z0 = 80 * math.random(-PSCA, PSCA) - 32
local y0 = 80 * math.floor((YWATER + 32) / 80) - 32
local x1 = x0 + 79
local z1 = z0 + 79
local y1 = y0 + 79
local sidelen = 80
local chulensxyz = {x=sidelen, y=sidelen, z=sidelen}
local minposxyz = {x=x0, y=y0, z=z0}
local chulensxz = {x=sidelen, y=sidelen, z=1}
local minposxz = {x=x0, y=z0}
local nvals_terrain = minetest.get_perlin_map(np_terrain, chulensxyz):get3dMap_flat(minposxyz)
local nvals_mid = minetest.get_perlin_map(np_mid, chulensxz):get2dMap_flat(minposxz)
local nvals_base = minetest.get_perlin_map(np_base, chulensxz):get2dMap_flat(minposxz)
local nvals_patha = minetest.get_perlin_map(np_patha, chulensxz):get2dMap_flat(minposxz)
local nvals_pathb = minetest.get_perlin_map(np_pathb, chulensxz):get2dMap_flat(minposxz)
local nixyz = 1
local nixz = 1
for z = z0, z1 do
for y = y0, y1 do
for x = x0, x1 do
local n_patha = nvals_patha[nixz]
local n_abspatha = math.abs(n_patha)
local n_pathb = nvals_pathb[nixz]
local n_abspathb = math.abs(n_pathb)
local n_terrain = (nvals_terrain[nixyz] + 2) / 2
local n_absmid = (math.abs(nvals_mid[nixz])) ^ 0.8
local n_absbase = (math.abs(nvals_base[nixz])) ^ 0.8
local n_invbase = math.max(1 - n_absbase, 0)
local grad = (YTER - y) / TERSCA
local densitybase = n_invbase * BASAMP + grad
local densitymid = n_absmid * MIDAMP + densitybase
local density = n_terrain * n_invbase * n_absmid * n_abspatha ^ 1.5 * n_abspathb ^ 1.5
+ densitymid
if y >= YWATER and density > -0.01 and density < 0 then
ysp = y + 1
xsp = x
zsp = z
break
end
nixz = nixz + 1
nixyz = nixyz + 1
end
if ysp then
break
end
nixz = nixz - 80
end
if ysp then
break
end
nixz = nixz + 80
end
if ysp then
break
end
end
if ysp then
print ("[riverdev] spawn player ("..xsp.." "..ysp.." "..zsp..")")
player:setpos({x=xsp, y=ysp, z=zsp})
else
print ("[riverdev] no suitable spawn found")
player:setpos({x=0, y=2, z=0})
end
end
minetest.register_on_newplayer(function(player)
spawnplayer(player)
end)
minetest.register_on_respawnplayer(function(player)
spawnplayer(player)
return true
end)

220
init.lua
View File

@ -1,7 +1,8 @@
-- Parameters
local YMIN = -33000 -- Y limits of realm generation
local YMAX = 1024
local PSCA = 16 -- Player scatter. Maximum distance in chunks (80 nodes)
-- of player spawn from (0, 0, 0)
local YWATER = 1 -- Water surface y
local YSAND = 4 -- Top of beach y
local YTER = -64 -- Deepest seabed y
@ -44,7 +45,7 @@ local HIHUT = 0.6 -- High ^
local np_mid = {
offset = 0,
scale = 1,
spread = {x=1536, y=1536, z=1536},
spread = {x = 1536, y = 1536, z = 1536},
seed = 85546,
octaves = 6,
persist = 0.4
@ -55,7 +56,7 @@ local np_mid = {
local np_base = {
offset = 0,
scale = 1,
spread = {x=3072, y=3072, z=3072},
spread = {x = 3072, y = 3072, z = 3072},
seed = -990054,
octaves = 3,
persist = 0.4
@ -66,7 +67,7 @@ local np_base = {
local np_patha = {
offset = 0,
scale = 1,
spread = {x=768, y=768, z=768},
spread = {x = 768, y = 768, z = 768},
seed = 7000023,
octaves = 4,
persist = 0.4
@ -77,7 +78,7 @@ local np_patha = {
local np_pathb = {
offset = 0,
scale = 1,
spread = {x=768, y=768, z=768},
spread = {x = 768, y = 768, z = 768},
seed = 23,
octaves = 4,
persist = 0.4
@ -88,7 +89,7 @@ local np_pathb = {
local np_tree = {
offset = 0,
scale = 1,
spread = {x=384, y=384, z=384},
spread = {x = 384, y = 384, z = 384},
seed = 133338,
octaves = 4,
persist = 0.7
@ -99,7 +100,7 @@ local np_tree = {
local np_grass = {
offset = 0,
scale = 1,
spread = {x=96, y=96, z=96},
spread = {x = 96, y = 96, z = 96},
seed = -138,
octaves = 4,
persist = 0.7
@ -110,7 +111,7 @@ local np_grass = {
local np_terrain = {
offset = 0,
scale = 1,
spread = {x=384, y=192, z=384},
spread = {x = 384, y = 192, z = 384},
seed = 5900033,
octaves = 5,
persist = 0.67
@ -121,7 +122,7 @@ local np_terrain = {
local np_terrainalt = {
offset = 0,
scale = 1,
spread = {x=311, y=155, z=311},
spread = {x = 311, y = 155, z = 311},
seed = -5933,
octaves = 5,
persist = 0.67
@ -132,7 +133,7 @@ local np_terrainalt = {
local np_temp = {
offset = 0,
scale = 1,
spread = {x=3072, y=3072, z=3072},
spread = {x = 3072, y = 3072, z = 3072},
seed = 18882,
octaves = 3,
persist = 0.4
@ -143,7 +144,7 @@ local np_temp = {
local np_weba = {
offset = 0,
scale = 1,
spread = {x=192, y=192, z=192},
spread = {x = 192, y = 192, z = 192},
seed = 5900033,
octaves = 3,
persist = 0.4
@ -152,7 +153,7 @@ local np_weba = {
local np_webb = {
offset = 0,
scale = 1,
spread = {x=191, y=191, z=191},
spread = {x = 191, y = 191, z = 191},
seed = 33,
octaves = 3,
persist = 0.4
@ -161,7 +162,7 @@ local np_webb = {
local np_webe = {
offset = 0,
scale = 1,
spread = {x=190, y=190, z=190},
spread = {x = 190, y = 190, z = 190},
seed = 3900011,
octaves = 3,
persist = 0.4
@ -172,7 +173,7 @@ local np_webe = {
local np_webc = {
offset = 0,
scale = 1,
spread = {x=384, y=384, z=384},
spread = {x = 384, y = 384, z = 384},
seed = -181,
octaves = 4,
persist = 0.4
@ -181,7 +182,7 @@ local np_webc = {
local np_webd = {
offset = 0,
scale = 1,
spread = {x=383, y=383, z=383},
spread = {x = 383, y = 383, z = 383},
seed = 1022081,
octaves = 4,
persist = 0.4
@ -192,7 +193,7 @@ local np_webd = {
local np_fissure = {
offset = 0,
scale = 1,
spread = {x=768, y=1536, z=768},
spread = {x = 768, y = 1536, z = 768},
seed = -2332339,
octaves = 6,
persist = 0.5
@ -203,36 +204,25 @@ local np_fissure = {
local np_strata = {
offset = 0,
scale = 1,
spread = {x=3072, y=48, z=3072},
spread = {x = 3072, y = 48, z = 3072},
seed = 92219,
octaves = 4,
persist = 1
}
-- Stuff
-- initialize 3D and 2D noise objects to nil
-- Do files
local nobj_terrain = nil
local nobj_terrainalt = nil
local nobj_temp = nil
local nobj_weba = nil
local nobj_webb = nil
local nobj_webc = nil
local nobj_webd = nil
local nobj_webe = nil
local nobj_fissure = nil
local nobj_strata = nil
local nobj_mid = nil
local nobj_base = nil
local nobj_patha = nil
local nobj_pathb = nil
local nobj_tree = nil
local nobj_grass = nil
dofile(minetest.get_modpath("riverdev") .. "/functions.lua")
dofile(minetest.get_modpath("riverdev") .. "/nodes.lua")
-- Set mapgen parameters
minetest.register_on_mapgen_init(function(mgparams)
minetest.set_mapgen_params({mgname="singlenode", flags="nolight"})
end)
dofile(minetest.get_modpath("riverdev").."/functions.lua")
dofile(minetest.get_modpath("riverdev").."/nodes.lua")
-- Mapgen functions
@ -244,8 +234,8 @@ local function riverdev_pathbrush(x, y, z, area, data,
local c_wood = minetest.get_content_id("default:junglewood")
local c_snow = minetest.get_content_id("default:snow")
if wood and math.random() < 0.2 then
local vi = area:index(x, y-2, z)
for j = y-2, y0-16, -1 do -- use mapblock shell
local vi = area:index(x, y - 2, z)
for j = y - 2, y0 - 16, -1 do -- use mapblock shell
if data[vi] == c_stone then
break
else
@ -255,7 +245,7 @@ local function riverdev_pathbrush(x, y, z, area, data,
end
end
for k = -1, 1 do
local vi = area:index(x-1, y-1, z+k)
local vi = area:index(x - 1, y - 1, z + k)
local via = vi + emerlen
for i = -1, 1 do
if wood then
@ -349,13 +339,31 @@ local function riverdev_surface(x, y, z, area, data, y1, vi, viu,
end
end
-- initialize noise objects to nil
local nobj_terrain = nil
local nobj_terrainalt = nil
local nobj_temp = nil
local nobj_weba = nil
local nobj_webb = nil
local nobj_webc = nil
local nobj_webd = nil
local nobj_webe = nil
local nobj_fissure = nil
local nobj_strata = nil
local nobj_mid = nil
local nobj_base = nil
local nobj_patha = nil
local nobj_pathb = nil
local nobj_tree = nil
local nobj_grass = nil
-- On generated function
minetest.register_on_generated(function(minp, maxp, seed)
if minp.y < YMIN or maxp.y > YMAX then
return
end
local t0 = os.clock()
local x1 = maxp.x
local y1 = maxp.y
@ -364,8 +372,6 @@ minetest.register_on_generated(function(minp, maxp, seed)
local y0 = minp.y
local z0 = minp.z
print ("[riverdev] generate chunk minp ("..x0.." "..y0.." "..z0..")")
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
local area = VoxelArea:new{MinEdge=emin, MaxEdge=emax}
local data = vm:get_data()
@ -405,10 +411,10 @@ minetest.register_on_generated(function(minp, maxp, seed)
local overlen = sidelen + 1 -- perlinmap overgeneration horizontal side length
local emerlen = sidelen + 32 -- voxelmanip emerged volume edge length
--local emerarea = emerlen ^ 2 -- voxelmanip emerged volume face area
local chulensxyz = {x=overlen, y=sidelen+2, z=overlen}
local minposxyz = {x=x0-1, y=y0-1, z=z0-1}
local chulensxz = {x=overlen, y=overlen, z=1} -- different because here x=x, y=z
local minposxz = {x=x0-1, y=z0-1}
local chulensxyz = {x = overlen, y = sidelen + 2, z = overlen}
local minposxyz = {x = x0 - 1, y = y0 - 1, z = z0 - 1}
local chulensxz = {x = overlen, y = overlen, z = 1} -- different because here x=x, y=z
local minposxz = {x = x0 - 1, y = z0 - 1}
-- 3D and 2D noise objects created once on first mapchunk generation only
nobj_terrain = nobj_terrain or minetest.get_perlin_map(np_terrain, chulensxyz)
nobj_terrainalt = nobj_terrainalt or minetest.get_perlin_map(np_terrainalt, chulensxyz)
@ -441,13 +447,13 @@ minetest.register_on_generated(function(minp, maxp, seed)
local nvals_mid = nobj_mid:get2dMap_flat(minposxz)
local nvals_base = nobj_base:get2dMap_flat(minposxz)
local nvals_humid = nobj_base:get2dMap_flat({x=x0-1, y=z0+383})
local nvals_humid = nobj_base:get2dMap_flat({x = x0 - 1, y = z0 + 383})
local nvals_patha = nobj_patha:get2dMap_flat(minposxz)
local nvals_pathb = nobj_pathb:get2dMap_flat(minposxz)
local nvals_tree = nobj_tree:get2dMap_flat(minposxz)
local nvals_grass = nobj_grass:get2dMap_flat(minposxz)
-- ungenerated chunk below?
local viu = area:index(x0, y0-1, z0)
local viu = area:index(x0, y0 - 1, z0)
local ungen = data[viu] == c_ignore
local nixyz = 1
@ -457,7 +463,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
for z = z0 - 1, z1 do
for y = y0 - 1, y1 + 1 do
local si = 1
local vi = area:index(x0-1, y, z)
local vi = area:index(x0 - 1, y, z)
local viu = vi - emerlen
local n_xprepatha = false
local n_xprepathb = false
@ -720,6 +726,108 @@ minetest.register_on_generated(function(minp, maxp, seed)
vm:update_liquids()
local chugent = math.ceil((os.clock() - t0) * 1000)
print ("[riverdev] "..chugent.." ms")
print ("[riverdev] " .. chugent .. " ms")
end)
-- Spawn player function
-- Only works with chunksize = 5 mapblocks
local function riverdev_spawnplayer(player)
local xsp
local ysp
local zsp
local nobj_terrain = nil
local nobj_mid = nil
local nobj_base = nil
local nobj_patha = nil
local nobj_pathb = nil
for chunk = 1, 128 do
print ("[riverdev] searching for spawn " .. chunk)
local x0 = 80 * math.random(-PSCA, PSCA) - 32
local z0 = 80 * math.random(-PSCA, PSCA) - 32
local y0 = 80 * math.floor((YWATER + 32) / 80) - 32
local x1 = x0 + 79
local z1 = z0 + 79
local y1 = y0 + 79
local sidelen = 80
local chulensxyz = {x = sidelen, y = sidelen, z = sidelen}
local minposxyz = {x = x0, y = y0, z = z0}
local chulensxz = {x = sidelen, y = sidelen, z = 1}
local minposxz = {x = x0, y = z0}
nobj_terrain = nobj_terrain or minetest.get_perlin_map(np_terrain, chulensxyz)
nobj_mid = nobj_mid or minetest.get_perlin_map(np_mid, chulensxz)
nobj_base = nobj_base or minetest.get_perlin_map(np_base, chulensxz)
nobj_patha = nobj_patha or minetest.get_perlin_map(np_patha, chulensxz)
nobj_pathb = nobj_pathb or minetest.get_perlin_map(np_pathb, chulensxz)
local nvals_terrain = nobj_terrain:get3dMap_flat(minposxyz)
local nvals_mid = nobj_mid:get2dMap_flat(minposxz)
local nvals_base = nobj_base:get2dMap_flat(minposxz)
local nvals_patha = nobj_patha:get2dMap_flat(minposxz)
local nvals_pathb = nobj_pathb:get2dMap_flat(minposxz)
local nixyz = 1
local nixz = 1
for z = z0, z1 do
for y = y0, y1 do
for x = x0, x1 do
local n_patha = nvals_patha[nixz]
local n_abspatha = math.abs(n_patha)
local n_pathb = nvals_pathb[nixz]
local n_abspathb = math.abs(n_pathb)
local n_terrain = (nvals_terrain[nixyz] + 2) / 2
local n_absmid = (math.abs(nvals_mid[nixz])) ^ 0.8
local n_absbase = (math.abs(nvals_base[nixz])) ^ 0.8
local n_invbase = math.max(1 - n_absbase, 0)
local grad = (YTER - y) / TERSCA
local densitybase = n_invbase * BASAMP + grad
local densitymid = n_absmid * MIDAMP + densitybase
local density = n_terrain * n_invbase * n_absmid * n_abspatha ^ 1.5 * n_abspathb ^ 1.5
+ densitymid
if y >= YWATER and density > -0.01 and density < 0 then
ysp = y + 1
xsp = x
zsp = z
break
end
nixz = nixz + 1
nixyz = nixyz + 1
end
if ysp then
break
end
nixz = nixz - 80
end
if ysp then
break
end
nixz = nixz + 80
end
if ysp then
break
end
end
if ysp then
print ("[riverdev] spawn player (" .. xsp .. " " .. ysp .. " " .. zsp .. ")")
player:setpos({x = xsp, y = ysp, z = zsp})
else
print ("[riverdev] no suitable spawn found")
player:setpos({x = 0, y = 2, z = 0})
end
end
minetest.register_on_newplayer(function(player)
riverdev_spawnplayer(player)
end)
minetest.register_on_respawnplayer(function(player)
riverdev_spawnplayer(player)
return true
end)

View File

@ -1,14 +1,25 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
License of source code
----------------------
Copyright (C) 2014-2015 paramat.
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
License of media (textures)
---------------------------
All textures are derived from Minetest's default textures.
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
http://creativecommons.org/licenses/by-sa/3.0/
0. You just DO WHAT THE FUCK YOU WANT TO.

135
nodes.lua
View File

@ -2,7 +2,7 @@ minetest.register_node("riverdev:stone", {
description = "Stone",
tiles = {"default_stone.png"},
is_ground_content = false,
groups = {cracky=3},
groups = {cracky = 3},
drop = "default:cobble",
sounds = default.node_sound_stone_defaults(),
})
@ -11,7 +11,7 @@ minetest.register_node("riverdev:redstone", {
description = "Red Stone",
tiles = {"default_desert_stone.png"},
is_ground_content = false,
groups = {cracky=3},
groups = {cracky = 3},
drop = "default:desert_cobble",
sounds = default.node_sound_stone_defaults(),
})
@ -20,7 +20,7 @@ minetest.register_node("riverdev:dirt", {
description = "Dirt",
tiles = {"default_dirt.png"},
is_ground_content = false,
groups = {crumbly=3},
groups = {crumbly = 3},
drop = "default:dirt",
sounds = default.node_sound_dirt_defaults(),
})
@ -29,10 +29,10 @@ minetest.register_node("riverdev:grass", {
description = "Grass",
tiles = {"default_grass.png", "default_dirt.png", "default_grass.png"},
is_ground_content = false,
groups = {crumbly=3},
groups = {crumbly = 3},
drop = "default:dirt",
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.25},
footstep = {name = "default_grass_footstep", gain = 0.25},
}),
})
@ -40,7 +40,7 @@ minetest.register_node("riverdev:path", {
description = "Dirt Path",
tiles = {"riverdev_path.png"},
is_ground_content = false,
groups = {crumbly=3},
groups = {crumbly = 3},
drop = "default:dirt",
sounds = default.node_sound_dirt_defaults(),
})
@ -52,11 +52,11 @@ minetest.register_node("riverdev:appleleaf", {
tiles = {"default_leaves.png"},
paramtype = "light",
is_ground_content = false,
groups = {snappy=3, flammable=2},
groups = {snappy = 3, flammable = 2},
drop = {
max_items = 1,
items = {
{items = {"riverdev:appling"},rarity = 20},
{items = {"riverdev:appling"}, rarity = 20},
{items = {"riverdev:appleleaf"}}
}
},
@ -77,16 +77,17 @@ minetest.register_node("riverdev:appling", {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
},
groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1},
groups = {snappy = 2, dig_immediate = 3, flammable = 2, attached_node = 1},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("riverdev:pinetree", {
description = "Pine tree",
tiles = {"riverdev_pinetreetop.png", "riverdev_pinetreetop.png", "riverdev_pinetree.png"},
tiles = {"riverdev_pinetreetop.png", "riverdev_pinetreetop.png",
"riverdev_pinetree.png"},
paramtype2 = "facedir",
is_ground_content = false,
groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node
})
@ -98,7 +99,7 @@ minetest.register_node("riverdev:needles", {
tiles = {"riverdev_needles.png"},
paramtype = "light",
is_ground_content = false,
groups = {snappy=3},
groups = {snappy = 3},
drop = {
max_items = 1,
items = {
@ -123,14 +124,14 @@ minetest.register_node("riverdev:pineling", {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
},
groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1},
groups = {snappy = 2, dig_immediate = 3, flammable = 2, attached_node = 1},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("riverdev:pinewood", {
description = "Pine wood planks",
tiles = {"riverdev_pinewood.png"},
groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
sounds = default.node_sound_wood_defaults(),
})
@ -141,11 +142,11 @@ minetest.register_node("riverdev:jungleleaf", {
tiles = {"default_jungleleaves.png"},
paramtype = "light",
is_ground_content = false,
groups = {snappy=3, flammable=2, leaves=1},
groups = {snappy = 3, flammable = 2, leaves = 1},
drop = {
max_items = 1,
items = {
{items = {"riverdev:jungling"},rarity = 20},
{items = {"riverdev:jungling"}, rarity = 20},
{items = {"riverdev:jungleleaf"}}
}
},
@ -162,7 +163,7 @@ minetest.register_node("riverdev:vine", {
diggable = false,
buildable_to = true,
is_ground_content = false,
groups = {not_in_creative_inventory=1},
groups = {not_in_creative_inventory = 1},
})
minetest.register_node("riverdev:jungling", {
@ -179,16 +180,17 @@ minetest.register_node("riverdev:jungling", {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
},
groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1},
groups = {snappy = 2, dig_immediate = 3, flammable = 2, attached_node = 1},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("riverdev:acaciatree", {
description = "Acacia tree",
tiles = {"riverdev_acaciatreetop.png", "riverdev_acaciatreetop.png", "riverdev_acaciatree.png"},
tiles = {"riverdev_acaciatreetop.png", "riverdev_acaciatreetop.png",
"riverdev_acaciatree.png"},
paramtype2 = "facedir",
is_ground_content = false,
groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node
})
@ -200,11 +202,11 @@ minetest.register_node("riverdev:acacialeaf", {
tiles = {"riverdev_acacialeaf.png"},
paramtype = "light",
is_ground_content = false,
groups = {snappy=3, flammable=2, leaves=1},
groups = {snappy = 3, flammable = 2, leaves = 1},
drop = {
max_items = 1,
items = {
{items = {"riverdev:acacialing"},rarity = 20},
{items = {"riverdev:acacialing"}, rarity = 20},
{items = {"riverdev:acacialeaf"}}
}
},
@ -225,14 +227,14 @@ minetest.register_node("riverdev:acacialing", {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
},
groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1},
groups = {snappy = 2, dig_immediate = 3, flammable = 2, attached_node = 1},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("riverdev:acaciawood", {
description = "Acacia wood planks",
tiles = {"riverdev_acaciawood.png"},
groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
sounds = default.node_sound_wood_defaults(),
})
@ -246,7 +248,7 @@ minetest.register_node("riverdev:goldengrass", {
walkable = false,
buildable_to = true,
is_ground_content = false,
groups = {snappy=3,flammable=3,flora=1,attached_node=1},
groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
@ -258,10 +260,10 @@ minetest.register_node("riverdev:drygrass", {
description = "Dry grass",
tiles = {"riverdev_drygrass.png"},
is_ground_content = false,
groups = {crumbly=1,soil=1},
groups = {crumbly = 1, soil = 1},
drop = "default:dirt",
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4},
footstep = {name = "default_grass_footstep", gain = 0.4},
}),
})
@ -269,11 +271,11 @@ minetest.register_node("riverdev:icydirt", {
description = "Icy dirt",
tiles = {"riverdev_icydirt.png"},
is_ground_content = false,
groups = {crumbly=1},
groups = {crumbly = 1},
drop = "default:dirt",
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_snow_footstep", gain=0.15},
dug = {name="default_snow_footstep", gain=0.45},
footstep = {name = "default_snow_footstep", gain = 0.15},
dug = {name = "default_snow_footstep", gain = 0.45},
}),
})
@ -281,7 +283,7 @@ minetest.register_node("riverdev:permafrost", {
description = "Permafrost",
tiles = {"riverdev_permafrost.png"},
is_ground_content = false,
groups = {crumbly=1},
groups = {crumbly = 1},
drop = "default:dirt",
sounds = default.node_sound_dirt_defaults(),
})
@ -291,7 +293,7 @@ minetest.register_node("riverdev:cactus", {
tiles = {"default_cactus_top.png", "default_cactus_top.png", "default_cactus_side.png"},
paramtype2 = "facedir",
is_ground_content = false,
groups = {snappy=1,choppy=3,flammable=2},
groups = {snappy = 1, choppy = 3, flammable = 2},
drop = "default:cactus",
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node
@ -303,16 +305,16 @@ minetest.register_node("riverdev:freshwater", {
drawtype = "liquid",
tiles = {
{
name="riverdev_freshwateranim.png",
animation={type="vertical_frames",
aspect_w=16, aspect_h=16, length=2.0}
name = "riverdev_freshwateranim.png",
animation = {type = "vertical_frames",
aspect_w = 16, aspect_h = 16, length = 2.0}
}
},
special_tiles = {
{
name="riverdev_freshwateranim.png",
animation={type="vertical_frames",
aspect_w=16, aspect_h=16, length=2.0},
name = "riverdev_freshwateranim.png",
animation = {type = "vertical_frames",
aspect_w = 16, aspect_h = 16, length = 2.0},
backface_culling = false,
}
},
@ -331,8 +333,8 @@ minetest.register_node("riverdev:freshwater", {
liquid_viscosity = WATER_VISC,
liquid_renewable = false,
liquid_range = 2,
post_effect_color = {a=64, r=100, g=150, b=200},
groups = {water=3, liquid=3, puts_out_fire=1},
post_effect_color = {a = 64, r = 100, g = 150, b = 200},
groups = {water = 3, liquid = 3, puts_out_fire = 1},
})
minetest.register_node("riverdev:freshwaterflow", {
@ -342,14 +344,14 @@ minetest.register_node("riverdev:freshwaterflow", {
tiles = {"riverdev_freshwater.png"},
special_tiles = {
{
image="riverdev_freshwaterflowanim.png",
backface_culling=false,
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=0.8}
image = "riverdev_freshwaterflowanim.png",
backface_culling = false,
animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 0.8}
},
{
image="riverdev_freshwaterflowanim.png",
backface_culling=true,
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=0.8}
image = "riverdev_freshwaterflowanim.png",
backface_culling = true,
animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 0.8}
},
},
alpha = WATER_ALPHA,
@ -368,8 +370,8 @@ minetest.register_node("riverdev:freshwaterflow", {
liquid_viscosity = WATER_VISC,
liquid_renewable = false,
liquid_range = 2,
post_effect_color = {a=64, r=100, g=130, b=200},
groups = {water=3, liquid=3, puts_out_fire=1, not_in_creative_inventory=1},
post_effect_color = {a = 64, r = 100, g = 130, b = 200},
groups = {water = 3, liquid = 3, puts_out_fire = 1, not_in_creative_inventory = 1},
})
minetest.register_node("riverdev:mixwater", {
@ -378,16 +380,16 @@ minetest.register_node("riverdev:mixwater", {
drawtype = "liquid",
tiles = {
{
name="riverdev_mixwateranim.png",
animation={type="vertical_frames",
aspect_w=16, aspect_h=16, length=2.0}
name = "riverdev_mixwateranim.png",
animation = {type = "vertical_frames",
aspect_w = 16, aspect_h = 16, length = 2.0}
}
},
special_tiles = {
{
name="riverdev_mixwateranim.png",
animation={type="vertical_frames",
aspect_w=16, aspect_h=16, length=2.0},
name = "riverdev_mixwateranim.png",
animation = {type = "vertical_frames",
aspect_w = 16, aspect_h = 16, length = 2.0},
backface_culling = false,
}
},
@ -406,8 +408,8 @@ minetest.register_node("riverdev:mixwater", {
liquid_viscosity = WATER_VISC,
liquid_renewable = false,
liquid_range = 2,
post_effect_color = {a=64, r=100, g=115, b=200},
groups = {water=3, liquid=3, puts_out_fire=1},
post_effect_color = {a = 64, r = 100, g = 115, b = 200},
groups = {water = 3, liquid = 3, puts_out_fire = 1},
})
minetest.register_node("riverdev:mixwaterflow", {
@ -417,14 +419,14 @@ minetest.register_node("riverdev:mixwaterflow", {
tiles = {"riverdev_mixwater.png"},
special_tiles = {
{
image="riverdev_mixwaterflowanim.png",
backface_culling=false,
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=0.8}
image = "riverdev_mixwaterflowanim.png",
backface_culling = false,
animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 0.8}
},
{
image="riverdev_mixwaterflowanim.png",
backface_culling=true,
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=0.8}
image = "riverdev_mixwaterflowanim.png",
backface_culling = true,
animation = {type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 0.8}
},
},
alpha = WATER_ALPHA,
@ -443,8 +445,8 @@ minetest.register_node("riverdev:mixwaterflow", {
liquid_viscosity = WATER_VISC,
liquid_renewable = false,
liquid_range = 2,
post_effect_color = {a=64, r=100, g=115, b=200},
groups = {water=3, liquid=3, puts_out_fire=1, not_in_creative_inventory=1},
post_effect_color = {a = 64, r = 100, g = 115, b = 200},
groups = {water = 3, liquid = 3, puts_out_fire = 1, not_in_creative_inventory = 1},
})
-- Crafting
@ -468,7 +470,7 @@ minetest.register_craft({
stairs.register_stair_and_slab(
"pinewood",
"riverdev:pinewood",
{snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3},
{snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
{"riverdev_pinewood.png"},
"Pinewood stair",
"Pinewood slab",
@ -478,7 +480,7 @@ stairs.register_stair_and_slab(
stairs.register_stair_and_slab(
"acaciawood",
"riverdev:acaciawood",
{snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3},
{snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
{"riverdev_acaciawood.png"},
"Acaciawood stair",
"Acaciawood slab",
@ -494,4 +496,3 @@ bucket.register_liquid(
"riverdev_bucketfreshwater.png",
"Fresh Water Bucket"
)