Update 'mods/default/nodes.lua'

This commit is contained in:
thunderdog1138 2020-07-15 22:42:59 +00:00
parent 04ccc75db6
commit fadfd43006
1 changed files with 0 additions and 180 deletions

View File

@ -366,186 +366,6 @@ minetest.register_node("default:cave_ice", {
sounds = default.node_sound_glass_defaults(),
})
--
-- Trees
--
minetest.register_node("default:sapling", {
description = S("Jogan Tree Sapling"),
drawtype = "plantlike",
tiles = {"default_sapling.png"},
inventory_image = "default_sapling.png",
wield_image = "default_sapling.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
on_timer = grow_sapling,
selection_box = {
type = "fixed",
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
},
groups = {snappy = 2, dig_immediate = 3, flammable = 2,
attached_node = 1, sapling = 1},
sounds = default.node_sound_leaves_defaults(),
on_construct = function(pos)
minetest.get_node_timer(pos):start(math.random(300, 1500))
end,
on_place = function(itemstack, placer, pointed_thing)
itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
"default:sapling",
-- minp, maxp to be checked, relative to sapling pos
-- minp_relative.y = 1 because sapling pos has been checked
{x = -3, y = 1, z = -3},
{x = 3, y = 6, z = 3},
-- maximum interval of interior volume check
4)
return itemstack
end,
})
minetest.register_node("default:leaves", {
description = S("Jogan Tree Leaves"),
drawtype = "allfaces_optional",
waving = 1,
tiles = {"default_leaves.png"},
special_tiles = {"default_leaves_simple.png"},
paramtype = "light",
is_ground_content = false,
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
drop = {
max_items = 1,
items = {
{
-- player will get sapling with 1/20 chance
items = {"default:sapling"},
rarity = 20,
},
{
-- player will get leaves only if he get no saplings,
-- this is because max_items is 1
items = {"default:leaves"},
}
}
},
sounds = default.node_sound_leaves_defaults(),
after_place_node = after_place_leaves,
})
minetest.register_node("default:joganfruit", {
description = S("Jogan Fruit"),
drawtype = "plantlike",
tiles = {"default_joganfruit.png"},
inventory_image = "default_joganfruit.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
is_ground_content = false,
selection_box = {
type = "fixed",
fixed = {-3 / 16, -7 / 16, -3 / 16, 3 / 16, 4 / 16, 3 / 16}
},
groups = {fleshy = 3, dig_immediate = 3, flammable = 2,
leafdecay = 3, leafdecay_drop = 1, food_apple = 1},
on_use = minetest.item_eat(2),
sounds = default.node_sound_leaves_defaults(),
after_place_node = function(pos, placer, itemstack)
minetest.set_node(pos, {name = "default:joganfruit", param2 = 1})
end,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
if oldnode.param2 == 0 then
minetest.set_node(pos, {name = "default:joganfruit_mark"})
minetest.get_node_timer(pos):start(math.random(300, 1500))
end
end,
})
minetest.register_node("default:joganfruit_mark", {
description = S("Jogan Fruit Marker"),
drawtype = "airlike",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
groups = {not_in_creative_inventory = 1},
on_timer = function(pos, elapsed)
if not minetest.find_node_near(pos, 1, "default:leaves") then
minetest.remove_node(pos)
elseif minetest.get_node_light(pos) < 11 then
minetest.get_node_timer(pos):start(200)
else
minetest.set_node(pos, {name = "default:joganfruit"})
end
end
})
minetest.register_node("default:pine_needles",{
description = S("Pine Needles"),
drawtype = "allfaces_optional",
tiles = {"default_pine_needles.png"},
waving = 1,
paramtype = "light",
is_ground_content = false,
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
drop = {
max_items = 1,
items = {
{items = {"default:pine_sapling"}, rarity = 20},
{items = {"default:pine_needles"}}
}
},
sounds = default.node_sound_leaves_defaults(),
after_place_node = after_place_leaves,
})
minetest.register_node("default:pine_sapling", {
description = S("Pine Tree Sapling"),
drawtype = "plantlike",
tiles = {"default_pine_sapling.png"},
inventory_image = "default_pine_sapling.png",
wield_image = "default_pine_sapling.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
on_timer = grow_sapling,
selection_box = {
type = "fixed",
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
},
groups = {snappy = 2, dig_immediate = 3, flammable = 3,
attached_node = 1, sapling = 1},
sounds = default.node_sound_leaves_defaults(),
on_construct = function(pos)
minetest.get_node_timer(pos):start(math.random(300, 1500))
end,
on_place = function(itemstack, placer, pointed_thing)
itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
"default:pine_sapling",
-- minp, maxp to be checked, relative to sapling pos
-- minp_relative.y = 1 because sapling pos has been checked
{x = -2, y = 1, z = -2},
{x = 2, y = 14, z = 2},
-- maximum interval of interior volume check
4)
return itemstack
end,
})
--
-- Ores
--