1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2025-06-28 06:11:47 +02:00

Updated plantlife_modpack, using meshnodes for pebbles and bushes

This commit is contained in:
LeMagnesium
2015-01-26 22:56:18 +01:00
parent fe5dc3f0a7
commit 55972f1441
333 changed files with 2481 additions and 1594 deletions

View File

@ -1,360 +1,360 @@
-----------------------------------------------------------------------------------------------
-- Dry Plants - Recipes 0.1.0 -- Short Grass -> Dirt
-----------------------------------------------------------------------------------------------
-- by Mossmanikin
-- License (everything): WTFPL
-- Looked at code from: darkage, default, farming, sickle, stairs
-- Dependencies: default, farming
-- Supports: flint, stoneage, sumpf
-----------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------
-- Short Grass
-----------------------------------------------------------------------------------------------
minetest.register_craft({
output = "default:dirt",
recipe = {
{"dryplants:grass_short"},
}
})
-----------------------------------------------------------------------------------------------
-- Cut Grass
-----------------------------------------------------------------------------------------------
-- grass recipes (remove roots)
minetest.register_craft({
output = "dryplants:grass",
recipe = {
{"default:grass_1"},
}
})
minetest.register_craft({
output = "dryplants:grass",
recipe = {
{"default:junglegrass"},
}
})
if minetest.get_modpath("sumpf") ~= nil then
minetest.register_craft({
output = "dryplants:grass",
recipe = {
{"sumpf:gras"},
}
})
end
-----------------------------------------------------------------------------------------------
-- Sickle
-----------------------------------------------------------------------------------------------
minetest.register_craft({
output = "dryplants:sickle",
recipe = {
{"group:stone",""},
{"", "default:stick"},
{"default:stick",""}
}
})
if minetest.get_modpath("flint") ~= nil then
minetest.register_craft({
output = "dryplants:sickle",
recipe = {
{"flint:flintstone",""},
{"", "default:stick"},
{"default:stick",""}
}
})
end
if minetest.get_modpath("stoneage") ~= nil then
minetest.register_craft({
output = "dryplants:sickle",
recipe = {
{"stoneage:silex",""},
{"", "default:stick"},
{"default:stick",""}
}
})
end
-----------------------------------------------------------------------------------------------
-- Hay
-----------------------------------------------------------------------------------------------
--cooking
minetest.register_craft({
type = "cooking",
output = "dryplants:hay",
recipe = "dryplants:grass",
cooktime = 2,
})
minetest.register_craft({
type = "fuel",
recipe = "dryplants:hay",
burntime = 1,
})
-----------------------------------------------------------------------------------------------
-- Wet Reed
-----------------------------------------------------------------------------------------------
minetest.register_craft({ -- papyrus -> wetreed
output = "dryplants:wetreed 2",
recipe = {
{"default:papyrus","default:papyrus"},
{"default:papyrus","default:papyrus"},
}
})
minetest.register_craft({ -- reedmace_sapling -> wetreed
output = "dryplants:wetreed 2",
recipe = {
{"dryplants:reedmace_sapling","dryplants:reedmace_sapling"},
{"dryplants:reedmace_sapling","dryplants:reedmace_sapling"},
}
})
minetest.register_craft({ -- reedmace_top -> wetreed
output = "dryplants:wetreed 2",
recipe = {
{"dryplants:reedmace_top","dryplants:reedmace_top"},
{"dryplants:reedmace_top","dryplants:reedmace_top"},
}
})
minetest.register_craft({ -- reedmace -> wetreed
output = "dryplants:wetreed 2",
recipe = {
{"dryplants:reedmace","dryplants:reedmace"},
{"dryplants:reedmace","dryplants:reedmace"},
}
})
minetest.register_craft({ -- reedmace_bottom -> wetreed
output = "dryplants:wetreed 2",
recipe = {
{"dryplants:reedmace_bottom","dryplants:reedmace_bottom"},
{"dryplants:reedmace_bottom","dryplants:reedmace_bottom"},
}
})
local ReeD = {
{"wetreed"},
{"reed"}
}
for i in pairs(ReeD) do
local reed = "dryplants:"..ReeD[i][1]
local slab = reed.."_slab"
local roof = reed.."_roof"
local corner = roof.."_corner"
local corner_2 = corner.."_2"
-----------------------------------------------------------------------------------------------
-- Block
-----------------------------------------------------------------------------------------------
minetest.register_craft({ -- slab -> block
output = reed,
recipe = {
{slab},
{slab},
}
})
minetest.register_craft({ -- roof -> block
output = reed,
recipe = {
{roof},
{roof},
}
})
minetest.register_craft({ -- corner -> block
type = "shapeless",
output = reed.." 3",
recipe = {corner,corner,corner,corner,corner,corner,corner,corner}, -- 8x
})
minetest.register_craft({ -- corner_2 -> block
type = "shapeless",
output = reed.." 3",
recipe = {corner_2,corner_2,corner_2,corner_2,corner_2,corner_2,corner_2,corner_2}, -- 8x
})
-----------------------------------------------------------------------------------------------
-- Slab
-----------------------------------------------------------------------------------------------
minetest.register_craft({ -- block -> slab
output = slab.." 6",
recipe = {
{reed,reed,reed},
}
})
minetest.register_craft({ -- roof -> slab
output = slab,
recipe = {
{roof},
}
})
minetest.register_craft({ -- corner -> slab
output = slab.." 3",
recipe = {
{corner,corner},
{corner,corner},
}
})
minetest.register_craft({ -- corner_2 -> slab
output = slab.." 3",
recipe = {
{corner_2,corner_2},
{corner_2,corner_2},
}
})
-----------------------------------------------------------------------------------------------
-- Roof
-----------------------------------------------------------------------------------------------
minetest.register_craft({ -- block -> roof
output = roof.." 4",
recipe = {
{reed,""},
{"",reed},
}
})
minetest.register_craft({ -- block -> roof
output = roof.." 4",
recipe = {
{"",reed},
{reed,""},
}
})
minetest.register_craft({ -- slab -> roof
output = roof,
recipe = {
{slab},
}
})
-----------------------------------------------------------------------------------------------
-- Roof Corner
-----------------------------------------------------------------------------------------------
minetest.register_craft({ -- block -> corner
output = corner.." 8",
recipe = {
{"",reed,""},
{reed,"",reed},
}
})
minetest.register_craft({ -- corner_2 -> corner
output = corner,
recipe = {
{corner_2},
}
})
-----------------------------------------------------------------------------------------------
-- Roof Corner 2
-----------------------------------------------------------------------------------------------
minetest.register_craft({ -- block -> corner_2
output = corner_2.." 8",
recipe = {
{reed,"",reed},
{"",reed,""},
}
})
minetest.register_craft({ -- corner -> corner_2
output = corner_2,
recipe = {
{corner},
}
})
end
-----------------------------------------------------------------------------------------------
-- Reed
-----------------------------------------------------------------------------------------------
minetest.register_craft({ -- hay -> reed
output = "dryplants:reed 2",
recipe = {
{"dryplants:hay","dryplants:hay"},
{"dryplants:hay","dryplants:hay"},
}
})
--cooking
minetest.register_craft({ -- wetreed -> reed
type = "cooking",
output = "dryplants:reed",
recipe = "dryplants:wetreed",
cooktime = 2,
})
--fuel
minetest.register_craft({
type = "fuel",
recipe = "dryplants:reed",
burntime = 4,
})
-----------------------------------------------------------------------------------------------
-- Reed Slab
-----------------------------------------------------------------------------------------------
--cooking
minetest.register_craft({ -- wetreed_slab -> reed_slab
type = "cooking",
output = "dryplants:reed_slab",
recipe = "dryplants:wetreed_slab",
cooktime = 1,
})
--fuel
minetest.register_craft({
type = "fuel",
recipe = "dryplants:reed_slab",
burntime = 2,
})
-----------------------------------------------------------------------------------------------
-- Reed Roof
-----------------------------------------------------------------------------------------------
--cooking
minetest.register_craft({ -- wetreed_roof -> reed_roof
type = "cooking",
output = "dryplants:reed_roof",
recipe = "dryplants:wetreed_roof",
cooktime = 1,
})
--fuel
minetest.register_craft({
type = "fuel",
recipe = "dryplants:reed_roof",
burntime = 2,
})
-----------------------------------------------------------------------------------------------
-- Reed Roof Corner
-----------------------------------------------------------------------------------------------
--cooking
minetest.register_craft({ -- wetreed_roof_corner -> reed_roof_corner
type = "cooking",
output = "dryplants:reed_roof_corner",
recipe = "dryplants:wetreed_roof_corner",
cooktime = 1,
})
--fuel
minetest.register_craft({
type = "fuel",
recipe = "dryplants:reed_roof_corner",
burntime = 2,
})
-----------------------------------------------------------------------------------------------
-- Wet Reed Roof Corner 2
-----------------------------------------------------------------------------------------------
--cooking
minetest.register_craft({ -- wetreed_roof_corner -> reed_roof_corner
type = "cooking",
output = "dryplants:reed_roof_corner_2",
recipe = "dryplants:wetreed_roof_corner_2",
cooktime = 1,
})
--fuel
minetest.register_craft({
type = "fuel",
recipe = "dryplants:reed_roof_corner_2",
burntime = 2,
})
-----------------------------------------------------------------------------------------------
-- Dandelion Leave
-----------------------------------------------------------------------------------------------
--[[minetest.register_craftitem("dryplants:dandelion_leave", {
description = "Dandelion Leave",
inventory_image = "dryplants_dandelion_leave.png",
on_use = minetest.item_eat(1),
})
minetest.register_craft({
type = "shapeless",
output = "dryplants:dandelion_leave 4",
recipe = {"flowers:dandelion_yellow"},
replacements = {
{"flowers:dandelion_yellow", "dye:yellow"}
},
-----------------------------------------------------------------------------------------------
-- Dry Plants - Recipes 0.1.0 -- Short Grass -> Dirt
-----------------------------------------------------------------------------------------------
-- by Mossmanikin
-- License (everything): WTFPL
-- Looked at code from: darkage, default, farming, sickle, stairs
-- Dependencies: default, farming
-- Supports: flint, stoneage, sumpf
-----------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------
-- Short Grass
-----------------------------------------------------------------------------------------------
minetest.register_craft({
output = "default:dirt",
recipe = {
{"dryplants:grass_short"},
}
})
-----------------------------------------------------------------------------------------------
-- Cut Grass
-----------------------------------------------------------------------------------------------
-- grass recipes (remove roots)
minetest.register_craft({
output = "dryplants:grass",
recipe = {
{"default:grass_1"},
}
})
minetest.register_craft({
output = "dryplants:grass",
recipe = {
{"default:junglegrass"},
}
})
if minetest.get_modpath("sumpf") ~= nil then
minetest.register_craft({
output = "dryplants:grass",
recipe = {
{"sumpf:gras"},
}
})
end
-----------------------------------------------------------------------------------------------
-- Sickle
-----------------------------------------------------------------------------------------------
minetest.register_craft({
output = "dryplants:sickle",
recipe = {
{"group:stone",""},
{"", "default:stick"},
{"default:stick",""}
}
})
if minetest.get_modpath("flint") ~= nil then
minetest.register_craft({
output = "dryplants:sickle",
recipe = {
{"flint:flintstone",""},
{"", "default:stick"},
{"default:stick",""}
}
})
end
if minetest.get_modpath("stoneage") ~= nil then
minetest.register_craft({
output = "dryplants:sickle",
recipe = {
{"stoneage:silex",""},
{"", "default:stick"},
{"default:stick",""}
}
})
end
-----------------------------------------------------------------------------------------------
-- Hay
-----------------------------------------------------------------------------------------------
--cooking
minetest.register_craft({
type = "cooking",
output = "dryplants:hay",
recipe = "dryplants:grass",
cooktime = 2,
})
minetest.register_craft({
type = "fuel",
recipe = "dryplants:hay",
burntime = 1,
})
-----------------------------------------------------------------------------------------------
-- Wet Reed
-----------------------------------------------------------------------------------------------
minetest.register_craft({ -- papyrus -> wetreed
output = "dryplants:wetreed 2",
recipe = {
{"default:papyrus","default:papyrus"},
{"default:papyrus","default:papyrus"},
}
})
minetest.register_craft({ -- reedmace_sapling -> wetreed
output = "dryplants:wetreed 2",
recipe = {
{"dryplants:reedmace_sapling","dryplants:reedmace_sapling"},
{"dryplants:reedmace_sapling","dryplants:reedmace_sapling"},
}
})
minetest.register_craft({ -- reedmace_top -> wetreed
output = "dryplants:wetreed 2",
recipe = {
{"dryplants:reedmace_top","dryplants:reedmace_top"},
{"dryplants:reedmace_top","dryplants:reedmace_top"},
}
})
minetest.register_craft({ -- reedmace -> wetreed
output = "dryplants:wetreed 2",
recipe = {
{"dryplants:reedmace","dryplants:reedmace"},
{"dryplants:reedmace","dryplants:reedmace"},
}
})
minetest.register_craft({ -- reedmace_bottom -> wetreed
output = "dryplants:wetreed 2",
recipe = {
{"dryplants:reedmace_bottom","dryplants:reedmace_bottom"},
{"dryplants:reedmace_bottom","dryplants:reedmace_bottom"},
}
})
local ReeD = {
{"wetreed"},
{"reed"}
}
for i in pairs(ReeD) do
local reed = "dryplants:"..ReeD[i][1]
local slab = reed.."_slab"
local roof = reed.."_roof"
local corner = roof.."_corner"
local corner_2 = corner.."_2"
-----------------------------------------------------------------------------------------------
-- Block
-----------------------------------------------------------------------------------------------
minetest.register_craft({ -- slab -> block
output = reed,
recipe = {
{slab},
{slab},
}
})
minetest.register_craft({ -- roof -> block
output = reed,
recipe = {
{roof},
{roof},
}
})
minetest.register_craft({ -- corner -> block
type = "shapeless",
output = reed.." 3",
recipe = {corner,corner,corner,corner,corner,corner,corner,corner}, -- 8x
})
minetest.register_craft({ -- corner_2 -> block
type = "shapeless",
output = reed.." 3",
recipe = {corner_2,corner_2,corner_2,corner_2,corner_2,corner_2,corner_2,corner_2}, -- 8x
})
-----------------------------------------------------------------------------------------------
-- Slab
-----------------------------------------------------------------------------------------------
minetest.register_craft({ -- block -> slab
output = slab.." 6",
recipe = {
{reed,reed,reed},
}
})
minetest.register_craft({ -- roof -> slab
output = slab,
recipe = {
{roof},
}
})
minetest.register_craft({ -- corner -> slab
output = slab.." 3",
recipe = {
{corner,corner},
{corner,corner},
}
})
minetest.register_craft({ -- corner_2 -> slab
output = slab.." 3",
recipe = {
{corner_2,corner_2},
{corner_2,corner_2},
}
})
-----------------------------------------------------------------------------------------------
-- Roof
-----------------------------------------------------------------------------------------------
minetest.register_craft({ -- block -> roof
output = roof.." 4",
recipe = {
{reed,""},
{"",reed},
}
})
minetest.register_craft({ -- block -> roof
output = roof.." 4",
recipe = {
{"",reed},
{reed,""},
}
})
minetest.register_craft({ -- slab -> roof
output = roof,
recipe = {
{slab},
}
})
-----------------------------------------------------------------------------------------------
-- Roof Corner
-----------------------------------------------------------------------------------------------
minetest.register_craft({ -- block -> corner
output = corner.." 8",
recipe = {
{"",reed,""},
{reed,"",reed},
}
})
minetest.register_craft({ -- corner_2 -> corner
output = corner,
recipe = {
{corner_2},
}
})
-----------------------------------------------------------------------------------------------
-- Roof Corner 2
-----------------------------------------------------------------------------------------------
minetest.register_craft({ -- block -> corner_2
output = corner_2.." 8",
recipe = {
{reed,"",reed},
{"",reed,""},
}
})
minetest.register_craft({ -- corner -> corner_2
output = corner_2,
recipe = {
{corner},
}
})
end
-----------------------------------------------------------------------------------------------
-- Reed
-----------------------------------------------------------------------------------------------
minetest.register_craft({ -- hay -> reed
output = "dryplants:reed 2",
recipe = {
{"dryplants:hay","dryplants:hay"},
{"dryplants:hay","dryplants:hay"},
}
})
--cooking
minetest.register_craft({ -- wetreed -> reed
type = "cooking",
output = "dryplants:reed",
recipe = "dryplants:wetreed",
cooktime = 2,
})
--fuel
minetest.register_craft({
type = "fuel",
recipe = "dryplants:reed",
burntime = 4,
})
-----------------------------------------------------------------------------------------------
-- Reed Slab
-----------------------------------------------------------------------------------------------
--cooking
minetest.register_craft({ -- wetreed_slab -> reed_slab
type = "cooking",
output = "dryplants:reed_slab",
recipe = "dryplants:wetreed_slab",
cooktime = 1,
})
--fuel
minetest.register_craft({
type = "fuel",
recipe = "dryplants:reed_slab",
burntime = 2,
})
-----------------------------------------------------------------------------------------------
-- Reed Roof
-----------------------------------------------------------------------------------------------
--cooking
minetest.register_craft({ -- wetreed_roof -> reed_roof
type = "cooking",
output = "dryplants:reed_roof",
recipe = "dryplants:wetreed_roof",
cooktime = 1,
})
--fuel
minetest.register_craft({
type = "fuel",
recipe = "dryplants:reed_roof",
burntime = 2,
})
-----------------------------------------------------------------------------------------------
-- Reed Roof Corner
-----------------------------------------------------------------------------------------------
--cooking
minetest.register_craft({ -- wetreed_roof_corner -> reed_roof_corner
type = "cooking",
output = "dryplants:reed_roof_corner",
recipe = "dryplants:wetreed_roof_corner",
cooktime = 1,
})
--fuel
minetest.register_craft({
type = "fuel",
recipe = "dryplants:reed_roof_corner",
burntime = 2,
})
-----------------------------------------------------------------------------------------------
-- Wet Reed Roof Corner 2
-----------------------------------------------------------------------------------------------
--cooking
minetest.register_craft({ -- wetreed_roof_corner -> reed_roof_corner
type = "cooking",
output = "dryplants:reed_roof_corner_2",
recipe = "dryplants:wetreed_roof_corner_2",
cooktime = 1,
})
--fuel
minetest.register_craft({
type = "fuel",
recipe = "dryplants:reed_roof_corner_2",
burntime = 2,
})
-----------------------------------------------------------------------------------------------
-- Dandelion Leave
-----------------------------------------------------------------------------------------------
--[[minetest.register_craftitem("dryplants:dandelion_leave", {
description = "Dandelion Leave",
inventory_image = "dryplants_dandelion_leave.png",
on_use = minetest.item_eat(1),
})
minetest.register_craft({
type = "shapeless",
output = "dryplants:dandelion_leave 4",
recipe = {"flowers:dandelion_yellow"},
replacements = {
{"flowers:dandelion_yellow", "dye:yellow"}
},
})]]

View File

@ -1,3 +1,3 @@
default
plants_lib
farming?
default
plants_lib
farming?

View File

@ -1,185 +1,185 @@
-----------------------------------------------------------------------------------------------
local title = "Grasses" -- former "Dry plants"
local version = "0.1.5"
local mname = "dryplants"
-----------------------------------------------------------------------------------------------
-- by Mossmanikin
-- textures & ideas partly by Neuromancer
-- License (everything): WTFPL
-- Contains code from: default, farming
-- Looked at code from: darkage, sickle, stairs
-- Dependencies: default, farming, plants_lib
-- Supports:
-----------------------------------------------------------------------------------------------
abstract_dryplants = {}
dofile(minetest.get_modpath("dryplants").."/crafting.lua")
dofile(minetest.get_modpath("dryplants").."/settings.txt")
dofile(minetest.get_modpath("dryplants").."/reed.lua")
if REEDMACE_GENERATES == true then
dofile(minetest.get_modpath("dryplants").."/reedmace.lua")
end
if SMALL_JUNCUS_GENERATES == true then
dofile(minetest.get_modpath("dryplants").."/juncus.lua")
end
if EXTRA_TALL_GRASS_GENERATES == true then
dofile(minetest.get_modpath("dryplants").."/moregrass.lua")
end
--dofile(minetest.get_modpath("dryplants").."/meadowvariation.lua")
-----------------------------------------------------------------------------------------------
-- Sickle
-----------------------------------------------------------------------------------------------
-- turns nodes with group flora=1 & flower=0 into cut grass
local function sickle_on_use(itemstack, user, pointed_thing, uses)
local pt = pointed_thing
-- check if pointing at a node
if not pt then
return
end
if pt.type ~= "node" then
return
end
local under = minetest.get_node(pt.under)
local p = {x=pt.under.x, y=pt.under.y+1, z=pt.under.z}
local above = minetest.get_node(p)
-- return if any of the nodes is not registered
if not minetest.registered_nodes[under.name] then
return
end
if not minetest.registered_nodes[above.name] then
return
end
local node = minetest.get_node(pt.under)
-- check if something that can be cut using fine tools
if minetest.get_item_group(under.name, "snappy") > 0 then
-- check if flora but no flower
if minetest.get_item_group(under.name, "flora") == 1 and minetest.get_item_group(under.name, "flower") == 0 then
-- turn the node into cut grass, wear out item and play sound
minetest.set_node(pt.under, {name="dryplants:grass"})
else -- otherwise get the drop
local inv = user:get_inventory()
local name = minetest. get_node(pt.under).name
local the_drop = minetest.registered_nodes[name].drop
if the_drop ~= nil then
if inv:room_for_item("main", the_drop) then
inv:add_item("main", the_drop)
end
else
if inv:room_for_item("main", name) then
inv:add_item("main", name)
end
end
minetest.remove_node(pt.under)
end
minetest.sound_play("default_dig_crumbly", {
pos = pt.under,
gain = 0.5,
})
itemstack:add_wear(65535/(uses-1))
return itemstack
elseif string.find(node.name, "default:dirt_with_grass") then
minetest.set_node(pt.under, {name="dryplants:grass_short"})
minetest.set_node(pt.above, {name="dryplants:grass"})
minetest.sound_play("default_dig_crumbly", {
pos = pt.under,
gain = 0.5,
})
itemstack:add_wear(65535/(uses-1))
return itemstack
end
end
-- the tool
minetest.register_tool("dryplants:sickle", {
description = "Sickle",
inventory_image = "dryplants_sickle.png",
on_use = function(itemstack, user, pointed_thing)
return sickle_on_use(itemstack, user, pointed_thing, 220)
end,
})
-----------------------------------------------------------------------------------------------
-- Cut Grass
-----------------------------------------------------------------------------------------------
minetest.register_node("dryplants:grass", {
description = "Cut Grass",
inventory_image = "dryplants_grass.png",
wield_image = "dryplants_grass.png",
paramtype = "light",
sunlight_propagates = true,
tiles = {"dryplants_grass.png"},
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {-0.5 , -0.5 , -0.5 , 0.5 , -0.4375, 0.5 },
},
groups = {snappy=3, flammable=2},
sounds = default.node_sound_leaves_defaults(),
})
-----------------------------------------------------------------------------------------------
-- Cut Grass becomes Hay over time
-----------------------------------------------------------------------------------------------
minetest.register_abm({
nodenames = {"dryplants:grass"},
interval = HAY_DRYING_TIME, --1200, -- 20 minutes: a minetest-day/night-cycle
chance = 1,
action = function(pos)
minetest.set_node(pos, {name="dryplants:hay"})
end,
})
-----------------------------------------------------------------------------------------------
-- Hay
-----------------------------------------------------------------------------------------------
minetest.register_node("dryplants:hay", {
description = "Hay",
inventory_image = "dryplants_hay.png",
wield_image = "dryplants_hay.png",
paramtype = "light",
sunlight_propagates = true,
tiles = {"dryplants_hay.png"},
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {-0.5 , -0.5 , -0.5 , 0.5 , -0.4375, 0.5 },
},
groups = {snappy=3, flammable=2},
sounds = default.node_sound_leaves_defaults(),
})
-----------------------------------------------------------------------------------------------
-- Short Grass
-----------------------------------------------------------------------------------------------
minetest.register_node("dryplants:grass_short", {
description = "Short Grass",
tiles = {"default_grass.png^dryplants_grass_short.png", "default_dirt.png", "default_dirt.png^default_grass_side.png^dryplants_grass_short_side.png"},
is_ground_content = true,
groups = {crumbly=3,soil=1,not_in_creative_inventory=1},
--drop = 'default:dirt',
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4},
}),
})
-----------------------------------------------------------------------------------------------
-- Short Grass becomes Dirt with Grass over time
-----------------------------------------------------------------------------------------------
minetest.register_abm({
nodenames = {"dryplants:grass_short"},
interval = GRASS_REGROWING_TIME, --1200, -- 20 minutes: a minetest-day/night-cycle
chance = 100/GRASS_REGROWING_CHANCE,
action = function(pos)
minetest.set_node(pos, {name="default:dirt_with_grass"})
end,
})
-----------------------------------------------------------------------------------------------
print("[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...")
-----------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------
local title = "Grasses" -- former "Dry plants"
local version = "0.1.5"
local mname = "dryplants"
-----------------------------------------------------------------------------------------------
-- by Mossmanikin
-- textures & ideas partly by Neuromancer
-- License (everything): WTFPL
-- Contains code from: default, farming
-- Looked at code from: darkage, sickle, stairs
-- Dependencies: default, farming, plants_lib
-- Supports:
-----------------------------------------------------------------------------------------------
abstract_dryplants = {}
dofile(minetest.get_modpath("dryplants").."/crafting.lua")
dofile(minetest.get_modpath("dryplants").."/settings.txt")
dofile(minetest.get_modpath("dryplants").."/reed.lua")
if REEDMACE_GENERATES == true then
dofile(minetest.get_modpath("dryplants").."/reedmace.lua")
end
if SMALL_JUNCUS_GENERATES == true then
dofile(minetest.get_modpath("dryplants").."/juncus.lua")
end
if EXTRA_TALL_GRASS_GENERATES == true then
dofile(minetest.get_modpath("dryplants").."/moregrass.lua")
end
--dofile(minetest.get_modpath("dryplants").."/meadowvariation.lua")
-----------------------------------------------------------------------------------------------
-- Sickle
-----------------------------------------------------------------------------------------------
-- turns nodes with group flora=1 & flower=0 into cut grass
local function sickle_on_use(itemstack, user, pointed_thing, uses)
local pt = pointed_thing
-- check if pointing at a node
if not pt then
return
end
if pt.type ~= "node" then
return
end
local under = minetest.get_node(pt.under)
local p = {x=pt.under.x, y=pt.under.y+1, z=pt.under.z}
local above = minetest.get_node(p)
-- return if any of the nodes is not registered
if not minetest.registered_nodes[under.name] then
return
end
if not minetest.registered_nodes[above.name] then
return
end
local node = minetest.get_node(pt.under)
-- check if something that can be cut using fine tools
if minetest.get_item_group(under.name, "snappy") > 0 then
-- check if flora but no flower
if minetest.get_item_group(under.name, "flora") == 1 and minetest.get_item_group(under.name, "flower") == 0 then
-- turn the node into cut grass, wear out item and play sound
minetest.set_node(pt.under, {name="dryplants:grass"})
else -- otherwise get the drop
local inv = user:get_inventory()
local name = minetest. get_node(pt.under).name
local the_drop = minetest.registered_nodes[name].drop
if the_drop ~= nil then
if inv:room_for_item("main", the_drop) then
inv:add_item("main", the_drop)
end
else
if inv:room_for_item("main", name) then
inv:add_item("main", name)
end
end
minetest.remove_node(pt.under)
end
minetest.sound_play("default_dig_crumbly", {
pos = pt.under,
gain = 0.5,
})
itemstack:add_wear(65535/(uses-1))
return itemstack
elseif string.find(node.name, "default:dirt_with_grass") then
minetest.set_node(pt.under, {name="dryplants:grass_short"})
minetest.set_node(pt.above, {name="dryplants:grass"})
minetest.sound_play("default_dig_crumbly", {
pos = pt.under,
gain = 0.5,
})
itemstack:add_wear(65535/(uses-1))
return itemstack
end
end
-- the tool
minetest.register_tool("dryplants:sickle", {
description = "Sickle",
inventory_image = "dryplants_sickle.png",
on_use = function(itemstack, user, pointed_thing)
return sickle_on_use(itemstack, user, pointed_thing, 220)
end,
})
-----------------------------------------------------------------------------------------------
-- Cut Grass
-----------------------------------------------------------------------------------------------
minetest.register_node("dryplants:grass", {
description = "Cut Grass",
inventory_image = "dryplants_grass.png",
wield_image = "dryplants_grass.png",
paramtype = "light",
sunlight_propagates = true,
tiles = {"dryplants_grass.png"},
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {-0.5 , -0.5 , -0.5 , 0.5 , -0.4375, 0.5 },
},
groups = {snappy=3, flammable=2},
sounds = default.node_sound_leaves_defaults(),
})
-----------------------------------------------------------------------------------------------
-- Cut Grass becomes Hay over time
-----------------------------------------------------------------------------------------------
minetest.register_abm({
nodenames = {"dryplants:grass"},
interval = HAY_DRYING_TIME, --1200, -- 20 minutes: a minetest-day/night-cycle
chance = 1,
action = function(pos)
minetest.set_node(pos, {name="dryplants:hay"})
end,
})
-----------------------------------------------------------------------------------------------
-- Hay
-----------------------------------------------------------------------------------------------
minetest.register_node("dryplants:hay", {
description = "Hay",
inventory_image = "dryplants_hay.png",
wield_image = "dryplants_hay.png",
paramtype = "light",
sunlight_propagates = true,
tiles = {"dryplants_hay.png"},
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {-0.5 , -0.5 , -0.5 , 0.5 , -0.4375, 0.5 },
},
groups = {snappy=3, flammable=2},
sounds = default.node_sound_leaves_defaults(),
})
-----------------------------------------------------------------------------------------------
-- Short Grass
-----------------------------------------------------------------------------------------------
minetest.register_node("dryplants:grass_short", {
description = "Short Grass",
tiles = {"default_grass.png^dryplants_grass_short.png", "default_dirt.png", "default_dirt.png^default_grass_side.png^dryplants_grass_short_side.png"},
is_ground_content = true,
groups = {crumbly=3,soil=1,not_in_creative_inventory=1},
--drop = 'default:dirt',
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4},
}),
})
-----------------------------------------------------------------------------------------------
-- Short Grass becomes Dirt with Grass over time
-----------------------------------------------------------------------------------------------
minetest.register_abm({
nodenames = {"dryplants:grass_short"},
interval = GRASS_REGROWING_TIME, --1200, -- 20 minutes: a minetest-day/night-cycle
chance = 100/GRASS_REGROWING_CHANCE,
action = function(pos)
minetest.set_node(pos, {name="default:dirt_with_grass"})
end,
})
-----------------------------------------------------------------------------------------------
print("[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...")
-----------------------------------------------------------------------------------------------

View File

@ -1,33 +1,33 @@
-----------------------------------------------------------------------------------------------
-- Grasses - More Tall Grass 0.0.2
-----------------------------------------------------------------------------------------------
-- by Mossmanikin
-- License (everything): WTFPL
-- Contains code from: plants_lib
-- Looked at code from: default
-----------------------------------------------------------------------------------------------
abstract_dryplants.grow_grass = function(pos)
local right_here = {x=pos.x, y=pos.y+1, z=pos.z}
local grass_size = math.random(1,5)
if minetest.get_node(right_here).name == "air" -- instead of check_air = true,
or minetest.get_node(right_here).name == "default:junglegrass" then
minetest.set_node(right_here, {name="default:grass_"..grass_size})
end
end
plantslib:register_generate_plant({
surface = {
"default:dirt_with_grass",
"stoneage:grass_with_silex",
"sumpf:peat",
"sumpf:sumpf"
},
max_count = TALL_GRASS_PER_MAPBLOCK,
rarity = 101 - TALL_GRASS_RARITY,
min_elevation = 1, -- above sea level
plantlife_limit = -0.9,
},
abstract_dryplants.grow_grass
)
-----------------------------------------------------------------------------------------------
-- Grasses - More Tall Grass 0.0.2
-----------------------------------------------------------------------------------------------
-- by Mossmanikin
-- License (everything): WTFPL
-- Contains code from: plants_lib
-- Looked at code from: default
-----------------------------------------------------------------------------------------------
abstract_dryplants.grow_grass = function(pos)
local right_here = {x=pos.x, y=pos.y+1, z=pos.z}
local grass_size = math.random(1,5)
if minetest.get_node(right_here).name == "air" -- instead of check_air = true,
or minetest.get_node(right_here).name == "default:junglegrass" then
minetest.set_node(right_here, {name="default:grass_"..grass_size})
end
end
plantslib:register_generate_plant({
surface = {
"default:dirt_with_grass",
"stoneage:grass_with_silex",
"sumpf:peat",
"sumpf:sumpf"
},
max_count = TALL_GRASS_PER_MAPBLOCK,
rarity = 101 - TALL_GRASS_RARITY,
min_elevation = 1, -- above sea level
plantlife_limit = -0.9,
},
abstract_dryplants.grow_grass
)

