Advertisement
Icalasari

What is going wrong what

Aug 25th, 2022
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.34 KB | None | 0 0
  1.  
  2.     local g = def.vinegrow
  3.     minetest.register_node("mindeca:plant_vine_"..name..g, {
  4.         description = def.growdesc.." "..g.."\n\nDoing some decoration?\n\nMindeca",
  5.         drawtype = "plantlike",
  6.         tiles = {
  7.             "mindeca_item_vine_"..name..g..".png"
  8.             },
  9.         inventory_image = "mindeca_item_flower_"..name..g..".png",
  10.         paramtype = "light",
  11.         sunlight_propagates = true,
  12.         walkable = false,
  13.         is_ground_content = false,
  14.         selection_box = {
  15.             type = "fixed",
  16.             fixed = {-3/16, -8/16, -3/16, 3/16, 4/16, 3/16}
  17.         },
  18.         groups = {dig_immediate = 3},
  19.         sounds = default.node_sound_leaves_defaults(),
  20.  
  21.         on_construct = function(pos)
  22.             if farmod then
  23.                 local til = minetest.get_node({x = pos.x, y = pos.y-1, z = pos.z})
  24.                 if minetest.get_item_group(til.name, "soil") < 3 then
  25.                     minetest.get_node_timer(pos):start(math.random(5, 5))
  26.                 else
  27.                     minetest.get_node_timer(pos):start(math.random(50, 50))
  28.                 end
  29.             else
  30.                 minetest.get_node_timer(pos):start(math.random(50, 50))
  31.             end
  32.         on_timer = function(pos, elapsed)
  33.             if not mindeca.can_grow_fullsun(pos) then
  34.                 minetest.get_node_timer(pos):start(math.random(5, 5))
  35.             return
  36.             elseif g == 1 then
  37.                 minetest.set_node(pos, {name = "mindeca:plant_vine_"..name})
  38.             else
  39.                 g = math.min(g - 1, 20)
  40.                 minetest.set_node(pos, {name = "mindeca:plant_vine_"..name..g})
  41.             end
  42.         end
  43.     })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement