Skip to content

Commit

Permalink
make grass and flowers drop when the node under them are dug
Browse files Browse the repository at this point in the history
  • Loading branch information
wsor4035 committed Jul 27, 2024
1 parent f868f8f commit 2ad7061
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions mods/fl_plantlife/flowers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ for _, name in ipairs(dir) do
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -0.45, 0.5}
},
groups = {oddly_breakable_by_hand = 3, plant = 1, flower = 1}
groups = {oddly_breakable_by_hand = 3, plant = 1, flower = 1, attached_node = 1}
})
elseif string.find(name, "farlands_flower") then
local _, i = string.find(name, "farlands_flower_")
Expand All @@ -47,7 +47,7 @@ for _, name in ipairs(dir) do
fixed = {-0.2, -0.5, -0.2, 0.2, 0, 0.2}
},
_dungeon_loot = {chance = math.random(0, 0.9), count = {4, 22}},
groups = {oddly_breakable_by_hand = 3, plant = 1, flower = 1, potable = 1}
groups = {oddly_breakable_by_hand = 3, plant = 1, flower = 1, potable = 1, attached_node = 1}
})
table.insert(fl_plantlife.decoration_flowers, "fl_plantlife:" .. fname)
end
Expand Down
6 changes: 3 additions & 3 deletions mods/fl_plantlife/grass.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
local function reg_grass(name)
local desc = string.split(name, "_")
local groups = {dig_generic = 4, plant = 1, not_in_creative_inventory = 1}
local groups = {dig_generic = 4, plant = 1, not_in_creative_inventory = 1, attached_node=1}
for i=1, 5 do
minetest.register_node("fl_plantlife:" .. name .. "_" .. i, {
description = table.concat(desc, " "),
Expand All @@ -18,13 +18,13 @@ local function reg_grass(name)
},
walkable = false,
buildable_to = true,
frop = "fl_plantlife:" .. name .. "_5",
drop = "fl_plantlife:" .. name .. "_5",
groups = groups,
})
end
minetest.override_item("fl_plantlife:" .. name .. "_5", {
inventory_image = "[combine:16x16:0,4=farlands_" .. name .. "_plant.png",
groups = {dig_generic = 4, plant = 1, not_in_creative_inventory = 0}
groups = {dig_generic = 4, plant = 1, attached_node=1, not_in_creative_inventory = 0}
})
end

Expand Down

0 comments on commit 2ad7061

Please sign in to comment.