I agree with VanessaE
Jeija, I just noticed (six months later ;-) ) that all "strengths" of trampolines are in the creative inventory. Can you reduce this to just one of those? Seems a little redundant since you can punch one to set its strength.
Also, I'd like to suggest that on dig/pick-up, the returned item should be the lowest-strength one, to avoid inventory clutter.
So I modified the code myself to achieve this.
The original code section
Code: Select all
for i = 1, 6 do
minetest.register_node("jumping:trampoline"..i, {
description = "Trampoline",
drawtype = "nodebox",
node_box = trampolinebox,
selection_box = trampolinebox,
paramtype = "light",
on_punch = trampoline_punch,
tiles = {
"jumping_trampoline_top.png",
"jumping_trampoline_bottom.png",
"jumping_trampoline_sides.png^jumping_trampoline_sides_overlay"..i..".png"
},
groups = {dig_immediate=2, bouncy=20+i*20, fall_damage_add_percent=-70},
})
end
Can now be replaced by
Code: Select all
local groups_value = function(i)
if i == 1 then
return {dig_immediate=2, bouncy=20+20, fall_damage_add_percent=-70}
else
return {dig_immediate=2, bouncy=20+i*20, fall_damage_add_percent=-70, not_in_creative_inventory = 1}
end
end
for i = 1, 6 do
minetest.register_node("jumping:trampoline"..i, {
description = "Trampoline",
drawtype = "nodebox",
node_box = trampolinebox,
selection_box = trampolinebox,
paramtype = "light",
on_punch = trampoline_punch,
tiles = {
"jumping_trampoline_top.png",
"jumping_trampoline_bottom.png",
"jumping_trampoline_sides.png^jumping_trampoline_sides_overlay"..i..".png"
},
groups = groups_value(i),
})
end
I hope you could quickly add this, and if he doesn't, to the rest of you.
Feel free to do small swap in your init.lua and add this, This code no longer belongs to me.
Here is the whole file if you feel like directly changing them out.