89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
|
end
world.ecology.biomes.foreach('starlit:biome-gen', {}, function(id, b)
b.def.name = id
minetest.register_biome(b.def)
end)
world.ecology.biomes.link('starlit:steppe', {
nightTempDelta = -30;
waterTempDelta = 0;
-- W Sp Su Au W
seasonalTemp = {-50, -10, 5, 5, -20, -50};
def = {
node_top = 'starlit:greengraze', depth_top = 1;
node_filler = 'starlit:soil', depth_filler = 4;
node_riverbed = 'starlit:sand', depth_riverbed = 4;
y_min = 0;
y_max = 512;
heat_point = 10;
humidity_point = 30;
};
})
world.ecology.biomes.link('starlit:ocean', {
nightTempDelta = -35;
waterTempDelta = 5;
seasonalTemp = {0}; -- no seasonal variance
def = {
y_max = 3;
y_min = -512;
heat_point = 15;
humidity_point = 50;
node_top = 'starlit:sand', depth_top = 1;
node_filler = 'starlit:sand', depth_filler = 3;
};
})
local toward = lib.math.toward
local hfinterval = 1.5
starlit.startJob('starlit:heatflow', hfinterval, function(delta)
-- our base thermal conductivity (κ) is measured in °C/°C/s. say the
-- player is in -30°C weather, and has an internal temperature of
|
|
|
|
|
|
|
|
|
|
|
|
>
>
>
>
>
>
|
<
>
|
<
<
<
<
<
<
|
|
|
|
<
<
<
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
|
end
world.ecology.biomes.foreach('starlit:biome-gen', {}, function(id, b)
b.def.name = id
minetest.register_biome(b.def)
end)
world.ecology.plants.foreach('starlit:plant-gen', {}, function(id, b)
local stageCt = #b.stages
local function stageID(n)
if n == stageCt then return id end
return id .. string.format('_stage_%s', n)
end
b.stageNodes = {}
local function regStage(n, st)
local base = {
description = b.name;
drawtype = "plantlike";
tiles = { tostring(st.tex) };
paramtype = "light";
paramtype2 = "meshoptions";
walkable = false;
buildable_to = true;
groups = {
plant = 1;
plant_grow = stageCt ~= n and 1 or 0;
};
drop = st.drop;
_starlit = {
plant = {
id = id, stage = n;
};
};
}
if st.swap then
base.node_dig_prediction = stageID(st.swap)
function base.on_dig(pos, node, digger)
node.name = stageID(st.swap)
minetest.swap_node(pos, node)
return true
end
end
return base
end
for i, v in ipairs(b.stages) do
local n = regStage(i, v)
b.stageNodes[i] = n
minetest.register_node(stageID(i), n)
end
b.fullyGrown = stageID(stageCt)
local dec = {
deco_type = 'simple';
decoration = b.fullyGrown;
height = 1;
param2 = 0;
}
for k,v in pairs(b.decoration) do dec[k] = v end
b.decoration = minetest.register_decoration(dec)
end)
local toward = lib.math.toward
local hfinterval = 1.5
starlit.startJob('starlit:heatflow', hfinterval, function(delta)
-- our base thermal conductivity (κ) is measured in °C/°C/s. say the
-- player is in -30°C weather, and has an internal temperature of
|