2018-11-02 21:20:51 -04:00
|
|
|
-- LUALOCALS < ---------------------------------------------------------
|
2019-08-31 09:26:53 -04:00
|
|
|
local minetest, nodecore
|
|
|
|
= minetest, nodecore
|
2018-11-02 21:20:51 -04:00
|
|
|
-- LUALOCALS > ---------------------------------------------------------
|
|
|
|
|
2018-11-02 00:08:42 -04:00
|
|
|
local modname = minetest.get_current_modname()
|
|
|
|
|
|
|
|
minetest.register_node(modname .. ":root", {
|
2019-03-14 21:58:30 -04:00
|
|
|
description = "Stump",
|
2018-11-02 00:08:42 -04:00
|
|
|
tiles = {
|
|
|
|
modname .. "_tree_top.png",
|
|
|
|
"nc_terrain_dirt.png",
|
|
|
|
"nc_terrain_dirt.png^" .. modname .. "_roots.png"
|
|
|
|
},
|
2019-09-04 19:09:42 -04:00
|
|
|
silktouch = false,
|
2019-01-06 13:04:07 -05:00
|
|
|
groups = {
|
2019-01-17 00:01:00 -05:00
|
|
|
flammable = 50,
|
2019-02-24 16:36:53 -05:00
|
|
|
fire_fuel = 4,
|
2020-03-29 08:13:41 -04:00
|
|
|
choppy = 4,
|
|
|
|
scaling_time = 80
|
2019-02-24 16:36:53 -05:00
|
|
|
},
|
2019-09-14 15:34:27 -04:00
|
|
|
drop = "nc_tree:stick 8",
|
2019-03-13 23:51:59 -04:00
|
|
|
sounds = nodecore.sounds("nc_tree_woody")
|
2018-11-02 00:08:42 -04:00
|
|
|
})
|
|
|
|
|
2019-10-12 11:41:07 -04:00
|
|
|
minetest.register_node(modname .. ":log", {
|
|
|
|
description = "Log",
|
|
|
|
tiles = {
|
|
|
|
modname .. "_tree_top.png",
|
|
|
|
modname .. "_tree_top.png",
|
|
|
|
modname .. "_tree_side.png"
|
|
|
|
},
|
|
|
|
groups = {
|
|
|
|
choppy = 2,
|
|
|
|
flammable = 8,
|
|
|
|
fire_fuel = 6,
|
2020-03-29 08:13:41 -04:00
|
|
|
log = 1,
|
|
|
|
scaling_time = 75
|
2019-10-12 11:41:07 -04:00
|
|
|
},
|
|
|
|
sounds = nodecore.sounds("nc_tree_woody"),
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
on_place = minetest.rotate_node
|
|
|
|
})
|
|
|
|
|
2018-11-02 00:08:42 -04:00
|
|
|
minetest.register_node(modname .. ":tree", {
|
2019-03-14 21:59:56 -04:00
|
|
|
description = "Tree Trunk",
|
2018-11-02 00:08:42 -04:00
|
|
|
tiles = {
|
|
|
|
modname .. "_tree_top.png",
|
|
|
|
modname .. "_tree_top.png",
|
|
|
|
modname .. "_tree_side.png"
|
2019-01-04 20:36:46 -05:00
|
|
|
},
|
|
|
|
groups = {
|
2019-01-06 13:04:07 -05:00
|
|
|
choppy = 2,
|
2019-03-31 21:38:26 -04:00
|
|
|
flammable = 8,
|
2019-10-12 11:41:07 -04:00
|
|
|
fire_fuel = 6,
|
|
|
|
log = 1,
|
2020-03-29 08:13:41 -04:00
|
|
|
falling_node = 1,
|
|
|
|
scaling_time = 80
|
2019-03-13 23:51:59 -04:00
|
|
|
},
|
2020-01-05 15:13:01 -05:00
|
|
|
crush_damage = 1,
|
2019-10-12 11:41:07 -04:00
|
|
|
sounds = nodecore.sounds("nc_tree_woody"),
|
|
|
|
drop = modname .. ":log"
|
2018-11-02 00:08:42 -04:00
|
|
|
})
|
|
|
|
|
2020-01-09 23:01:03 -05:00
|
|
|
nodecore.register_aism({
|
2020-06-17 07:09:20 -04:00
|
|
|
label = "tree trunk convert",
|
2020-01-09 23:01:03 -05:00
|
|
|
interval = 1,
|
|
|
|
chance = 1,
|
|
|
|
itemnames = {modname .. ":tree"},
|
|
|
|
action = function(stack)
|
|
|
|
stack:set_name(modname .. ":log")
|
|
|
|
return stack
|
|
|
|
end
|
|
|
|
})
|
|
|
|
|
2018-11-02 00:50:34 -04:00
|
|
|
minetest.register_node(modname .. ":leaves", {
|
|
|
|
description = "Leaves",
|
|
|
|
drawtype = "allfaces_optional",
|
|
|
|
paramtype = "light",
|
2019-12-01 11:08:12 -05:00
|
|
|
tiles = {modname .. "_leaves.png"},
|
2019-03-31 00:05:27 -04:00
|
|
|
waving = 1,
|
2020-01-18 09:57:39 -05:00
|
|
|
air_pass = true,
|
2019-01-17 00:01:00 -05:00
|
|
|
groups = {
|
2020-01-17 23:41:41 -05:00
|
|
|
canopy = 1,
|
2019-01-24 22:08:05 -05:00
|
|
|
snappy = 1,
|
2019-01-17 00:01:00 -05:00
|
|
|
flammable = 3,
|
2019-02-23 13:14:09 -05:00
|
|
|
fire_fuel = 2,
|
2020-03-29 08:13:41 -04:00
|
|
|
green = 3,
|
2021-02-28 16:45:02 -05:00
|
|
|
scaling_time = 90,
|
|
|
|
leaf_decay = 1
|
2019-01-17 00:01:00 -05:00
|
|
|
},
|
2018-11-02 18:47:44 -04:00
|
|
|
alternate_loose = {
|
2019-12-01 11:08:12 -05:00
|
|
|
tiles = {modname .. "_leaves_dry.png"},
|
2018-11-02 18:47:44 -04:00
|
|
|
walkable = false,
|
|
|
|
groups = {
|
2020-01-17 23:41:41 -05:00
|
|
|
canopy = 0,
|
|
|
|
leafy = 1,
|
2019-01-06 13:04:07 -05:00
|
|
|
flammable = 1,
|
2019-02-23 13:14:09 -05:00
|
|
|
falling_repose = 1,
|
2019-10-01 18:56:58 -04:00
|
|
|
green = 1,
|
2021-02-28 16:45:02 -05:00
|
|
|
stack_as_node = 1,
|
|
|
|
leaf_decay = 0
|
2018-11-02 18:47:44 -04:00
|
|
|
}
|
2018-11-02 22:55:14 -04:00
|
|
|
},
|
|
|
|
alternate_solid = {
|
2019-01-05 23:11:38 -05:00
|
|
|
after_dig_node = function(...)
|
|
|
|
return nodecore.leaf_decay(...)
|
2019-03-10 00:23:54 -05:00
|
|
|
end,
|
|
|
|
node_dig_prediction = "air"
|
2019-03-13 23:51:59 -04:00
|
|
|
},
|
2019-12-18 19:25:17 -05:00
|
|
|
no_repack = true,
|
2019-03-16 11:23:37 -04:00
|
|
|
sounds = nodecore.sounds("nc_terrain_swishy")
|
2018-11-02 22:55:14 -04:00
|
|
|
})
|
2019-08-31 09:26:53 -04:00
|
|
|
nodecore.register_leaf_drops(function(_, _, list)
|
2019-02-01 22:17:06 -05:00
|
|
|
list[#list + 1] = {name = modname .. ":leaves_loose", prob = 0.5}
|
|
|
|
list[#list + 1] = {name = "air"}
|
2018-11-03 11:26:15 -04:00
|
|
|
end)
|