View File

@ -1,380 +1,380 @@
-----------------------------------------------------------------------------------------------
-- Dry Plants - Reed 0.0.5
-----------------------------------------------------------------------------------------------
-- by Mossmanikin
-- License (everything): WTFPL
-- Looked at code from: darkage, default, stairs
-- Dependencies: default
-----------------------------------------------------------------------------------------------
minetest.register_alias("stairs:stair_wetreed", "dryplants:wetreed_roof")
minetest.register_alias("stairs:slab_wetreed", "dryplants:wetreed_slab")
minetest.register_alias("stairs:stair_reed", "dryplants:reed_roof")
minetest.register_alias("stairs:slab_reed", "dryplants:reed_slab")
-----------------------------------------------------------------------------------------------
-- Wet Reed
-----------------------------------------------------------------------------------------------
minetest.register_node("dryplants:wetreed", {
description = "Wet Reed",
paramtype = "light",
paramtype2 = "facedir",
tiles = {"dryplants_reed_wet.png"},
groups = {snappy=3, flammable=2},
sounds = default.node_sound_leaves_defaults(),
})
-----------------------------------------------------------------------------------------------
-- Wet Reed Slab
-----------------------------------------------------------------------------------------------
minetest.register_node("dryplants:wetreed_slab", {
description = "Wet Reed Slab",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
tiles = {"dryplants_reed_wet.png"},
node_box = {
type = "fixed",
fixed = {-1/2, -1/2, -1/2, 1/2, 0, 1/2},
},
selection_box = {
type = "fixed",
fixed = {-1/2, -1/2, -1/2, 1/2, 0, 1/2},
},
groups = {snappy=3, flammable=2},
sounds = default.node_sound_leaves_defaults(),
})
-----------------------------------------------------------------------------------------------
-- Wet Reed Roof
-----------------------------------------------------------------------------------------------
minetest.register_node("dryplants:wetreed_roof", {
description = "Wet Reed Roof",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
tiles = {"dryplants_reed_wet.png"},
node_box = {
type = "fixed",
-- { left , bottom , front , right , top , back }
fixed = {
{-1/2, 0, 0, 1/2, 1/2, 1/2},
{-1/2, -1/2, -1/2, 1/2, 0, 0},
}
},
selection_box = {
type = "fixed",
fixed = {
{-1/2, 0, 0, 1/2, 1/2, 1/2},
{-1/2, -1/2, -1/2, 1/2, 0, 0},
}
},
groups = {snappy=3, flammable=2},
sounds = default.node_sound_leaves_defaults(),
})
if AUTO_ROOF_CORNER == true then
local CoRNeR = {
-- MaTeRiaL
{"wetreed"},
{"reed"}
}
for i in pairs(CoRNeR) do
local MaTeRiaL = CoRNeR[i][1]
local roof = "dryplants:"..MaTeRiaL.."_roof"
local corner = "dryplants:"..MaTeRiaL.."_roof_corner"
local corner_2 = "dryplants:"..MaTeRiaL.."_roof_corner_2"
minetest.register_abm({
nodenames = {roof},
interval = 1,
chance = 1,
action = function(pos)
local node_east = minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z })
local node_west = minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z })
local node_north = minetest.get_node({x=pos.x, y=pos.y, z=pos.z+1})
local node_south = minetest.get_node({x=pos.x, y=pos.y, z=pos.z-1})
-- corner 1
if ((node_west.name == roof and node_west.param2 == 0)
or (node_west.name == corner and node_west.param2 == 1))
and ((node_north.name == roof and node_north.param2 == 3)
or (node_north.name == corner and node_north.param2 == 3))
then
minetest.set_node(pos, {name=corner, param2=0})
end
if ((node_north.name == roof and node_north.param2 == 1)
or (node_north.name == corner and node_north.param2 == 2))
and ((node_east.name == roof and node_east.param2 == 0)
or (node_east.name == corner and node_east.param2 == 0))
then
minetest.set_node(pos, {name=corner, param2=1})
end
if ((node_east.name == roof and node_east.param2 == 2)
or (node_east.name == corner and node_east.param2 == 3))
and ((node_south.name == roof and node_south.param2 == 1)
or (node_south.name == corner and node_south.param2 == 1))
then
minetest.set_node(pos, {name=corner, param2=2})
end
if ((node_south.name == roof and node_south.param2 == 3)
or (node_south.name == corner and node_south.param2 == 0))
and ((node_west.name == roof and node_west.param2 == 2)
or (node_west.name == corner and node_west.param2 == 2))
then
minetest.set_node(pos, {name=corner, param2=3})
end
-- corner 2
if ((node_west.name == roof and node_west.param2 == 2)
or (node_west.name == corner_2 and node_west.param2 == 1))
and ((node_north.name == roof and node_north.param2 == 1)
or (node_north.name == corner_2 and node_north.param2 == 3))
then
minetest.set_node(pos, {name=corner_2, param2=0})
end
if ((node_north.name == roof and node_north.param2 == 3)
or (node_north.name == corner_2 and node_north.param2 == 2))
and ((node_east.name == roof and node_east.param2 == 2)
or (node_east.name == corner_2 and node_east.param2 == 0))
then
minetest.set_node(pos, {name=corner_2, param2=1})
end
if ((node_east.name == roof and node_east.param2 == 0)
or (node_east.name == corner_2 and node_east.param2 == 3))
and ((node_south.name == roof and node_south.param2 == 3)
or (node_south.name == corner_2 and node_south.param2 == 1))
then
minetest.set_node(pos, {name=corner_2, param2=2})
end
if ((node_south.name == roof and node_south.param2 == 1)
or (node_south.name == corner_2 and node_south.param2 == 0))
and ((node_west.name == roof and node_west.param2 == 0)
or (node_west.name == corner_2 and node_west.param2 == 2))
then
minetest.set_node(pos, {name=corner_2, param2=3})
end
end,
})
end
end
-----------------------------------------------------------------------------------------------
-- Wet Reed Roof Corner
-----------------------------------------------------------------------------------------------
minetest.register_node("dryplants:wetreed_roof_corner", {
description = "Wet Reed Roof Corner",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
tiles = {"dryplants_reed_wet.png"},
node_box = {
type = "fixed",
-- { left , bottom , front , right , top , back }
fixed = {
{-1/2, 0, 0, 0, 1/2, 1/2},
{0, -1/2, 0, 1/2, 0, 1/2},
{-1/2, -1/2, -1/2, 0, 0, 0},
}
},
selection_box = {
type = "fixed",
fixed = {
{-1/2, 0, 0, 0, 1/2, 1/2},
{0, -1/2, 0, 1/2, 0, 1/2},
{-1/2, -1/2, -1/2, 0, 0, 0},
}
},
groups = {snappy=3, flammable=2},
sounds = default.node_sound_leaves_defaults(),
})
-----------------------------------------------------------------------------------------------
-- Wet Reed Roof Corner 2
-----------------------------------------------------------------------------------------------
minetest.register_node("dryplants:wetreed_roof_corner_2", {
description = "Wet Reed Roof Corner 2",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
tiles = {"dryplants_reed_wet.png"},
node_box = {
type = "fixed",
-- { left , bottom , front , right , top , back }
fixed = {
{-1/2, -1/2, 0, 0, 0, 1/2},
{0, 0, 0, 1/2, 1/2, 1/2},
{-1/2, 0, -1/2, 0, 1/2, 0},
}
},
selection_box = {
type = "fixed",
fixed = {
{-1/2, -1/2, 0, 0, 0, 1/2},
{0, 0, 0, 1/2, 1/2, 1/2},
{-1/2, 0, -1/2, 0, 1/2, 0},
}
},
groups = {snappy=3, flammable=2},
sounds = default.node_sound_leaves_defaults(),
})
-----------------------------------------------------------------------------------------------
-- Wet Reed becomes (dry) Reed over time
-----------------------------------------------------------------------------------------------
if REED_WILL_DRY == true then
local DRyiNG = {
-- WeT DRy
{"dryplants:wetreed", "dryplants:reed"},
{"dryplants:wetreed_slab", "dryplants:reed_slab"},
{"dryplants:wetreed_roof", "dryplants:reed_roof"},
{"dryplants:wetreed_roof_corner", "dryplants:reed_roof_corner"},
{"dryplants:wetreed_roof_corner_2", "dryplants:reed_roof_corner_2"}
}
for i in pairs(DRyiNG) do
local WeT = DRyiNG[i][1]
local DRy = DRyiNG[i][2]
minetest.register_abm({
nodenames = {WeT},
interval = REED_DRYING_TIME, --1200, -- 20 minutes: a minetest-day/night-cycle
chance = 1,
action = function(pos)
local direction = minetest.get_node(pos).param2
minetest.set_node(pos, {name=DRy, param2=direction})
end,
})
end
end
-----------------------------------------------------------------------------------------------
-- Reed
-----------------------------------------------------------------------------------------------
minetest.register_node("dryplants:reed", {
description = "Reed",
paramtype = "light",
paramtype2 = "facedir",
tiles = {"dryplants_reed.png"},
groups = {snappy=3, flammable=2},
sounds = default.node_sound_leaves_defaults(),
})
-----------------------------------------------------------------------------------------------
-- Reed Slab
-----------------------------------------------------------------------------------------------
minetest.register_node("dryplants:reed_slab", {
description = "Reed Slab",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
tiles = {"dryplants_reed.png"},
node_box = {
type = "fixed",
fixed = {-1/2, -1/2, -1/2, 1/2, 0, 1/2},
},
selection_box = {
type = "fixed",
fixed = {-1/2, -1/2, -1/2, 1/2, 0, 1/2},
},
groups = {snappy=3, flammable=2},
sounds = default.node_sound_leaves_defaults(),
})
-----------------------------------------------------------------------------------------------
-- Reed Roof
-----------------------------------------------------------------------------------------------
minetest.register_node("dryplants:reed_roof", {
description = "Reed Roof",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
tiles = {"dryplants_reed.png"},
node_box = {
type = "fixed",
-- { left , bottom , front , right , top , back }
fixed = {
{-1/2, 0, 0, 1/2, 1/2, 1/2},
{-1/2, -1/2, -1/2, 1/2, 0, 0},
}
},
selection_box = {
type = "fixed",
fixed = {
{-1/2, 0, 0, 1/2, 1/2, 1/2},
{-1/2, -1/2, -1/2, 1/2, 0, 0},
}
},
groups = {snappy=3, flammable=2},
sounds = default.node_sound_leaves_defaults(),
})
-----------------------------------------------------------------------------------------------
-- Reed Roof Corner
-----------------------------------------------------------------------------------------------
minetest.register_node("dryplants:reed_roof_corner", {
description = "Reed Roof Corner",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
tiles = {"dryplants_reed.png"},
node_box = {
type = "fixed",
-- { left , bottom , front , right , top , back }
fixed = {
{-1/2, 0, 0, 0, 1/2, 1/2},
{0, -1/2, 0, 1/2, 0, 1/2},
{-1/2, -1/2, -1/2, 0, 0, 0},
}
},
selection_box = {
type = "fixed",
fixed = {
{-1/2, 0, 0, 0, 1/2, 1/2},
{0, -1/2, 0, 1/2, 0, 1/2},
{-1/2, -1/2, -1/2, 0, 0, 0},
}
},
groups = {snappy=3, flammable=2},
sounds = default.node_sound_leaves_defaults(),
})
-----------------------------------------------------------------------------------------------
-- Reed Roof Corner 2
-----------------------------------------------------------------------------------------------
minetest.register_node("dryplants:reed_roof_corner_2", {
description = "Reed Roof Corner 2",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
tiles = {"dryplants_reed.png"},
node_box = {
type = "fixed",
-- { left , bottom , front , right , top , back }
fixed = {
{-1/2, -1/2, 0, 0, 0, 1/2},
{0, 0, 0, 1/2, 1/2, 1/2},
{-1/2, 0, -1/2, 0, 1/2, 0},
}
},
selection_box = {
type = "fixed",
fixed = {
{-1/2, -1/2, 0, 0, 0, 1/2},
{0, 0, 0, 1/2, 1/2, 1/2},
{-1/2, 0, -1/2, 0, 1/2, 0},
}
},
groups = {snappy=3, flammable=2},
sounds = default.node_sound_leaves_defaults(),
})
-----------------------------------------------------------------------------------------------
-- Dry Plants - Reed 0.0.5
-----------------------------------------------------------------------------------------------
-- by Mossmanikin
-- License (everything): WTFPL
-- Looked at code from: darkage, default, stairs
-- Dependencies: default
-----------------------------------------------------------------------------------------------
minetest.register_alias("stairs:stair_wetreed", "dryplants:wetreed_roof")
minetest.register_alias("stairs:slab_wetreed", "dryplants:wetreed_slab")
minetest.register_alias("stairs:stair_reed", "dryplants:reed_roof")
minetest.register_alias("stairs:slab_reed", "dryplants:reed_slab")
-----------------------------------------------------------------------------------------------
-- Wet Reed
-----------------------------------------------------------------------------------------------
minetest.register_node("dryplants:wetreed", {
description = "Wet Reed",
paramtype = "light",
paramtype2 = "facedir",
tiles = {"dryplants_reed_wet.png"},
groups = {snappy=3, flammable=2},
sounds = default.node_sound_leaves_defaults(),
})
-----------------------------------------------------------------------------------------------
-- Wet Reed Slab
-----------------------------------------------------------------------------------------------
minetest.register_node("dryplants:wetreed_slab", {
description = "Wet Reed Slab",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
tiles = {"dryplants_reed_wet.png"},
node_box = {
type = "fixed",
fixed = {-1/2, -1/2, -1/2, 1/2, 0, 1/2},
},
selection_box = {
type = "fixed",
fixed = {-1/2, -1/2, -1/2, 1/2, 0, 1/2},
},
groups = {snappy=3, flammable=2},
sounds = default.node_sound_leaves_defaults(),
})
-----------------------------------------------------------------------------------------------
-- Wet Reed Roof
-----------------------------------------------------------------------------------------------
minetest.register_node("dryplants:wetreed_roof", {
description = "Wet Reed Roof",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
tiles = {"dryplants_reed_wet.png"},
node_box = {
type = "fixed",
-- { left , bottom , front , right , top , back }
fixed = {
{-1/2, 0, 0, 1/2, 1/2, 1/2},
{-1/2, -1/2, -1/2, 1/2, 0, 0},
}
},
selection_box = {
type = "fixed",
fixed = {
{-1/2, 0, 0, 1/2, 1/2, 1/2},
{-1/2, -1/2, -1/2, 1/2, 0, 0},
}
},
groups = {snappy=3, flammable=2},
sounds = default.node_sound_leaves_defaults(),
})
if AUTO_ROOF_CORNER == true then
local CoRNeR = {
-- MaTeRiaL
{"wetreed"},
{"reed"}
}
for i in pairs(CoRNeR) do
local MaTeRiaL = CoRNeR[i][1]
local roof = "dryplants:"..MaTeRiaL.."_roof"
local corner = "dryplants:"..MaTeRiaL.."_roof_corner"
local corner_2 = "dryplants:"..MaTeRiaL.."_roof_corner_2"
minetest.register_abm({
nodenames = {roof},
interval = 1,
chance = 1,
action = function(pos)
local node_east = minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z })
local node_west = minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z })
local node_north = minetest.get_node({x=pos.x, y=pos.y, z=pos.z+1})
local node_south = minetest.get_node({x=pos.x, y=pos.y, z=pos.z-1})
-- corner 1
if ((node_west.name == roof and node_west.param2 == 0)
or (node_west.name == corner and node_west.param2 == 1))
and ((node_north.name == roof and node_north.param2 == 3)
or (node_north.name == corner and node_north.param2 == 3))
then
minetest.set_node(pos, {name=corner, param2=0})
end
if ((node_north.name == roof and node_north.param2 == 1)
or (node_north.name == corner and node_north.param2 == 2))
and ((node_east.name == roof and node_east.param2 == 0)
or (node_east.name == corner and node_east.param2 == 0))
then
minetest.set_node(pos, {name=corner, param2=1})
end
if ((node_east.name == roof and node_east.param2 == 2)
or (node_east.name == corner and node_east.param2 == 3))
and ((node_south.name == roof and node_south.param2 == 1)
or (node_south.name == corner and node_south.param2 == 1))
then
minetest.set_node(pos, {name=corner, param2=2})
end
if ((node_south.name == roof and node_south.param2 == 3)
or (node_south.name == corner and node_south.param2 == 0))
and ((node_west.name == roof and node_west.param2 == 2)
or (node_west.name == corner and node_west.param2 == 2))
then
minetest.set_node(pos, {name=corner, param2=3})
end
-- corner 2
if ((node_west.name == roof and node_west.param2 == 2)
or (node_west.name == corner_2 and node_west.param2 == 1))
and ((node_north.name == roof and node_north.param2 == 1)
or (node_north.name == corner_2 and node_north.param2 == 3))
then
minetest.set_node(pos, {name=corner_2, param2=0})
end
if ((node_north.name == roof and node_north.param2 == 3)
or (node_north.name == corner_2 and node_north.param2 == 2))
and ((node_east.name == roof and node_east.param2 == 2)
or (node_east.name == corner_2 and node_east.param2 == 0))
then
minetest.set_node(pos, {name=corner_2, param2=1})
end
if ((node_east.name == roof and node_east.param2 == 0)
or (node_east.name == corner_2 and node_east.param2 == 3))
and ((node_south.name == roof and node_south.param2 == 3)
or (node_south.name == corner_2 and node_south.param2 == 1))
then
minetest.set_node(pos, {name=corner_2, param2=2})
end
if ((node_south.name == roof and node_south.param2 == 1)
or (node_south.name == corner_2 and node_south.param2 == 0))
and ((node_west.name == roof and node_west.param2 == 0)
or (node_west.name == corner_2 and node_west.param2 == 2))
then
minetest.set_node(pos, {name=corner_2, param2=3})
end
end,
})
end
end
-----------------------------------------------------------------------------------------------
-- Wet Reed Roof Corner
-----------------------------------------------------------------------------------------------
minetest.register_node("dryplants:wetreed_roof_corner", {
description = "Wet Reed Roof Corner",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
tiles = {"dryplants_reed_wet.png"},
node_box = {
type = "fixed",
-- { left , bottom , front , right , top , back }
fixed = {
{-1/2, 0, 0, 0, 1/2, 1/2},
{0, -1/2, 0, 1/2, 0, 1/2},
{-1/2, -1/2, -1/2, 0, 0, 0},
}
},
selection_box = {
type = "fixed",
fixed = {
{-1/2, 0, 0, 0, 1/2, 1/2},
{0, -1/2, 0, 1/2, 0, 1/2},
{-1/2, -1/2, -1/2, 0, 0, 0},
}
},
groups = {snappy=3, flammable=2},
sounds = default.node_sound_leaves_defaults(),
})
-----------------------------------------------------------------------------------------------
-- Wet Reed Roof Corner 2
-----------------------------------------------------------------------------------------------
minetest.register_node("dryplants:wetreed_roof_corner_2", {
description = "Wet Reed Roof Corner 2",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
tiles = {"dryplants_reed_wet.png"},
node_box = {
type = "fixed",
-- { left , bottom , front , right , top , back }
fixed = {
{-1/2, -1/2, 0, 0, 0, 1/2},
{0, 0, 0, 1/2, 1/2, 1/2},
{-1/2, 0, -1/2, 0, 1/2, 0},
}
},
selection_box = {
type = "fixed",
fixed = {
{-1/2, -1/2, 0, 0, 0, 1/2},
{0, 0, 0, 1/2, 1/2, 1/2},
{-1/2, 0, -1/2, 0, 1/2, 0},
}
},
groups = {snappy=3, flammable=2},
sounds = default.node_sound_leaves_defaults(),
})
-----------------------------------------------------------------------------------------------
-- Wet Reed becomes (dry) Reed over time
-----------------------------------------------------------------------------------------------
if REED_WILL_DRY == true then
local DRyiNG = {
-- WeT DRy
{"dryplants:wetreed", "dryplants:reed"},
{"dryplants:wetreed_slab", "dryplants:reed_slab"},
{"dryplants:wetreed_roof", "dryplants:reed_roof"},
{"dryplants:wetreed_roof_corner", "dryplants:reed_roof_corner"},
{"dryplants:wetreed_roof_corner_2", "dryplants:reed_roof_corner_2"}
}
for i in pairs(DRyiNG) do
local WeT = DRyiNG[i][1]
local DRy = DRyiNG[i][2]
minetest.register_abm({
nodenames = {WeT},
interval = REED_DRYING_TIME, --1200, -- 20 minutes: a minetest-day/night-cycle
chance = 1,
action = function(pos)
local direction = minetest.get_node(pos).param2
minetest.set_node(pos, {name=DRy, param2=direction})
end,
})
end
end
-----------------------------------------------------------------------------------------------
-- Reed
-----------------------------------------------------------------------------------------------
minetest.register_node("dryplants:reed", {
description = "Reed",
paramtype = "light",
paramtype2 = "facedir",
tiles = {"dryplants_reed.png"},
groups = {snappy=3, flammable=2},
sounds = default.node_sound_leaves_defaults(),
})
-----------------------------------------------------------------------------------------------
-- Reed Slab
-----------------------------------------------------------------------------------------------
minetest.register_node("dryplants:reed_slab", {
description = "Reed Slab",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
tiles = {"dryplants_reed.png"},
node_box = {
type = "fixed",
fixed = {-1/2, -1/2, -1/2, 1/2, 0, 1/2},
},
selection_box = {
type = "fixed",
fixed = {-1/2, -1/2, -1/2, 1/2, 0, 1/2},
},
groups = {snappy=3, flammable=2},
sounds = default.node_sound_leaves_defaults(),
})
-----------------------------------------------------------------------------------------------
-- Reed Roof
-----------------------------------------------------------------------------------------------
minetest.register_node("dryplants:reed_roof", {
description = "Reed Roof",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
tiles = {"dryplants_reed.png"},
node_box = {
type = "fixed",
-- { left , bottom , front , right , top , back }
fixed = {
{-1/2, 0, 0, 1/2, 1/2, 1/2},
{-1/2, -1/2, -1/2, 1/2, 0, 0},
}
},
selection_box = {
type = "fixed",
fixed = {
{-1/2, 0, 0, 1/2, 1/2, 1/2},
{-1/2, -1/2, -1/2, 1/2, 0, 0},
}
},
groups = {snappy=3, flammable=2},
sounds = default.node_sound_leaves_defaults(),
})
-----------------------------------------------------------------------------------------------
-- Reed Roof Corner
-----------------------------------------------------------------------------------------------
minetest.register_node("dryplants:reed_roof_corner", {
description = "Reed Roof Corner",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
tiles = {"dryplants_reed.png"},
node_box = {
type = "fixed",
-- { left , bottom , front , right , top , back }
fixed = {
{-1/2, 0, 0, 0, 1/2, 1/2},
{0, -1/2, 0, 1/2, 0, 1/2},
{-1/2, -1/2, -1/2, 0, 0, 0},
}
},
selection_box = {
type = "fixed",
fixed = {
{-1/2, 0, 0, 0, 1/2, 1/2},
{0, -1/2, 0, 1/2, 0, 1/2},
{-1/2, -1/2, -1/2, 0, 0, 0},
}
},
groups = {snappy=3, flammable=2},
sounds = default.node_sound_leaves_defaults(),
})
-----------------------------------------------------------------------------------------------
-- Reed Roof Corner 2
-----------------------------------------------------------------------------------------------
minetest.register_node("dryplants:reed_roof_corner_2", {
description = "Reed Roof Corner 2",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
tiles = {"dryplants_reed.png"},
node_box = {
type = "fixed",
-- { left , bottom , front , right , top , back }
fixed = {
{-1/2, -1/2, 0, 0, 0, 1/2},
{0, 0, 0, 1/2, 1/2, 1/2},
{-1/2, 0, -1/2, 0, 1/2, 0},
}
},
selection_box = {
type = "fixed",
fixed = {
{-1/2, -1/2, 0, 0, 0, 1/2},
{0, 0, 0, 1/2, 1/2, 1/2},
{-1/2, 0, -1/2, 0, 1/2, 0},
}
},
groups = {snappy=3, flammable=2},
sounds = default.node_sound_leaves_defaults(),
})

