Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Allow overriding default.after_place_leaves and default.grow_sapling
  • Loading branch information
SmallJoker authored and paramat committed Jun 7, 2019
1 parent ca7c131 commit 0f771a2
Showing 1 changed file with 29 additions and 19 deletions.
48 changes: 29 additions & 19 deletions mods/default/nodes.lua
Expand Up @@ -225,6 +225,16 @@ default:cloud
--]]
-- Required wrapper to allow customization of default.after_place_leaves
local function after_place_leaves(...)
return default.after_place_leaves(...)
end
-- Required wrapper to allow customization of default.grow_sapling
local function grow_sapling(...)
return default.grow_sapling(...)
end
--
-- Stone
--
Expand Down Expand Up @@ -671,7 +681,7 @@ minetest.register_node("default:sapling", {
paramtype = "light",
sunlight_propagates = true,
walkable = false,
on_timer = default.grow_sapling,
on_timer = grow_sapling,
selection_box = {
type = "fixed",
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
Expand Down Expand Up @@ -724,7 +734,7 @@ minetest.register_node("default:leaves", {
},
sounds = default.node_sound_leaves_defaults(),
after_place_node = default.after_place_leaves,
after_place_node = after_place_leaves,
})
minetest.register_node("default:apple", {
Expand Down Expand Up @@ -820,7 +830,7 @@ minetest.register_node("default:jungleleaves", {
},
sounds = default.node_sound_leaves_defaults(),
after_place_node = default.after_place_leaves,
after_place_node = after_place_leaves,
})
minetest.register_node("default:junglesapling", {
Expand All @@ -832,7 +842,7 @@ minetest.register_node("default:junglesapling", {
paramtype = "light",
sunlight_propagates = true,
walkable = false,
on_timer = default.grow_sapling,
on_timer = grow_sapling,
selection_box = {
type = "fixed",
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
Expand Down Expand Up @@ -868,7 +878,7 @@ minetest.register_node("default:emergent_jungle_sapling", {
paramtype = "light",
sunlight_propagates = true,
walkable = false,
on_timer = default.grow_sapling,
on_timer = grow_sapling,
selection_box = {
type = "fixed",
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
Expand Down Expand Up @@ -934,7 +944,7 @@ minetest.register_node("default:pine_needles",{
},
sounds = default.node_sound_leaves_defaults(),
after_place_node = default.after_place_leaves,
after_place_node = after_place_leaves,
})
minetest.register_node("default:pine_sapling", {
Expand All @@ -946,7 +956,7 @@ minetest.register_node("default:pine_sapling", {
paramtype = "light",
sunlight_propagates = true,
walkable = false,
on_timer = default.grow_sapling,
on_timer = grow_sapling,
selection_box = {
type = "fixed",
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
Expand Down Expand Up @@ -1014,7 +1024,7 @@ minetest.register_node("default:acacia_leaves", {
},
sounds = default.node_sound_leaves_defaults(),
after_place_node = default.after_place_leaves,
after_place_node = after_place_leaves,
})
minetest.register_node("default:acacia_sapling", {
Expand All @@ -1026,7 +1036,7 @@ minetest.register_node("default:acacia_sapling", {
paramtype = "light",
sunlight_propagates = true,
walkable = false,
on_timer = default.grow_sapling,
on_timer = grow_sapling,
selection_box = {
type = "fixed",
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
Expand Down Expand Up @@ -1092,7 +1102,7 @@ minetest.register_node("default:aspen_leaves", {
},
sounds = default.node_sound_leaves_defaults(),
after_place_node = default.after_place_leaves,
after_place_node = after_place_leaves,
})
minetest.register_node("default:aspen_sapling", {
Expand All @@ -1104,7 +1114,7 @@ minetest.register_node("default:aspen_sapling", {
paramtype = "light",
sunlight_propagates = true,
walkable = false,
on_timer = default.grow_sapling,
on_timer = grow_sapling,
selection_box = {
type = "fixed",
fixed = {-3 / 16, -0.5, -3 / 16, 3 / 16, 0.5, 3 / 16}
Expand Down Expand Up @@ -1651,7 +1661,7 @@ minetest.register_node("default:bush_leaves", {
},
sounds = default.node_sound_leaves_defaults(),
after_place_node = default.after_place_leaves,
after_place_node = after_place_leaves,
})
minetest.register_node("default:bush_sapling", {
Expand All @@ -1663,7 +1673,7 @@ minetest.register_node("default:bush_sapling", {
paramtype = "light",
sunlight_propagates = true,
walkable = false,
on_timer = default.grow_sapling,
on_timer = grow_sapling,
selection_box = {
type = "fixed",
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 2 / 16, 4 / 16}
Expand Down Expand Up @@ -1730,7 +1740,7 @@ minetest.register_node("default:blueberry_bush_leaves", {
end
end,
after_place_node = default.after_place_leaves,
after_place_node = after_place_leaves,
})
minetest.register_node("default:blueberry_bush_sapling", {
Expand All @@ -1742,7 +1752,7 @@ minetest.register_node("default:blueberry_bush_sapling", {
paramtype = "light",
sunlight_propagates = true,
walkable = false,
on_timer = default.grow_sapling,
on_timer = grow_sapling,
selection_box = {
type = "fixed",
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 2 / 16, 4 / 16}
Expand Down Expand Up @@ -1801,7 +1811,7 @@ minetest.register_node("default:acacia_bush_leaves", {
},
sounds = default.node_sound_leaves_defaults(),
after_place_node = default.after_place_leaves,
after_place_node = after_place_leaves,
})
minetest.register_node("default:acacia_bush_sapling", {
Expand All @@ -1813,7 +1823,7 @@ minetest.register_node("default:acacia_bush_sapling", {
paramtype = "light",
sunlight_propagates = true,
walkable = false,
on_timer = default.grow_sapling,
on_timer = grow_sapling,
selection_box = {
type = "fixed",
fixed = {-3 / 16, -0.5, -3 / 16, 3 / 16, 2 / 16, 3 / 16}
Expand Down Expand Up @@ -1872,7 +1882,7 @@ minetest.register_node("default:pine_bush_needles", {
},
sounds = default.node_sound_leaves_defaults(),
after_place_node = default.after_place_leaves,
after_place_node = after_place_leaves,
})
minetest.register_node("default:pine_bush_sapling", {
Expand All @@ -1884,7 +1894,7 @@ minetest.register_node("default:pine_bush_sapling", {
paramtype = "light",
sunlight_propagates = true,
walkable = false,
on_timer = default.grow_sapling,
on_timer = grow_sapling,
selection_box = {
type = "fixed",
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 2 / 16, 4 / 16}
Expand Down

0 comments on commit 0f771a2

Please sign in to comment.