]> git.lizzy.rs Git - skycraft.git/blob - src/onload/lava_cooling.lua
Daily Enhancements
[skycraft.git] / src / onload / lava_cooling.lua
1 skycraft.ores = skycraft.random:new()
2 skycraft.ores:add_choice("mcl_core:cobble", 1000)
3 skycraft.ores:add_choice("mcl_core:stone_with_coal", 30)
4 skycraft.ores:add_choice("mcl_core:stone_with_iron", 25)
5 skycraft.ores:add_choice("mcl_core:stone_with_gold", 10)
6 skycraft.ores:add_choice("mcl_core:stone_with_lapis", 10)
7 skycraft.ores:add_choice("mcl_core:stone_with_redstone", 10)
8 skycraft.ores:add_choice("mcl_core:stone_with_diamond", 5)
9 skycraft.ores:add_choice("mcl_core:stone_with_emerald", 1)
10 skycraft.ores:calc_csum()
11
12 for k, v in pairs(minetest.registered_abms) do
13         if v.label == "Lava cooling" then
14                 local old_func = v.action
15                 v.action = function(pos, node, active_object_count, active_object_count_wider)
16                         old_func(pos, node, active_object_count, active_object_count_wider)
17                         if minetest.get_node(pos).name == "mcl_core:cobble" then
18                                 minetest.set_node(pos, {name = skycraft.ores:choose()})
19                         end
20                 end
21                 break
22         end
23 end