View File

@ -1,52 +1,52 @@
-- Here you can enable/disable the different plants
REEDMACE_GENERATES = true
SMALL_JUNCUS_GENERATES = true
EXTRA_TALL_GRASS_GENERATES = true
-- Amount of Reedmace near water or swamp
REEDMACE_NEAR_WATER_PER_MAPBLOCK = 35 -- plants per 80x80x80 nodes (absolute maximum number)
REEDMACE_NEAR_WATER_RARITY = 40 -- percent
-- Amount of Reedmace in water
REEDMACE_IN_WATER_PER_MAPBLOCK = 35 -- plants per 80x80x80 nodes (absolute maximum number)
REEDMACE_IN_WATER_RARITY = 65 -- percent
-- Amount of Reedmace for oases, tropical beaches and tropical swamps
REEDMACE_FOR_OASES_PER_MAPBLOCK = 35 -- plants per 80x80x80 nodes (absolute maximum number)
REEDMACE_FOR_OASES_RARITY = 90 -- percent
-- growing of reedmace sapling
REEDMACE_GROWING_TIME = 16800 -- seconds
REEDMACE_GROWING_CHANCE = 5 -- percent
-- Amount of small Juncus near water or swamp
JUNCUS_NEAR_WATER_PER_MAPBLOCK = 70 -- plants per 80x80x80 nodes (absolute maximum number)
JUNCUS_NEAR_WATER_RARITY = 75 -- percent
-- Amount of small Juncus at dunes/beach
JUNCUS_AT_BEACH_PER_MAPBLOCK = 70 -- plants per 80x80x80 nodes (absolute maximum number)
JUNCUS_AT_BEACH_RARITY = 75 -- percent
-- Tall Grass on dirt with grass
TALL_GRASS_PER_MAPBLOCK = 4800 -- plants per 80x80x80 nodes (absolute maximum number)
TALL_GRASS_RARITY = 75 -- percent
-- short grass becomes dirt with grass again
GRASS_REGROWING_TIME = 16800 -- seconds
GRASS_REGROWING_CHANCE = 0.5 -- percent
HAY_DRYING_TIME = 3600 -- seconds
REED_WILL_DRY = false -- wet reed nodes will become dry reed nodes
REED_DRYING_TIME = 3600 -- seconds
AUTO_ROOF_CORNER = true
-- Here you can enable/disable the different plants
REEDMACE_GENERATES = true
SMALL_JUNCUS_GENERATES = true
EXTRA_TALL_GRASS_GENERATES = true
-- Amount of Reedmace near water or swamp
REEDMACE_NEAR_WATER_PER_MAPBLOCK = 35 -- plants per 80x80x80 nodes (absolute maximum number)
REEDMACE_NEAR_WATER_RARITY = 40 -- percent
-- Amount of Reedmace in water
REEDMACE_IN_WATER_PER_MAPBLOCK = 35 -- plants per 80x80x80 nodes (absolute maximum number)
REEDMACE_IN_WATER_RARITY = 65 -- percent
-- Amount of Reedmace for oases, tropical beaches and tropical swamps
REEDMACE_FOR_OASES_PER_MAPBLOCK = 35 -- plants per 80x80x80 nodes (absolute maximum number)
REEDMACE_FOR_OASES_RARITY = 90 -- percent
-- growing of reedmace sapling
REEDMACE_GROWING_TIME = 16800 -- seconds
REEDMACE_GROWING_CHANCE = 5 -- percent
-- Amount of small Juncus near water or swamp
JUNCUS_NEAR_WATER_PER_MAPBLOCK = 70 -- plants per 80x80x80 nodes (absolute maximum number)
JUNCUS_NEAR_WATER_RARITY = 75 -- percent
-- Amount of small Juncus at dunes/beach
JUNCUS_AT_BEACH_PER_MAPBLOCK = 70 -- plants per 80x80x80 nodes (absolute maximum number)
JUNCUS_AT_BEACH_RARITY = 75 -- percent
-- Tall Grass on dirt with grass
TALL_GRASS_PER_MAPBLOCK = 4800 -- plants per 80x80x80 nodes (absolute maximum number)
TALL_GRASS_RARITY = 75 -- percent
-- short grass becomes dirt with grass again
GRASS_REGROWING_TIME = 16800 -- seconds
GRASS_REGROWING_CHANCE = 0.5 -- percent
HAY_DRYING_TIME = 3600 -- seconds
REED_WILL_DRY = false -- wet reed nodes will become dry reed nodes
REED_DRYING_TIME = 3600 -- seconds
AUTO_ROOF_CORNER = true

