From 2993ff2bd0befd5552c362a03ce998a482aca236 Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Wed, 2 Oct 2024 09:02:23 +0100 Subject: [PATCH] use place_param2 on fruits --- fences.lua | 2 +- food.lua | 35 +++++++---------------------------- onion.lua | 4 +--- strawberry.lua | 4 +--- 4 files changed, 10 insertions(+), 35 deletions(-) diff --git a/fences.lua b/fences.lua index 919d499..b6a6e78 100644 --- a/fences.lua +++ b/fences.lua @@ -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 diff --git a/food.lua b/food.lua index d916dcd..c7279fb 100644 --- a/food.lua +++ b/food.lua @@ -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) diff --git a/onion.lua b/onion.lua index ac2fad2..a7f327f 100644 --- a/onion.lua +++ b/onion.lua @@ -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] diff --git a/strawberry.lua b/strawberry.lua index c7c6790..523c26a 100644 --- a/strawberry.lua +++ b/strawberry.lua @@ -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]