nodecore-skyblock/nc_sky_inject/init.lua

46 lines
1.1 KiB
Lua
Raw Normal View History

2019-10-23 03:57:37 +02:00
-- LUALOCALS < ---------------------------------------------------------
2019-12-05 06:01:18 +01:00
local nodecore
= nodecore
2019-10-23 03:57:37 +02:00
-- LUALOCALS > ---------------------------------------------------------
2019-12-05 06:01:18 +01:00
local ntgr = nodecore.tree_growth_rate
2019-10-23 03:57:37 +02:00
2019-12-05 06:01:18 +01:00
function nodecore.tree_growth_rate(pos)
return ntgr(pos)*10
end
nodecore.register_craft({
label = "melt cobble to lava",
action = "cook",
touchgroups = {flame = 4},
duration = 30,
cookfx = true,
nodes = {
{
match = "nc_terrain:cobble",
replace = "nc_terrain:lava_source"
}
}
})
nodecore.register_cook_abm({nodenames = {"nc_terrain:cobble"}, neighbors = {"group:flame"}})
nodecore.register_limited_abm({
label = "aggregate insta-cooking",
interval = 1,
chance = 1,
nodenames = {"nc_concrete:wet_source"},
neighbors = {"group:lava"},
action = function(pos,node)
local nnode
if math.random() > (1/10) then
nnode = {name = "nc_terrain:hard_stone_1"}
else
local t = {"nc_crystal:ore","nc_lux:stone"}
nnode = {name=t[math.random(1,#t)]}
end
minetest.set_node(pos,nnode)
nodecore.node_sound(pos,"place")
end
})