Binary file not shown.

Before

Width:  |  Height:  |  Size: 313 B

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 419 B

After

Width:  |  Height:  |  Size: 315 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 530 B

After

Width:  |  Height:  |  Size: 428 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 624 B

After

Width:  |  Height:  |  Size: 525 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 710 B

After

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 571 B

After

Width:  |  Height:  |  Size: 486 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 868 B

After

Width:  |  Height:  |  Size: 771 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 502 B

After

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 605 B

After

Width:  |  Height:  |  Size: 512 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 850 B

After

Width:  |  Height:  |  Size: 670 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 904 B

After

Width:  |  Height:  |  Size: 720 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 685 B

After

Width:  |  Height:  |  Size: 600 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 795 B

After

Width:  |  Height:  |  Size: 685 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 767 B

After

Width:  |  Height:  |  Size: 672 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 734 B

After

Width:  |  Height:  |  Size: 615 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 864 B

After

Width:  |  Height:  |  Size: 708 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 582 B

After

Width:  |  Height:  |  Size: 455 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 575 B

After

Width:  |  Height:  |  Size: 491 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 446 B

After

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 675 B

After

Width:  |  Height:  |  Size: 588 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 B

After

Width:  |  Height:  |  Size: 147 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 444 B

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 477 B

After

Width:  |  Height:  |  Size: 393 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 712 B

