2 pedology
.wetnames
= {[0] = "dry", "wet", "watery", "sludgy", "muddy", "slurry" }
4 dofile(minetest
.get_modpath("pedology").."/settings.lua")
6 if pedology
.USE_DRIPS
== true then
7 dofile(minetest
.get_modpath("pedology").."/drip.lua")
12 function pedology
.ooze(pos
, node
, active_object_count
, active_object_wider
)
13 local wet
= minetest
.get_item_group(node
.name
, "wet")
14 if wet
== 0 then return end
16 --[[ This table contain the nodes which are either neighbors
17 of node or which touch the node at an edge or corner and which are
18 not on a heigher y-level than
22 { -- neighbor directly below
23 {x
=pos
.x
, y
=pos
.y
-1, z
=pos
.z
},
27 { -- touching the lower sides
28 {x
=pos
.x
, y
=pos
.y
-1, z
=pos
.z
-1},
29 {x
=pos
.x
, y
=pos
.y
-1, z
=pos
.z
+1},
30 {x
=pos
.x
-1, y
=pos
.y
-1, z
=pos
.z
},
31 {x
=pos
.x
+1, y
=pos
.y
-1, z
=pos
.z
},
34 { -- touching the lower corners
35 {x
=pos
.x
-1, y
=pos
.y
-1, z
=pos
.z
-1},
36 {x
=pos
.x
-1, y
=pos
.y
-1, z
=pos
.z
+1},
37 {x
=pos
.x
-1, y
=pos
.y
-1, z
=pos
.z
-1},
38 {x
=pos
.x
+1, y
=pos
.y
-1, z
=pos
.z
+1},
39 {x
=pos
.x
+1, y
=pos
.y
-1, z
=pos
.z
+1},
42 { -- sides on the same level
43 {x
=pos
.x
-1, y
=pos
.y
, z
=pos
.z
}, -- left
44 {x
=pos
.x
+1, y
=pos
.y
, z
=pos
.z
}, -- right
45 {x
=pos
.x
, y
=pos
.y
, z
=pos
.z
-1}, -- before
46 {x
=pos
.x
, y
=pos
.y
, z
=pos
.z
+1}, -- behind
49 { -- touching at the side on the same level
50 {x
=pos
.x
-1, y
=pos
.y
, z
=pos
.z
-1},
51 {x
=pos
.x
-1, y
=pos
.y
, z
=pos
.z
+1},
52 {x
=pos
.x
+1, y
=pos
.y
, z
=pos
.z
-1},
53 {x
=pos
.x
+1, y
=pos
.y
, z
=pos
.z
+1},
59 for j
=1,#neighbors
[i
] do
60 local node
= minetest
.get_node(neighbors
[i
][j
])
61 local name
= node
.name
62 local destwet
= minetest
.get_item_group(name
, "wet")
65 (minetest
.get_item_group(name
, "sucky") >= 1)) and
66 (neighbors
[i
].minwet
<= (wet
- destwet
)) then
67 pedology
.wetten(neighbors
[i
][j
])
75 --[[ This is an ABM action which wettens the node iff many water nodes
76 are neighbors of it or touching it at an edge or corner.]]
77 function pedology
.suck(pos
, node
, active_object_count
, active_object_wider
)
78 local wet
= minetest
.get_item_group(node
.name
, "wet")
82 -- These three tables contain the positions of all nodes around node
85 {x
=pos
.x
, y
=pos
.y
-1, z
=pos
.z
}, -- below
86 {x
=pos
.x
-1, y
=pos
.y
, z
=pos
.z
}, -- left
87 {x
=pos
.x
+1, y
=pos
.y
, z
=pos
.z
}, -- right
88 {x
=pos
.x
, y
=pos
.y
+1, z
=pos
.z
}, -- above
89 {x
=pos
.x
, y
=pos
.y
, z
=pos
.z
-1}, -- before
90 {x
=pos
.x
, y
=pos
.y
, z
=pos
.z
+1}, -- behind
94 {x
=pos
.x
, y
=pos
.y
-1, z
=pos
.z
-1},
95 {x
=pos
.x
, y
=pos
.y
-1, z
=pos
.z
+1},
96 {x
=pos
.x
, y
=pos
.y
+1, z
=pos
.z
-1},
97 {x
=pos
.x
, y
=pos
.y
+1, z
=pos
.z
+1},
98 {x
=pos
.x
-1, y
=pos
.y
, z
=pos
.z
-1},
99 {x
=pos
.x
-1, y
=pos
.y
, z
=pos
.z
+1},
100 {x
=pos
.x
+1, y
=pos
.y
, z
=pos
.z
-1},
101 {x
=pos
.x
+1, y
=pos
.y
, z
=pos
.z
+1},
102 {x
=pos
.x
-1, y
=pos
.y
-1, z
=pos
.z
},
103 {x
=pos
.x
-1, y
=pos
.y
+1, z
=pos
.z
},
104 {x
=pos
.x
+1, y
=pos
.y
-1, z
=pos
.z
},
105 {x
=pos
.x
+1, y
=pos
.y
+1, z
=pos
.z
},
109 {x
=pos
.x
-1, y
=pos
.y
-1, z
=pos
.z
-1},
110 {x
=pos
.x
-1, y
=pos
.y
-1, z
=pos
.z
+1},
111 {x
=pos
.x
-1, y
=pos
.y
+1, z
=pos
.z
-1},
112 {x
=pos
.x
-1, y
=pos
.y
+1, z
=pos
.z
+1},
113 {x
=pos
.x
-1, y
=pos
.y
-1, z
=pos
.z
-1},
114 {x
=pos
.x
+1, y
=pos
.y
+1, z
=pos
.z
+1},
115 {x
=pos
.x
+1, y
=pos
.y
+1, z
=pos
.z
-1},
116 {x
=pos
.x
+1, y
=pos
.y
-1, z
=pos
.z
+1},
117 {x
=pos
.x
+1, y
=pos
.y
-1, z
=pos
.z
+1},
122 for i
=1,#neighbors
do
123 for j
=1,#neighbors
[i
] do
124 local neighbor
= minetest
.get_node(neighbors
[i
][j
])
125 local name
= neighbor
.name
126 local water
= minetest
.get_item_group(name
, "water")
128 score
= score
+ neighbors
[i
].rating
134 if(wet
== 0 and score
>= 1) then
136 elseif(wet
== 1 and score
>= 2) then
138 elseif(wet
== 2 and score
>= 3) then
140 elseif(wet
== 3 and score
>= 5) then
142 elseif(wet
== 4 and score
>= 8) then
144 elseif(wet
== 5 and score
>= 11) then
145 -- erosion: turn node into water
146 -- TODO: Also drop the drops
147 minetest
.set_node(pos
, {name
="pedology:water_fresh_source"})
151 if(wetten
==true) then
156 --[[ ABM action which dries out a node when it is in direct sunlight ]]
157 function pedology
.sun_dry(pos
, node
, active_object_count
, active_object_wider
)
158 if(minetest
.get_item_group(node
.name
, "wet") < 6) then
159 -- don’t dry off if there is water nearby
160 if(not minetest
.find_node_near(pos
, 1, {"group:water"})) then
161 local light
= minetest
.get_node_light(pos
, minetest
.get_timeofday())
162 if light
>= pedology
.DRY_LIGHT
then
171 --[[ air and vacuum]]
172 minetest
.register_node("pedology:vacuum", {
173 description
= "vacuum",
174 inventory_image
="unknown_node.png",
175 wield_image
="unknown_node.png",
180 sunlight_propagates
=true,
185 groups
={not_in_creative_inventory
=1}
188 minetest
.register_node("pedology:thinair2", {
189 description
= "very thin air",
190 inventory_image
="unknown_node.png",
191 wield_image
="unknown_node.png",
194 sunlight_propagates
=true,
199 groups
={not_in_creative_inventory
=1}
202 minetest
.register_node("pedology:thinair1", {
203 description
= "thin air",
204 inventory_image
="unknown_node.png",
205 wield_image
="unknown_node.png",
208 sunlight_propagates
=true,
213 groups
={not_in_creative_inventory
=1}
218 function pedology
.register_liquid(basename
, description
, alpha
, viscosity
, drowning
, damage_per_second
, post_effect_color
, additional_groups
)
219 flowing_groups
= {wet
=6,not_in_creative_inventory
=1}
220 source_groups
= {wet
=6}
221 for k
,v
in pairs(additional_groups
) do
222 flowing_groups
[k
] = v
226 local tile
= "pedology_"..basename
..".png"
227 local nodedef_source
= {
228 description
= description
.." source",
229 inventory_image
= minetest
.inventorycube(tile
),
238 liquid_alternative_flowing
= "pedology:"..basename
.."_flowing",
239 liquid_alternative_source
= "pedology:"..basename
.."_source",
240 liquid_viscosity
= viscosity
,
241 post_effect_color
= post_effect_color
,
243 damage_per_second
= damage_per_second
,
246 liquidtype
= "source",
247 groups
= source_groups
,
249 minetest
.register_node("pedology:"..basename
.."_source", nodedef_source
)
251 local nodedef_flowing
= {
252 description
= description
.." flowing",
253 inventory_image
= minetest
.inventorycube(tile
),
262 liquid_alternative_flowing
= "pedology:"..basename
.."_flowing",
263 liquid_alternative_source
= "pedology:"..basename
.."_source",
264 liquid_viscosity
= viscosity
,
265 post_effect_color
= post_effect_color
,
267 damage_per_second
= damage_per_second
,
269 drawtype
= "flowingliquid",
270 liquidtype
= "flowing",
271 groups
= flowing_groups
,
272 paramtype2
= "flowingliquid",
275 minetest
.register_node("pedology:"..basename
.."_flowing", nodedef_flowing
)
279 pedology
.register_liquid("water_fresh", "freshwater", 100, 1, 2, 0, {a
=60, r
=100, b
=200, g
=100}, {water
=1})
280 --pedology.register_liquid("water_salt", "salt water", 180, 2, 4, 0, {a=80, r=120, b=200, g=120}, {water=1})
281 pedology
.register_liquid("water_ponding", "ponding water", 234, 4, 3, 0, {a
=128, r
=85, g
=85, g
=60}, {water
=1})
284 TODO: Decide wheather to keep or to remove lava
285 pedology.register_liquid("lava_1", "very hot lava", 230, 2, 10, 8, {a=230, r=255, g=0, b=0}, {hot=6000, lava=1})
286 pedology.register_liquid("lava_2", "hot lava", 230, 3, 9, 7, {a=230, r=255, g=0, b=0}, {hot=5000, lava=1})
287 pedology.register_liquid("lava_3", "lava", 230, 4, 8, 6, {a=230, r=255, g=0, b=0}, {hot=4000, lava=1})
288 pedology.register_liquid("lava_4", "cold lava", 230, 5, 7, 6, {a=230, r=255, g=0, b=0}, {hot=3000, lava=1})
291 --[[ register a sucky/oozing node to this mod ]]
292 function pedology
.register_sucky(basename
, description
, wetness
, oozing
, sucky
, melting_point
, drop
, sounds
, additional_groups
)
293 local wetname
= basename
.."_"..tostring(wetness
)
295 local groups
= { sucky
=sucky
, oozing
=oozing
, wet
=wetness
, melting_point
=melting_point
, not_in_creative_inventory
= noncreative
, [basename
]=1 }
296 if additional_groups
~= nil then
297 for k
,v
in pairs(additional_groups
) do
302 local name
= "pedology:"..wetname
305 -- If the node is not dry, do not add it into the creative inventory
306 if wetness
== 0 then noncreative
= 0 else noncreative
= 1 end
308 description
= description
,
309 inventory_image
= minetest
.inventorycube("pedology_"..wetname
..".png"),
310 tiles
= {"pedology_"..wetname
..".png"},
316 minetest
.register_node(name
, nodedef
)
322 This function registers a couple of sucky/oozing nodes, including all their “wet” variants.
323 It also registers an ABM.
326 basename: The internal name piece from which the concrete basenames will be build. The wetness level will be appended.
327 basedescription. The description of the nodes. A proper wetness adjective (“dry”, “wet”, …) will be prepended.
328 lumpdescription. The description component of the “lump” of the node. If nil, no lump is used
329 maxwet: The maximum wetness level of this node group (minimum: 0, maximum: 5)
330 maxlump: The maximum wetness level of lumps of this node group (minimum: 0, recommended maximum: 3)
331 oozeinterval: The interval in seconds in which it the node may ooze. the Minimal value: 1
332 oozechance: The inverted chance (1/x) to ooze
333 melttable: Table of melting_point values for each wetness level
334 dropcount: How many lumps nodes of this group drop. If 0, the nodes simply drop themselves (not recommended!)
335 sounds: Sound specification for all nodes
336 additional_groups: Either a table of tables of strings, a table of strings or nil. If it is nil, no additional groups will be added to all nodes. If it is a table, the strings are interpreted as group names which will be added to each node. If it is a table of tables strings, you can specify the groups tables for each wetness level (start with index number 0 for dry).
338 function pedology
.register_sucky_group(basename
, basedescription
, lumpbasedescription
, maxwet
, maxlump
, oozeinterval
, oozechance
, melttable
, dropcount
, sounds
, additional_groups
)
339 local oozing
, dripinterval
340 local m
-- melting_point
341 local lumpdescription
343 local nestedgroups
= false
344 if(type(additional_groups
) == "table") then
345 if(type(additional_groups
[0]) == "table") then
351 if(w
==0) then oozing
=0 else oozing
=1 end
352 if (w
==maxwet
and w
~= 5) then sucky
=0 else sucky
=1 end
353 if melttable
== nil then m
= 0 else m
= melttable
[w
] end
354 if( lumpbasedescription
~= nil) then
355 lumpdescription
= (pedology
.wetnames
[w
]).." "..lumpbasedescription
357 lumpdescription
= nil
360 local itemname
, drop
, itemdef
361 if( maxlump
== -1) then
363 elseif( w
> maxlump
) then
364 itemname
= "pedology:"..basename
.."_lump_"..tostring(maxlump
)
365 drop
= itemname
.. " " .. tostring(dropcount
)
367 itemname
= "pedology:"..basename
.."_lump_"..tostring(w
)
368 drop
= itemname
.. " " .. tostring(dropcount
)
370 description
= lumpdescription
,
371 inventory_image
= "pedology_lump_inv_"..basename
.."_"..tostring(w
)..".png",
372 wield_image
= "pedology_lump_"..basename
.."_"..tostring(w
)..".png"
374 minetest
.register_craftitem("pedology:"..basename
.."_lump_"..tostring(w
), itemdef
)
376 if(nestedgroups
) then
377 groups
= additional_groups
[w
]
379 groups
= additional_groups
381 pedology
.register_sucky(basename
, (pedology
.wetnames
[w
]).." "..basedescription
, w
, oozing
, sucky
, m
, drop
, sounds
, groups
)
383 if(w
>0 and pedology
.USE_DRIPS
== true) then
384 minetest
.register_abm({
385 nodenames
= {"pedology:"..basename
.."_"..tostring(w
)},
387 interval
= math
.max(oozeinterval
/4,2),
388 chance
= math
.max(oozechance
,22),
389 action
= pedology
.create_drip
,
394 minetest
.register_abm({
395 nodenames
= {"group:"..basename
},
396 neighbors
= {"group:sucky"},
397 interval
= oozeinterval
,
399 action
= pedology
.ooze
,
407 local sound_clay
= {footstep
= {name
="pedology_clay_footstep", gain
=0.5}}
408 local sound_silt_fine
= {footstep
= {name
="pedology_silt_footstep", gain
=0.3}}
409 local sound_silt_medium
= {footstep
= {name
="pedology_silt_footstep", gain
=0.35}}
410 local sound_silt_coarse
= {footstep
= {name
="pedology_silt_footstep", gain
=0.4}}
411 local sound_sand_fine
= {footstep
= {name
="pedology_sand_footstep", gain
=0.2}}
412 local sound_sand_medium
= {footstep
= {name
="pedology_sand_footstep", gain
=0.25}}
413 local sound_sand_coarse
= {footstep
= {name
="pedology_sand_footstep", gain
=0.3}}
414 local sound_gravel_fine
= {footstep
= {name
="pedology_gravel_footstep", gain
=1}}
415 local sound_gravel_medium
= {footstep
= {name
="pedology_gravel_footstep", gain
=1}}
416 local sound_gravel_coarse
= {footstep
= {name
="pedology_gravel_footstep", gain
=1}}
418 --[[ register sucky and oozing nodes ]]
420 pedology
.register_sucky_group("clay", "clay", "clay lump",
421 5, 3, 60, 1.25, {3000, 3100, 3200, 3500, 3550, 3600}, 4, sound_clay
, { crumbly
= 3, sun_dry
= 1})
422 pedology
.register_sucky_group("silt_fine", "fine silt", "fine silt lump",
423 5, 3, 45, 1.25, {2800, 2900, 3000, 3100, 3200, 3300}, 4, sound_silt_fine
, { crumbly
= 3, sun_dry
= 1 })
424 pedology
.register_sucky_group("silt_medium", "medium silt", "medium silt lump",
425 4, 3, 30, 1.25, {2600, 2800, 3200, 3800, 4200}, 4, sound_silt_medium
, { crumbly
= 3, sun_dry
= 1 })
426 pedology
.register_sucky_group("silt_coarse", "coarse silt", "coarse silt lump",
427 3, 3, 20, 1.25, {2000, 2200, 2400, 2800}, 4, sound_silt_coarse
, { crumbly
= 3, sun_dry
= 1 })
428 pedology
.register_sucky_group("sand_fine", "fine sand", nil,
429 2, -1, 10, 1.111111, {1100, 1200, 1300}, 0, sound_sand_fine
, { crumbly
= 3, sand
= 1, sun_dry
= 1 })
430 pedology
.register_sucky_group("sand_medium", "medium sand", nil,
431 1, -1, 5, 1.111111, {990, 1100}, 0, sound_sand_medium
, { crumbly
= 3, sand
= 1, sun_dry
= 1 })
432 pedology
.register_sucky_group("sand_coarse", "coarse sand", nil,
433 0, -1, nil, nil, {900}, 0, sound_sand_coarse
, { crumbly
= 3, sand
= 1, sun_dry
= 1 })
434 pedology
.register_sucky_group("gravel_fine", "fine gravel", "pebble",
435 1, 0, 2, 1, {670, 770}, 9, sound_gravel_fine
, { crumbly
= 2, sun_dry
= 1 })
436 pedology
.register_sucky_group("gravel_medium", "medium gravel", "medium stone",
437 2, 0, 1.5, 1, {600, 800, 1250}, 3, sound_gravel_medium
, { crumbly
= 2, sun_dry
= 1})
438 pedology
.register_sucky_group("gravel_coarse", "coarse gravel", "big stone",
439 2, 0, 1, 1, {500, 750, 1000}, 1, sound_gravel_coarse
, { crumbly
= 1, sun_dry
= 1 })
443 -- TODO: slushy snow is very instable snow; it should be destroyed when touched
444 minetest
.register_node("pedology:snow_slush", {
445 description
= "slushy snow",
446 tiles
= { "pedology_snow_slush.png" },
447 sounds
= { footstep
= { name
= "pedology_snow_soft_footstep", gain
= 1 } },
448 is_groupd_content
= true,
449 groups
= { crumbly
= 1, level
= 1, melts
= 1, falling_node
= 1},
450 freezemelt
= "pedology:water_fresh_source",
453 minetest
.register_node("pedology:snow_soft", {
454 description
= "soft snow",
455 tiles
= { "pedology_snow_soft.png" },
456 sounds
= { footstep
= { name
= "pedology_snow_soft_footstep", gain
= 1 } },
457 is_groupd_content
= true,
458 groups
= { crumbly
= 2, level
= 2, melts
= 1, falling_node
= 1 },
459 freezemelt
= "pedology:water_fresh_source",
462 minetest
.register_node("pedology:snow", {
463 description
= "snow",
464 tiles
= { "pedology_snow.png" },
465 sounds
= { footstep
= { name
= "pedology_snow_footstep", gain
= 1 } },
466 is_groupd_content
= true,
467 groups
= { crumbly
= 3, level
= 3, melts
= 1, attached_node
= 1, falling_node
= 1 },
468 freezemelt
= "pedology:water_fresh_source",
471 minetest
.register_node("pedology:snow_packing", {
472 description
= "packing snow",
473 tiles
= { "pedology_snow_packing.png" },
474 sounds
= { footstep
= { name
= "pedology_ice_white_footstep", gain
= 0.8 } },
475 is_groupd_content
= true,
476 groups
= { crumbly
= 3, cracky
= 1, level
= 4, melts
= 1 },
477 freezemelt
= "pedology:water_fresh_source",
480 minetest
.register_node("pedology:ice_white", {
481 description
= "white ice",
482 tiles
= { "pedology_ice_white.png" },
483 sounds
= { footstep
= { name
= "pedology_ice_white_footstep", gain
= 0.8 } },
484 is_groupd_content
= true,
485 groups
= { cracky
= 3, level
= 1, melts
= 1 },
486 freezemelt
= "pedology:water_fresh_source",
489 minetest
.register_node("pedology:ice_pure", {
490 description
= "pure ice",
491 drawtype
= "glasslike",
493 tiles
= { "pedology_ice_pure.png" },
494 inventory_image
= minetest
.inventorycube( "pedology_ice_pure.png" ),
495 sounds
= { footstep
= { name
= "pedology_ice_pure_footstep", gain
= 0.8 } },
496 is_groupd_content
= true,
497 groups
= { cracky
= 3, level
= 2, melts
= 1 },
498 freezemelt
= "pedology:water_fresh_source",
502 pedology.register_liquid("clay_3", "sludgy clay", 192, 6, 5, 0, {a=192, r=104, g=23, b=0}, {oozing=1})
503 pedology.register_liquid("clay_4", "muddy clay", 156, 4, 5, 0, {a=156, r=123, g=57, b=6}, {oozing=1})
504 pedology.register_liquid("clay_5", "slurry clay", 128, 2, 5, 0, {a=128, r=146, g=85, b=73}, {oozing=1})
508 pedology
.register_sucky_group("turf_fibric", "fibric turf", "fibric turf cutting",
509 2, 2, 120, 1.25, {1000, 1100, 1200}, 4, sound_silt_coarse
, { [0] = { crumbly
= 3, flammable
= 1 }, { crumbly
= 3 }, {crumbly
= 3} } )
510 pedology
.register_sucky_group("turf_hemic", "hemic turf", "hemic turf cutting",
511 2, 2, 180, 1.225, {1100, 1200, 1300}, 3, sound_silt_coarse
, { [0] = { crumbly
= 3, flammable
= 1 }, { crumbly
= 3 }, { crumbly
= 3 } } )
512 pedology
.register_sucky_group("turf_sapric", "sapric turf", "sapric turf cutting",
513 2, 2, 240, 1.2, {1200, 1300, 1400}, 2, sound_silt_coarse
, { [0] = { crumbly
= 3, flammable
= 1 }, { crumbly
= 3 }, { crumbly
= 3 } } )
515 minetest
.register_craft({
517 recipe
= "pedology:turf_fibric_0",
520 minetest
.register_craft({
522 recipe
= "pedology:turf_hemic_0",
525 minetest
.register_craft({
527 recipe
= "pedology:turf_sapric_0",
531 minetest
.register_craft({
533 recipe
= "pedology:lump_turf_fibric_0",
536 minetest
.register_craft({
538 recipe
= "pedology:lump_turf_hemic_0",
541 minetest
.register_craft({
543 recipe
= "pedology:lump_turf_sapric_0",
551 pedology
.maxwet
.clay
= 5
552 pedology
.maxwet
.silt_fine
= 5
553 pedology
.maxwet
.silt_medium
= 4
554 pedology
.maxwet
.silt_coarse
= 3
555 pedology
.maxwet
.sand_fine
= 2
556 pedology
.maxwet
.sand_medium
= 1
557 pedology
.maxwet
.sand_coarse
= 0
558 pedology
.maxwet
.gravel_fine
= 1
559 pedology
.maxwet
.gravel_medium
= 2
560 pedology
.maxwet
.gravel_coarse
= 2
562 pedology
.maxwet
.turf_fibric
= 2
563 pedology
.maxwet
.turf_hemic
= 2
564 pedology
.maxwet
.turf_sapric
= 2
566 --[[ “API” functions ]]
567 --[[ Replace the node at <pos> with a node with a “drier” version of it, if available ]]
568 function pedology
.dry(pos
)
569 local node
= minetest
.get_node(pos
)
570 local wet
= minetest
.get_item_group(node
.name
, "wet")
571 local dried
= tostring(wet
- 1)
575 local newbasename
= string.sub(node
.name
,1,#node
.name
-1)
576 newbasename
= newbasename
.. dried
577 minetest
.set_node(pos
, {name
=newbasename
, param1
=0, param2
=0})
580 --[[ Replace the node at <pos> with a “wetter” version of it, if available ]]
581 function pedology
.wetten(pos
)
582 local node
= minetest
.get_node(pos
)
583 local wet
= minetest
.get_item_group(node
.name
, "wet")
584 local cutbasename
= string.sub(node
.name
,10,#node
.name
-2)
585 if pedology
.maxwet
[cutbasename
] == nil then
587 elseif wet
> pedology
.maxwet
[cutbasename
] then
591 local newbasename
= string.sub(node
.name
,1,#node
.name
-1) .. tostring(wet
+1)
592 minetest
.set_node(pos
, {name
=newbasename
, param1
=0, param2
=0})
595 --[[ register ABMs ]]
596 minetest
.register_abm({
597 nodenames
= {"group:sun_dry"},
601 action
= pedology
.sun_dry
,
604 minetest
.register_abm({
605 nodenames
= {"group:sucky"},
606 neighbors
= {"group:water"},
609 action
= pedology
.suck
,
612 minetest
.register_abm({
613 nodenames
= {"group:melting_point"},
614 neighbors
= {"group:hot"},
617 action
= function(pos
,node
,...)
618 minetest
.set_node(pos
,node
)