add grass, flowers, bonemeal
@ -69,6 +69,6 @@ for i = 1, 4 do
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
drop = drop,
|
drop = drop,
|
||||||
groups = {oddly_breakable_by_hand = 3, not_in_creative_inventory = 1},
|
groups = {oddly_breakable_by_hand = 3, not_in_creative_inventory = 1, plant =1},
|
||||||
})
|
})
|
||||||
end
|
end
|
@ -69,6 +69,6 @@ for i = 1, 4 do
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
drop = drop,
|
drop = drop,
|
||||||
groups = {oddly_breakable_by_hand = 3, not_in_creative_inventory = 1},
|
groups = {oddly_breakable_by_hand = 3, not_in_creative_inventory = 1, plant = 1},
|
||||||
})
|
})
|
||||||
end
|
end
|
26
mods/fl_bones/init.lua
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
minetest.register_craftitem("fl_bones:bonemeal", {
|
||||||
|
description = "bonemeal",
|
||||||
|
inventory_image = "farlands_bonemeal.png",
|
||||||
|
on_use = function(itemstack, user, pointed_thing)
|
||||||
|
if pointed_thing.type ~= "node" then return end
|
||||||
|
local node = minetest.get_node_or_nil(pointed_thing.under)
|
||||||
|
if not node then return end
|
||||||
|
if minetest.get_item_group(node.name, "plant") ~= 1 then return end
|
||||||
|
|
||||||
|
local node_def = minetest.registered_nodes[node.name]
|
||||||
|
if node_def._on_bonemeal then
|
||||||
|
node_def._on_bonemeal(pointed_thing.under, user)
|
||||||
|
itemstack:take_item()
|
||||||
|
return itemstack
|
||||||
|
end
|
||||||
|
if minetest.get_node_timer(pointed_thing.under):is_started() then
|
||||||
|
if math.random(10) > 8 then
|
||||||
|
minetest.get_node_timer(pointed_thing.under):stop()
|
||||||
|
node_def.on_timer(pointed_thing.under, 0)
|
||||||
|
end
|
||||||
|
itemstack:take_item()
|
||||||
|
return itemstack
|
||||||
|
end
|
||||||
|
return
|
||||||
|
end
|
||||||
|
})
|
BIN
mods/fl_bones/textures/farlands_bonemeal.png
Normal file
After Width: | Height: | Size: 563 B |
51
mods/fl_plantlife/flowers.lua
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
local modpath = minetest.get_modpath("fl_plantlife")
|
||||||
|
local dir = minetest.get_dir_list(modpath .. "/textures", false)
|
||||||
|
|
||||||
|
for _, name in ipairs(dir) do
|
||||||
|
if string.find(name, "ground") then
|
||||||
|
local _, i = string.find(name, "farlands_flower_")
|
||||||
|
local hold = string.sub(name, i+1, -1)
|
||||||
|
local j, _ = string.find(hold, ".png")
|
||||||
|
local fname = string.sub(hold, 1, j-1)
|
||||||
|
local split = string.split(fname, "_")
|
||||||
|
minetest.register_node("fl_plantlife:" .. fname, {
|
||||||
|
description = table.concat(split, " "),
|
||||||
|
drawtype = "nodebox",
|
||||||
|
paramtype = "light",
|
||||||
|
tiles = {name, name},
|
||||||
|
inventory_image = name,
|
||||||
|
wield_image = name,
|
||||||
|
walkable = false,
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {-0.5, -0.48, -0.5, 0.5, -0.47, 0.5}
|
||||||
|
},
|
||||||
|
selection_box = {
|
||||||
|
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}
|
||||||
|
})
|
||||||
|
elseif string.find(name, "farlands_flower") then
|
||||||
|
local _, i = string.find(name, "farlands_flower_")
|
||||||
|
local hold = string.sub(name, i+1, -1)
|
||||||
|
local j, _ = string.find(hold, ".png")
|
||||||
|
local fname = string.sub(hold, 1, j-1)
|
||||||
|
local split = string.split(fname, "_")
|
||||||
|
minetest.register_node("fl_plantlife:" .. fname, {
|
||||||
|
description = table.concat(split, " "),
|
||||||
|
drawtype = "plantlike",
|
||||||
|
paramtype = "light",
|
||||||
|
inventory_image = name,
|
||||||
|
walkable = false,
|
||||||
|
tiles = {name},
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {-0.2, -0.5, -0.2, 0.2, 0, 0.2}
|
||||||
|
},
|
||||||
|
groups = {oddly_breakable_by_hand = 3, plant = 1, flower = 1}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
--foxglove_pink/purple
|
31
mods/fl_plantlife/grass.lua
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
local function reg_grass(name)
|
||||||
|
local desc = string.split(name, "_")
|
||||||
|
local groups = {oddly_breakable_by_hand = 3, plant = 1, not_in_creative_inventory = 1}
|
||||||
|
for i=1, 5 do
|
||||||
|
minetest.register_node("fl_plantlife:" .. name .. "_" .. i, {
|
||||||
|
description = table.concat(desc, " "),
|
||||||
|
drawtype = "plantlike",
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "degrotate",
|
||||||
|
tiles = {"[combine:16x16:0," .. 10 - 2*i .. "=farlands_" .. name .. "_plant.png"},
|
||||||
|
floodable = true,
|
||||||
|
on_flood = function(pos, oldnode, newnode)
|
||||||
|
minetest.dig_node(pos)
|
||||||
|
end,
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {-0.5,-0.5,-0.5,0.5,-0.45,0.5},
|
||||||
|
},
|
||||||
|
walkable = false,
|
||||||
|
frop = "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 = {oddly_breakable_by_hand = 3, plant = 1, not_in_creative_inventory = 0}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
reg_grass("grass")
|
||||||
|
reg_grass("savannah_grass")
|
4
mods/fl_plantlife/init.lua
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
local modpath = minetest.get_modpath("fl_plantlife")
|
||||||
|
|
||||||
|
dofile(modpath .. "/grass.lua")
|
||||||
|
dofile(modpath .. "/flowers.lua")
|
After Width: | Height: | Size: 274 B |
BIN
mods/fl_plantlife/textures/farlands_flower_dandelion_white.png
Normal file
After Width: | Height: | Size: 222 B |
BIN
mods/fl_plantlife/textures/farlands_flower_dandelion_yellow.png
Normal file
After Width: | Height: | Size: 313 B |
BIN
mods/fl_plantlife/textures/farlands_flower_flame_lily.png
Normal file
After Width: | Height: | Size: 861 B |
BIN
mods/fl_plantlife/textures/farlands_flower_frozen_rose.png
Normal file
After Width: | Height: | Size: 418 B |
BIN
mods/fl_plantlife/textures/farlands_flower_geranium.png
Normal file
After Width: | Height: | Size: 457 B |
BIN
mods/fl_plantlife/textures/farlands_flower_ground_waterlily.png
Normal file
After Width: | Height: | Size: 479 B |
BIN
mods/fl_plantlife/textures/farlands_flower_lantana.png
Normal file
After Width: | Height: | Size: 459 B |
BIN
mods/fl_plantlife/textures/farlands_flower_lavender_flower.png
Normal file
After Width: | Height: | Size: 714 B |
BIN
mods/fl_plantlife/textures/farlands_flower_lobelia.png
Normal file
After Width: | Height: | Size: 388 B |
BIN
mods/fl_plantlife/textures/farlands_flower_mushroom_brown.png
Normal file
After Width: | Height: | Size: 438 B |
BIN
mods/fl_plantlife/textures/farlands_flower_mushroom_red.png
Normal file
After Width: | Height: | Size: 351 B |
BIN
mods/fl_plantlife/textures/farlands_flower_oxeye_daisy.png
Normal file
After Width: | Height: | Size: 293 B |
BIN
mods/fl_plantlife/textures/farlands_flower_pansy_blue.png
Normal file
After Width: | Height: | Size: 374 B |
BIN
mods/fl_plantlife/textures/farlands_flower_pansy_purple.png
Normal file
After Width: | Height: | Size: 343 B |
BIN
mods/fl_plantlife/textures/farlands_flower_petunia_blue.png
Normal file
After Width: | Height: | Size: 360 B |
BIN
mods/fl_plantlife/textures/farlands_flower_petunia_pink.png
Normal file
After Width: | Height: | Size: 356 B |
BIN
mods/fl_plantlife/textures/farlands_flower_petunia_white.png
Normal file
After Width: | Height: | Size: 351 B |
After Width: | Height: | Size: 267 B |
BIN
mods/fl_plantlife/textures/farlands_flower_purple_allium.png
Normal file
After Width: | Height: | Size: 403 B |
BIN
mods/fl_plantlife/textures/farlands_flower_red_ground_flower.png
Normal file
After Width: | Height: | Size: 429 B |
BIN
mods/fl_plantlife/textures/farlands_flower_rose.png
Normal file
After Width: | Height: | Size: 373 B |
BIN
mods/fl_plantlife/textures/farlands_flower_tulip.png
Normal file
After Width: | Height: | Size: 363 B |
BIN
mods/fl_plantlife/textures/farlands_flower_viola.png
Normal file
After Width: | Height: | Size: 590 B |
BIN
mods/fl_plantlife/textures/farlands_grass_plant.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
mods/fl_plantlife/textures/farlands_no_flower_foxglove_pink.png
Normal file
After Width: | Height: | Size: 481 B |
After Width: | Height: | Size: 485 B |
BIN
mods/fl_plantlife/textures/farlands_savannah_grass_plant.png
Normal file
After Width: | Height: | Size: 850 B |
@ -8,7 +8,7 @@ local function register_sapling(name, offset)
|
|||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
walkable = true,
|
walkable = true,
|
||||||
tiles = {"farlands_" .. name .. "_sapling.png"},
|
tiles = {"farlands_" .. name .. "_sapling.png"},
|
||||||
groups = {oddly_breakable_by_hand = 3},
|
groups = {oddly_breakable_by_hand = 3, plant = 1},
|
||||||
on_timer = function(pos)
|
on_timer = function(pos)
|
||||||
minetest.remove_node(pos)
|
minetest.remove_node(pos)
|
||||||
minetest.place_schematic(
|
minetest.place_schematic(
|
||||||
|