After

Width:  |  Height:  |  Size: 621 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 497 B

After

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 473 B

After

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 768 B

After

Width:  |  Height:  |  Size: 665 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 487 B

After

Width:  |  Height:  |  Size: 362 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 910 B

After

Width:  |  Height:  |  Size: 708 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 205 B

After

Width:  |  Height:  |  Size: 122 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 277 B

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 272 B

After

Width:  |  Height:  |  Size: 185 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 281 B

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 B

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 245 B

After

Width:  |  Height:  |  Size: 147 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 463 B

After

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 455 B

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 459 B

After

Width:  |  Height:  |  Size: 371 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 481 B

After

Width:  |  Height:  |  Size: 389 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 511 B

After

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 491 B

After

Width:  |  Height:  |  Size: 400 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 234 B

After

Width:  |  Height:  |  Size: 143 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 897 B

After

Width:  |  Height:  |  Size: 734 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 267 B

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 286 B

After

Width:  |  Height:  |  Size: 191 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 777 B

After

Width:  |  Height:  |  Size: 698 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 288 B

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 649 B

After

Width:  |  Height:  |  Size: 556 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 181 B

After

Width:  |  Height:  |  Size: 99 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 504 B

After

Width:  |  Height:  |  Size: 404 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 206 B

After

Width:  |  Height:  |  Size: 120 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 659 B

After

Width:  |  Height:  |  Size: 569 B