use place_param2 on fruits

This commit is contained in:
tenplus1 2024-10-02 09:02:23 +01:00
parent fefc7d27ff
commit 2993ff2bd0
4 changed files with 10 additions and 35 deletions

View File

@ -46,7 +46,7 @@ local function add_fence(name, node, desc, texture)
default.register_mesepost("ethereal:mese_post_" .. name, {
description = S(desc .. " Mese Post Light"),
texture = texture .. ".png",
material = "ethereal:" .. node,
material = "ethereal:" .. node
})
end
end

View File

@ -29,10 +29,7 @@ minetest.register_node("ethereal:banana", {
drop = "ethereal:banana",
on_use = minetest.item_eat(2),
sounds = default.node_sound_leaves_defaults(),
after_place_node = function(pos, placer)
minetest.set_node(pos, {name = "ethereal:banana", param2 = 1})
end
place_param2 = 1
})
ethereal.add_eatable("ethereal:banana", 2)
@ -57,10 +54,7 @@ minetest.register_node("ethereal:banana_bunch", {
drop = "ethereal:banana_bunch",
on_use = minetest.item_eat(6),
sounds = default.node_sound_leaves_defaults(),
after_place_node = function(pos, placer)
minetest.set_node(pos, {name = "ethereal:banana_bunch", param2 = 1})
end
place_param2 = 1
})
ethereal.add_eatable("ethereal:banana_bunch", 6)
@ -115,10 +109,7 @@ minetest.register_node("ethereal:orange", {
drop = "ethereal:orange",
on_use = minetest.item_eat(4),
sounds = default.node_sound_leaves_defaults(),
after_place_node = function(pos, placer)
minetest.set_node(pos, {name = "ethereal:orange", param2 = 1})
end
place_param2 = 1
})
ethereal.add_eatable("ethereal:orange", 4)
@ -176,10 +167,7 @@ minetest.register_node("ethereal:coconut", {
},
drop = cdrp,
sounds = default.node_sound_wood_defaults(),
after_place_node = function(pos, placer)
minetest.set_node(pos, {name = "ethereal:coconut", param2 = 1})
end
place_param2 = 1
})
-- Coconut Slice
@ -234,6 +222,7 @@ minetest.register_node("ethereal:golden_apple", {
},
drop = "ethereal:golden_apple",
sounds = default.node_sound_leaves_defaults(),
place_param2 = 1,
on_use = function(itemstack, user, pointed_thing)
@ -243,10 +232,6 @@ minetest.register_node("ethereal:golden_apple", {
return minetest.do_item_eat(2, nil, itemstack, user, pointed_thing)
end
end,
after_place_node = function(pos, placer, itemstack)
minetest.set_node(pos, {name = "ethereal:golden_apple", param2 = 1})
end
})
@ -350,10 +335,7 @@ minetest.register_node("ethereal:lemon", {
drop = "ethereal:lemon",
on_use = minetest.item_eat(3),
sounds = default.node_sound_leaves_defaults(),
after_place_node = function(pos, placer)
minetest.set_node(pos, {name = "ethereal:lemon", param2 = 1})
end
place_param2 = 1
})
ethereal.add_eatable("ethereal:lemon", 3)
@ -430,10 +412,7 @@ minetest.register_node("ethereal:olive", {
groups = {fleshy = 3, dig_immediate = 3, leafdecay = 3, leafdecay_drop = 1},
on_use = minetest.item_eat(1),
sounds = default.node_sound_leaves_defaults(),
after_place_node = function(pos, placer)
minetest.set_node(pos, {name = "ethereal:olive", param2 = 1})
end
place_param2 = 1
})
ethereal.add_eatable("ethereal:olive", 1)

View File

@ -114,9 +114,7 @@ else
pos.y = pos.y + 1
-- do we have enough light?
local light = minetest.get_node_light(pos) or 0
if light < 13 then return end
local light = minetest.get_node_light(pos) or 0 ; if light < 13 then return end
-- grow to next stage
local num = node.name:split("_")[2]

View File

@ -126,9 +126,7 @@ minetest.register_abm({
pos.y = pos.y + 1
-- do we have enough light?
local light = minetest.get_node_light(pos) or 0
if light < 13 then return end
local light = minetest.get_node_light(pos) or 0 ; if light < 13 then return end
-- grow to next stage
local num = node.name:split("_")[2]