Imported dryplants and ferns mods and all components of the Undergrowth modpack
5
LICENSE
@ -1,6 +1,9 @@
|
||||
|
||||
For the code, Ironzorg's textures, and everything else: WTFPL
|
||||
For all of my own textures: CC-By-SA 3.0
|
||||
|
||||
For Mossmannikin's mods (Ferns, Dryplans, and the components
|
||||
from the Undergrowth modpack), and all of my own textures:
|
||||
CC-By-SA 3.0
|
||||
|
||||
----------
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
|
3
along_shore/depends.txt
Normal file
@ -0,0 +1,3 @@
|
||||
default
|
||||
plants_lib
|
||||
flowers_plus?
|
9
along_shore/init.lua
Normal file
@ -0,0 +1,9 @@
|
||||
-----------------------------------------------------------------------------------------------
|
||||
local title = "Along the Shore"
|
||||
local version = "0.0.4"
|
||||
local mname = "along_shore"
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
print("[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...")
|
||||
-----------------------------------------------------------------------------------------------
|
BIN
along_shore/textures/along_shore_seaweed_1Darker.png
Normal file
After Width: | Height: | Size: 377 B |
30
along_shore/textures/credit_textures.txt
Normal file
@ -0,0 +1,30 @@
|
||||
-------------------------------------------------------------
|
||||
Credit for textures of "along_shore"
|
||||
-------------------------------------------------------------
|
||||
(If more than one author is listed the names are in alphabetical order)
|
||||
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
FOLDER TEXTURE AUTHORS
|
||||
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
../along_shore/textures along_shore_seaweed_1Darker.png Neuromancer, VanessaE
|
||||
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
../along_shore/textures/old (along_shore_empty.png) (Mossmanikin)
|
||||
along_shore_lilypads_1.png Mossmanikin, Neuromancer
|
||||
along_shore_lilypads_2.png Mossmanikin, Neuromancer
|
||||
along_shore_lilypads_3.png Mossmanikin, Neuromancer
|
||||
along_shore_lilypads_4.png Mossmanikin, Neuromancer
|
||||
along_shore_pondscum_1.png Neuromancer
|
||||
along_shore_seaweed_1.png Neuromancer, VanessaE
|
||||
along_shore_seaweed_2.png Mossmanikin, Neuromancer, VanessaE
|
||||
along_shore_seaweed_3.png Mossmanikin, Neuromancer, VanessaE
|
||||
along_shore_seaweed_4.png Mossmanikin, Neuromancer, VanessaE
|
||||
flowers_seaweed.png Neuromancer, VanessaE
|
||||
flowers_waterlily.png Mossmanikin, VanessaE
|
||||
flowers_waterlily_22.5.png Mossmanikin, VanessaE
|
||||
flowers_waterlily_45.png Mossmanikin, VanessaE
|
||||
flowers_waterlily_67.5.png Mossmanikin, VanessaE
|
||||
lillypad3Flower16x.png Neuromancer
|
||||
LillyPad3x16.png Neuromancer
|
||||
lillyPad5x16.png Neuromancer
|
||||
MultiLilly16x.png Neuromancer
|
||||
pondscum16xc.png Neuromancer
|
||||
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
BIN
along_shore/textures/old/LillyPad3x16.png
Normal file
After Width: | Height: | Size: 589 B |
BIN
along_shore/textures/old/MultiLilly16x.png
Normal file
After Width: | Height: | Size: 462 B |
BIN
along_shore/textures/old/along_shore_empty.png
Normal file
After Width: | Height: | Size: 153 B |
BIN
along_shore/textures/old/along_shore_lilypads_1.png
Normal file
After Width: | Height: | Size: 499 B |
BIN
along_shore/textures/old/along_shore_lilypads_2.png
Normal file
After Width: | Height: | Size: 568 B |
BIN
along_shore/textures/old/along_shore_lilypads_3.png
Normal file
After Width: | Height: | Size: 509 B |
BIN
along_shore/textures/old/along_shore_lilypads_4.png
Normal file
After Width: | Height: | Size: 347 B |
BIN
along_shore/textures/old/along_shore_pondscum_1.png
Normal file
After Width: | Height: | Size: 703 B |
BIN
along_shore/textures/old/along_shore_seaweed_1.png
Normal file
After Width: | Height: | Size: 358 B |
BIN
along_shore/textures/old/along_shore_seaweed_2.png
Normal file
After Width: | Height: | Size: 364 B |
BIN
along_shore/textures/old/along_shore_seaweed_3.png
Normal file
After Width: | Height: | Size: 383 B |
BIN
along_shore/textures/old/along_shore_seaweed_4.png
Normal file
After Width: | Height: | Size: 301 B |
BIN
along_shore/textures/old/flowers_seaweed.png
Normal file
After Width: | Height: | Size: 358 B |
BIN
along_shore/textures/old/flowers_waterlily.png
Normal file
After Width: | Height: | Size: 491 B |
BIN
along_shore/textures/old/flowers_waterlily_22.5.png
Normal file
After Width: | Height: | Size: 519 B |
BIN
along_shore/textures/old/flowers_waterlily_45.png
Normal file
After Width: | Height: | Size: 507 B |
BIN
along_shore/textures/old/flowers_waterlily_67.5.png
Normal file
After Width: | Height: | Size: 512 B |
BIN
along_shore/textures/old/lillyPad5x16.png
Normal file
After Width: | Height: | Size: 460 B |
BIN
along_shore/textures/old/lillypad3Flower16x.png
Normal file
After Width: | Height: | Size: 556 B |
BIN
along_shore/textures/old/pondscum16xc.png
Normal file
After Width: | Height: | Size: 703 B |
2
bushes/depends.txt
Normal file
@ -0,0 +1,2 @@
|
||||
default
|
||||
plants_lib
|
258
bushes/init.lua
Normal file
@ -0,0 +1,258 @@
|
||||
-- Bushes Mod by Mossmanikin, Evergreen, & Neuromancer
|
||||
-- The initial code for this was taken from Mossmanikin's Grasses Mod, then heavilly modified by Neuromancer for this mod.
|
||||
-- Mossmanikin also greatly helped with providing samples for coding.
|
||||
-- bush leaf textures are cc-by-sa 3.0. from VannessaE's moretrees mod. (Leaf texture created by RealBadAngel or VanessaE)
|
||||
-- Branch textures created by Neuromancer.
|
||||
-- Licence for Code and Non-Bush leaf code is WTFPL.
|
||||
|
||||
abstract_bushes = {}
|
||||
|
||||
minetest.register_node("bushes:youngtree2_bottom", {
|
||||
description = "youngtree2Bottom",
|
||||
drawtype="nodebox",
|
||||
tiles = {"youngtree2trunk.png"},
|
||||
inventory_image = "youngtree2trunk.png",
|
||||
wield_image = "youngtree2trunk.png",
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
is_ground_content = true,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
--{0.375000,-0.500000,-0.500000,0.500000,0.500000,-0.375000}, --NodeBox 1
|
||||
{-0.0612,-0.500000,-0.500000,0.0612,0.500000,-0.375000}, --NodeBox 1
|
||||
}
|
||||
},
|
||||
groups = {snappy=3,flammable=2},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
local BushBranchCenter = { {1,1}, {3,2} }
|
||||
for i in pairs(BushBranchCenter) do
|
||||
local Num = BushBranchCenter[i][1]
|
||||
local TexNum = BushBranchCenter[i][2]
|
||||
minetest.register_node("bushes:bushbranches"..Num, {
|
||||
description = "Bush Branches "..Num,
|
||||
drawtype = "nodebox",
|
||||
tiles = {
|
||||
"bushes_leaves_"..TexNum..".png",
|
||||
"bushes_branches_center_"..TexNum..".png"
|
||||
},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{0, -1/2, -1/2, -1/4, 1/2, 1/2},
|
||||
{0, -1/2, -1/2, 1/4, 1/2, 1/2}
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-1/2, -1/2, -1/2, 1/2, 1/2, 1/2},
|
||||
},
|
||||
inventory_image = "bushes_branches_center_"..TexNum..".png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
sunlight_propagates = true,
|
||||
groups = {
|
||||
-- tree=1, -- MM: disabled because some recipes use group:tree for trunks
|
||||
snappy=3,
|
||||
flammable=2,
|
||||
leaves=1
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
end
|
||||
|
||||
local BushBranchSide = { {2,1}, {4,2} }
|
||||
for i in pairs(BushBranchSide) do
|
||||
local Num = BushBranchSide[i][1]
|
||||
local TexNum = BushBranchSide[i][2]
|
||||
minetest.register_node("bushes:bushbranches"..Num, {
|
||||
description = "Bush Branches "..Num,
|
||||
drawtype = "nodebox",
|
||||
tiles = {
|
||||
--[[top]] "bushes_leaves_"..TexNum..".png",
|
||||
--[[bottom]]"bushes_branches_center_"..TexNum..".png",
|
||||
--[[right]] "bushes_branches_left_"..TexNum..".png",
|
||||
--[[left]] "bushes_branches_right_"..TexNum..".png", -- MM: We could also mirror the previous here,
|
||||
--[[back]] "bushes_branches_center_"..TexNum..".png",-- unless U really want 'em 2 B different
|
||||
--[[front]] "bushes_branches_right_"..TexNum..".png"
|
||||
},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
-- { left , bottom , front, right , top , back }
|
||||
{0.137748,-0.491944, 0.5 ,-0.125000,-0.179444,-0.007790}, --NodeBox 1
|
||||
{0.262748,-0.185995, 0.5 ,-0.237252, 0.126505,-0.260269}, --NodeBox 2
|
||||
{0.500000, 0.125000, 0.5 ,-0.500000, 0.500000,-0.500000}, --NodeBox 3
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-1/2, -1/2, -1/2, 1/2, 1/2, 1/2},
|
||||
},
|
||||
inventory_image = "bushes_branches_right_"..TexNum..".png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
sunlight_propagates = true,
|
||||
groups = {
|
||||
-- tree=1, -- MM: disabled because some recipes use group:tree for trunks
|
||||
snappy=3,
|
||||
flammable=2,
|
||||
leaves=1
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
end
|
||||
|
||||
local BushLeafNode = { {1}, {2}}
|
||||
for i in pairs(BushLeafNode) do
|
||||
local Num = BushLeafNode[i][1]
|
||||
minetest.register_node("bushes:BushLeaves"..Num, {
|
||||
description = "Bush Leaves "..Num,
|
||||
drawtype = "allfaces_optional",
|
||||
tiles = {"bushes_leaves_"..Num..".png"},
|
||||
inventory_image = "bushes_leaves_"..Num..".png",
|
||||
paramtype = "light",
|
||||
groups = { -- MM: Should we add leafdecay?
|
||||
snappy=3,
|
||||
flammable=2,
|
||||
attached_node=1
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
end
|
||||
|
||||
abstract_bushes.grow_bush = function(pos)
|
||||
local leaf_type = math.random(1,2)
|
||||
local bush_side_height = math.random(0,1)
|
||||
local chance_of_bush_node_right = math.random(1,10)
|
||||
if chance_of_bush_node_right> 5 then
|
||||
local right_pos = {x=pos.x+1, y=pos.y+bush_side_height, z=pos.z}
|
||||
abstract_bushes.grow_bush_node(right_pos,3,leaf_type)
|
||||
end
|
||||
local chance_of_bush_node_left = math.random(1,10)
|
||||
if chance_of_bush_node_left> 5 then
|
||||
bush_side_height = math.random(0,1)
|
||||
local left_pos = {x=pos.x-1, y=pos.y+bush_side_height, z=pos.z}
|
||||
abstract_bushes.grow_bush_node(left_pos,1,leaf_type)
|
||||
end
|
||||
local chance_of_bush_node_front = math.random(1,10)
|
||||
if chance_of_bush_node_front> 5 then
|
||||
bush_side_height = math.random(0,1)
|
||||
local front_pos = {x=pos.x, y=pos.y+bush_side_height, z=pos.z+1}
|
||||
abstract_bushes.grow_bush_node(front_pos,2,leaf_type)
|
||||
end
|
||||
local chance_of_bush_node_back = math.random(1,10)
|
||||
if chance_of_bush_node_back> 5 then
|
||||
bush_side_height = math.random(0,1)
|
||||
local back_pos = {x=pos.x, y=pos.y+bush_side_height, z=pos.z-1}
|
||||
abstract_bushes.grow_bush_node(back_pos,0,leaf_type)
|
||||
end
|
||||
|
||||
abstract_bushes.grow_bush_node(pos,5,leaf_type)
|
||||
end
|
||||
|
||||
abstract_bushes.grow_bush_node = function(pos,dir, leaf_type)
|
||||
|
||||
|
||||
local right_here = {x=pos.x, y=pos.y+1, z=pos.z}
|
||||
local above_right_here = {x=pos.x, y=pos.y+2, z=pos.z}
|
||||
|
||||
--local bush_branch_type = math.random(1,3)
|
||||
--local bush_branch_type = 2
|
||||
|
||||
-- MM: I'm not sure if it's slower now than before...
|
||||
if dir ~= 5 and leaf_type == 1 then
|
||||
bush_branch_type = 2
|
||||
end
|
||||
if dir ~= 5 and leaf_type == 2 then
|
||||
bush_branch_type = 4
|
||||
end
|
||||
if dir == 5 and leaf_type == 1 then
|
||||
bush_branch_type = 1
|
||||
dir = 1
|
||||
end
|
||||
if dir == 5 and leaf_type == 2 then
|
||||
bush_branch_type = 3
|
||||
dir = 1
|
||||
end
|
||||
|
||||
if minetest.get_node(right_here).name == "air" -- instead of check_air = true,
|
||||
or minetest.get_node(right_here).name == "default:junglegrass" then
|
||||
minetest.add_node(right_here, {name="bushes:bushbranches"..bush_branch_type , param2=dir})
|
||||
--minetest.chat_send_all("leaf_type: (" .. leaf_type .. ")")
|
||||
minetest.add_node(above_right_here, {name="bushes:BushLeaves"..leaf_type})
|
||||
local chance_of_high_leaves = math.random(1,10)
|
||||
if chance_of_high_leaves> 5 then
|
||||
local two_above_right_here = {x=pos.x, y=pos.y+3, z=pos.z}
|
||||
--minetest.chat_send_all("leaf_type: (" .. leaf_type .. ")")
|
||||
minetest.add_node(two_above_right_here, {name="bushes:BushLeaves"..leaf_type})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
plantslib:register_generate_plant({
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"stoneage:grass_with_silex",
|
||||
"sumpf:peat",
|
||||
"sumpf:sumpf"
|
||||
},
|
||||
max_count = 15, --10,15
|
||||
rarity = 101 - 4, --3,4
|
||||
min_elevation = 1, -- above sea level
|
||||
plantlife_limit = -0.9,
|
||||
check_air = false,
|
||||
},
|
||||
"abstract_bushes.grow_bush"
|
||||
)
|
||||
|
||||
abstract_bushes.grow_youngtree2 = function(pos)
|
||||
local height = math.random(4,5)
|
||||
abstract_bushes.grow_youngtree_node2(pos,height)
|
||||
end
|
||||
|
||||
abstract_bushes.grow_youngtree_node2 = function(pos, height)
|
||||
|
||||
|
||||
local right_here = {x=pos.x, y=pos.y+1, z=pos.z}
|
||||
local above_right_here = {x=pos.x, y=pos.y+2, z=pos.z}
|
||||
local two_above_right_here = {x=pos.x, y=pos.y+3, z=pos.z}
|
||||
local three_above_right_here = {x=pos.x, y=pos.y+4, z=pos.z}
|
||||
|
||||
if minetest.get_node(right_here).name == "air" -- instead of check_air = true,
|
||||
or minetest.get_node(right_here).name == "default:junglegrass" then
|
||||
if height == 4 then
|
||||
local two_above_right_here_south = {x=pos.x, y=pos.y+3, z=pos.z-1}
|
||||
local three_above_right_here_south = {x=pos.x, y=pos.y+4, z=pos.z-1}
|
||||
minetest.add_node(right_here, {name="bushes:youngtree2_bottom"})
|
||||
minetest.add_node(above_right_here, {name="bushes:youngtree2_bottom"})
|
||||
minetest.add_node(two_above_right_here, {name="bushes:bushbranches2" , param2=2})
|
||||
minetest.add_node(two_above_right_here_south, {name="bushes:bushbranches2" , param2=0})
|
||||
minetest.add_node(three_above_right_here, {name="bushes:BushLeaves1" })
|
||||
minetest.add_node(three_above_right_here_south, {name="bushes:BushLeaves1" })
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
plantslib:register_generate_plant({
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"stoneage:grass_with_silex",
|
||||
"sumpf:peat",
|
||||
"sumpf:sumpf"
|
||||
},
|
||||
max_count = 55, --10,15
|
||||
rarity = 101 - 4, --3,4
|
||||
min_elevation = 1, -- above sea level
|
||||
plantlife_limit = -0.9,
|
||||
check_air = false,
|
||||
},
|
||||
"abstract_bushes.grow_youngtree2"
|
||||
)
|
||||
|
||||
--http://dev.minetest.net/Node_Drawtypes
|
BIN
bushes/textures/bushes_branches_center_1.png
Normal file
After Width: | Height: | Size: 473 B |
BIN
bushes/textures/bushes_branches_center_2.png
Normal file
After Width: | Height: | Size: 487 B |
BIN
bushes/textures/bushes_branches_left_1.png
Normal file
After Width: | Height: | Size: 695 B |
BIN
bushes/textures/bushes_branches_left_2.png
Normal file
After Width: | Height: | Size: 689 B |
BIN
bushes/textures/bushes_branches_right_1.png
Normal file
After Width: | Height: | Size: 712 B |
BIN
bushes/textures/bushes_branches_right_2.png
Normal file
After Width: | Height: | Size: 719 B |
BIN
bushes/textures/bushes_leaves_1.png
Normal file
After Width: | Height: | Size: 225 B |
BIN
bushes/textures/bushes_leaves_2.png
Normal file
After Width: | Height: | Size: 225 B |
BIN
bushes/textures/old & unused/BlockBranch1.png
Normal file
After Width: | Height: | Size: 90 KiB |
BIN
bushes/textures/old & unused/BlockBranch1L.png
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
bushes/textures/old & unused/BlockBranch1R.png
Normal file
After Width: | Height: | Size: 49 KiB |
BIN
bushes/textures/old & unused/BushBranches1.png
Normal file
After Width: | Height: | Size: 60 KiB |
BIN
bushes/textures/old & unused/BushBranches1sm.png
Normal file
After Width: | Height: | Size: 702 B |
BIN
bushes/textures/old & unused/BushBranches1sm2.png
Normal file
After Width: | Height: | Size: 714 B |
BIN
bushes/textures/old & unused/BushBranches1sm3.png
Normal file
After Width: | Height: | Size: 536 B |
BIN
bushes/textures/old & unused/BushBranches1sm4.png
Normal file
After Width: | Height: | Size: 649 B |
BIN
bushes/textures/old & unused/BushBranchesCenter.png
Normal file
After Width: | Height: | Size: 445 B |
BIN
bushes/textures/old & unused/BushBranchesSide1.png
Normal file
After Width: | Height: | Size: 770 B |
BIN
bushes/textures/old & unused/BushBranchesSide2.png
Normal file
After Width: | Height: | Size: 801 B |
BIN
bushes/textures/old & unused/blank.png
Normal file
After Width: | Height: | Size: 199 B |
BIN
bushes/textures/old & unused/moretrees_pine_leaves3.png
Normal file
After Width: | Height: | Size: 647 B |
BIN
bushes/textures/youngtree2trunk.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
2
cavestuff/depends.txt
Normal file
@ -0,0 +1,2 @@
|
||||
default
|
||||
|
12
cavestuff/init.lua
Normal file
@ -0,0 +1,12 @@
|
||||
-----------------------------------------------------------------------------------------------
|
||||
local title = "Cave Stuff"
|
||||
local version = "0.0.3"
|
||||
local mname = "cavestuff"
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
dofile(minetest.get_modpath("cavestuff").."/nodes.lua")
|
||||
dofile(minetest.get_modpath("cavestuff").."/mapgen.lua")
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
print("[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...")
|
52
cavestuff/mapgen.lua
Normal file
@ -0,0 +1,52 @@
|
||||
--Map Generation Stuff
|
||||
|
||||
minetest.register_on_generated(function(minp, maxp, seed)
|
||||
if maxp.y >= 2 and minp.y <= 0 then
|
||||
-- Generate pebbles
|
||||
local perlin1 = minetest.get_perlin(329, 3, 0.6, 100)
|
||||
-- Assume X and Z lengths are equal
|
||||
local divlen = 16
|
||||
local divs = (maxp.x-minp.x)/divlen+1;
|
||||
for divx=0,divs-1 do
|
||||
for divz=0,divs-1 do
|
||||
local x0 = minp.x + math.floor((divx+0)*divlen)
|
||||
local z0 = minp.z + math.floor((divz+0)*divlen)
|
||||
local x1 = minp.x + math.floor((divx+1)*divlen)
|
||||
local z1 = minp.z + math.floor((divz+1)*divlen)
|
||||
-- Determine pebble amount from perlin noise
|
||||
local pebble_amount = math.floor(perlin1:get2d({x=x0, y=z0}) ^ 2 * 2)
|
||||
-- Find random positions for pebbles based on this random
|
||||
local pr = PseudoRandom(seed+1)
|
||||
for i=0,pebble_amount do
|
||||
local x = pr:next(x0, x1)
|
||||
local z = pr:next(z0, z1)
|
||||
-- Find ground level (0...15)
|
||||
local ground_y = nil
|
||||
for y=30,0,-1 do
|
||||
if minetest.get_node({x=x,y=y,z=z}).name ~= "air" then
|
||||
ground_y = y
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if ground_y then
|
||||
local p = {x=x,y=ground_y+1,z=z}
|
||||
local nn = minetest.get_node(p).name
|
||||
-- Check if the node can be replaced
|
||||
if minetest.registered_nodes[nn] and
|
||||
minetest.registered_nodes[nn].buildable_to then
|
||||
nn = minetest.get_node({x=x,y=ground_y,z=z}).name
|
||||
-- If desert sand, add dry shrub
|
||||
if nn == "default:dirt_with_grass" then
|
||||
minetest.set_node(p,{name="cavestuff:pebble_"..pr:next(1,2), param2=math.random(0,3)})
|
||||
elseif nn == "default:desert_sand" then
|
||||
minetest.set_node(p,{name="cavestuff:desert_pebble_"..pr:next(1,2), param2=math.random(0,3)})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
243
cavestuff/nodes.lua
Normal file
@ -0,0 +1,243 @@
|
||||
--Rocks
|
||||
|
||||
minetest.register_node("cavestuff:pebble_1",{
|
||||
drawtype = "nodebox",
|
||||
description = "Pebble",
|
||||
tiles = {"undergrowth_pebble.png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {cracky=3, stone=1},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
-- { left, bottom, front, right, top , back}
|
||||
{-5/16, -2/16, -3/16, 1/16, -1/16, -1/16},
|
||||
{-4/16, -2/16, -4/16, 0 , -1/16, 0 },
|
||||
-- { left, bottom, front, right, top , back}
|
||||
{-7/16, -7/16, -3/16, -6/16, -3/16, 1/16},
|
||||
{-6/16, -7/16, -4/16, -5/16, -3/16, 2/16},
|
||||
{-5/16, -7/16, -5/16, 3/16, -3/16, 3/16},
|
||||
{-4/16, -7/16, -6/16, 1/16, -3/16, -5/16},
|
||||
{-3/16, -7/16, 3/16, 3/16, -3/16, 4/16},
|
||||
{ 0 , -7/16, 4/16, 3/16, -3/16, 5/16},
|
||||
{ 3/16, -7/16, -4/16, 4/16, -3/16, 5/16},
|
||||
{ 4/16, -7/16, -3/16, 5/16, -3/16, 4/16},
|
||||
{ 5/16, -7/16, -1/16, 6/16, -3/16, 2/16},
|
||||
-- { left, bottom, front, right, top , back}
|
||||
{-6/16, -8/16, -3/16, 3/16, -2/16, 0 },
|
||||
{-5/16, -8/16, -4/16, 2/16, -2/16, 1/16},
|
||||
{-4/16, -8/16, -5/16, 0 , -2/16, 2/16},
|
||||
{-2/16, -8/16, -2/16, 4/16, -2/16, 3/16},
|
||||
{ 0 , -8/16, 3/16, 3/16, -2/16, 4/16},
|
||||
{ 4/16, -8/16, -1/16, 5/16, -2/16, 2/16},
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-7/16, -1/2, -6/16, 6/16, -1/16, 5/16},
|
||||
},
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
-- place a random pebble node
|
||||
local stack = ItemStack("cavestuff:pebble_"..math.random(1,2))
|
||||
local ret = minetest.item_place(stack, placer, pointed_thing)
|
||||
return ItemStack("cavestuff:pebble_1 "..itemstack:get_count()-(1-ret:get_count()))
|
||||
end,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("cavestuff:pebble_2",{
|
||||
drawtype = "nodebox",
|
||||
drop = "cavestuff:pebble_1",
|
||||
tiles = {"undergrowth_pebble.png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {cracky=3, stone=1, not_in_creative_inventory=1},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
-- { left, bottom, front, right, top , back}
|
||||
{-5/16, -1/16, -3/16, 1/16, 0 , -1/16},
|
||||
{-4/16, -1/16, -4/16, 0 , 0 , 0 },
|
||||
-- { left, bottom, front, right, top , back}
|
||||
{-7/16, -7/16, -3/16, -6/16, -2/16, 1/16},
|
||||
{-6/16, -7/16, -4/16, -5/16, -2/16, 2/16},
|
||||
{-5/16, -7/16, -5/16, 3/16, -2/16, 3/16},
|
||||
{-4/16, -7/16, -6/16, 1/16, -2/16, -5/16},
|
||||
{-3/16, -7/16, 3/16, 3/16, -2/16, 4/16},
|
||||
{ 0 , -7/16, 4/16, 3/16, -2/16, 5/16},
|
||||
{ 3/16, -7/16, -4/16, 4/16, -2/16, 5/16},
|
||||
{ 4/16, -7/16, -3/16, 5/16, -2/16, 4/16},
|
||||
{ 5/16, -7/16, -1/16, 6/16, -2/16, 2/16},
|
||||
-- { left, bottom, front, right, top , back}
|
||||
{-6/16, -8/16, -3/16, 3/16, -1/16, 0 },
|
||||
{-5/16, -8/16, -4/16, 2/16, -1/16, 1/16},
|
||||
{-4/16, -8/16, -5/16, 0 , -1/16, 2/16},
|
||||
{-2/16, -8/16, -2/16, 4/16, -1/16, 3/16},
|
||||
{ 0 , -8/16, 3/16, 3/16, -1/16, 4/16},
|
||||
{ 4/16, -8/16, -1/16, 5/16, -1/16, 2/16},
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-7/16, -1/2, -6/16, 6/16, 0, 5/16},
|
||||
},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("cavestuff:desert_pebble_1",{
|
||||
drawtype = "nodebox",
|
||||
description = "Desert Pebble",
|
||||
tiles = {"default_desert_stone.png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {cracky=3, stone=1},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
-- { left, bottom, front, right, top , back}
|
||||
{-5/16, -2/16, -3/16, 1/16, -1/16, -1/16},
|
||||
{-4/16, -2/16, -4/16, 0 , -1/16, 0 },
|
||||
-- { left, bottom, front, right, top , back}
|
||||
{-7/16, -7/16, -3/16, -6/16, -3/16, 1/16},
|
||||
{-6/16, -7/16, -4/16, -5/16, -3/16, 2/16},
|
||||
{-5/16, -7/16, -5/16, 3/16, -3/16, 3/16},
|
||||
{-4/16, -7/16, -6/16, 1/16, -3/16, -5/16},
|
||||
{-3/16, -7/16, 3/16, 3/16, -3/16, 4/16},
|
||||
{ 0 , -7/16, 4/16, 3/16, -3/16, 5/16},
|
||||
{ 3/16, -7/16, -4/16, 4/16, -3/16, 5/16},
|
||||
{ 4/16, -7/16, -3/16, 5/16, -3/16, 4/16},
|
||||
{ 5/16, -7/16, -1/16, 6/16, -3/16, 2/16},
|
||||
-- { left, bottom, front, right, top , back}
|
||||
{-6/16, -8/16, -3/16, 3/16, -2/16, 0 },
|
||||
{-5/16, -8/16, -4/16, 2/16, -2/16, 1/16},
|
||||
{-4/16, -8/16, -5/16, 0 , -2/16, 2/16},
|
||||
{-2/16, -8/16, -2/16, 4/16, -2/16, 3/16},
|
||||
{ 0 , -8/16, 3/16, 3/16, -2/16, 4/16},
|
||||
{ 4/16, -8/16, -1/16, 5/16, -2/16, 2/16},
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-7/16, -1/2, -6/16, 6/16, -1/16, 5/16},
|
||||
},
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
-- place a random pebble node
|
||||
local stack = ItemStack("cavestuff:desert_pebble_"..math.random(1,2))
|
||||
local ret = minetest.item_place(stack, placer, pointed_thing)
|
||||
return ItemStack("cavestuff:desert_pebble_1 "..itemstack:get_count()-(1-ret:get_count()))
|
||||
end,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("cavestuff:desert_pebble_2",{
|
||||
drawtype = "nodebox",
|
||||
drop = "cavestuff:desert_pebble_1",
|
||||
tiles = {"default_desert_stone.png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {cracky=3, stone=1, not_in_creative__inventory=1},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
-- { left, bottom, front, right, top , back}
|
||||
{-5/16, -1/16, -3/16, 1/16, 0 , -1/16},
|
||||
{-4/16, -1/16, -4/16, 0 , 0 , 0 },
|
||||
-- { left, bottom, front, right, top , back}
|
||||
{-7/16, -7/16, -3/16, -6/16, -2/16, 1/16},
|
||||
{-6/16, -7/16, -4/16, -5/16, -2/16, 2/16},
|
||||
{-5/16, -7/16, -5/16, 3/16, -2/16, 3/16},
|
||||
{-4/16, -7/16, -6/16, 1/16, -2/16, -5/16},
|
||||
{-3/16, -7/16, 3/16, 3/16, -2/16, 4/16},
|
||||
{ 0 , -7/16, 4/16, 3/16, -2/16, 5/16},
|
||||
{ 3/16, -7/16, -4/16, 4/16, -2/16, 5/16},
|
||||
{ 4/16, -7/16, -3/16, 5/16, -2/16, 4/16},
|
||||
{ 5/16, -7/16, -1/16, 6/16, -2/16, 2/16},
|
||||
-- { left, bottom, front, right, top , back}
|
||||
{-6/16, -8/16, -3/16, 3/16, -1/16, 0 },
|
||||
{-5/16, -8/16, -4/16, 2/16, -1/16, 1/16},
|
||||
{-4/16, -8/16, -5/16, 0 , -1/16, 2/16},
|
||||
{-2/16, -8/16, -2/16, 4/16, -1/16, 3/16},
|
||||
{ 0 , -8/16, 3/16, 3/16, -1/16, 4/16},
|
||||
{ 4/16, -8/16, -1/16, 5/16, -1/16, 2/16},
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-7/16, -1/2, -6/16, 6/16, 0, 5/16},
|
||||
},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
--Staclactites
|
||||
|
||||
minetest.register_node("cavestuff:stalactite_1",{
|
||||
drawtype="nodebox",
|
||||
tiles = {"undergrowth_pebble.png"},
|
||||
groups = {cracky=3,attached_node=1},
|
||||
description = "Stalactite",
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.187500,0.425000,-0.150003,0.162500,0.500000,0.162500},
|
||||
{-0.112500,0.162500,-0.100000,0.087500,0.475000,0.087500},
|
||||
{-0.062500,-0.275000,-0.062500,0.062500,0.500000,0.062500},
|
||||
{-0.037500,-0.837500,0.037500,0.037500,0.500000,-0.025000},
|
||||
}
|
||||
},
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local pt = pointed_thing
|
||||
if minetest.get_node(pt.under).name=="default:stone"
|
||||
and minetest.get_node({x=pt.under.x, y=pt.under.y-1, z=pt.under.z}).name=="air"
|
||||
and minetest.get_node({x=pt.under.x, y=pt.under.y-2, z=pt.under.z}).name=="air" then
|
||||
minetest.set_node({x=pt.under.x, y=pt.under.y-1, z=pt.under.z}, {name="cavestuff:stalactite_"..math.random(1,3)})
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("cavestuff:stalactite_2",{
|
||||
drawtype="nodebox",
|
||||
tiles = {"undergrowth_pebble.png"},
|
||||
groups = {cracky=3,attached_node=1,not_in_creative_inventory=1},
|
||||
drop = "cavestuff:stalactite_1",
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.187500,0.387500,-0.150003,0.162500,0.500000,0.162500},
|
||||
{-0.112500,0.112500,-0.100000,0.087500,0.475000,0.087500},
|
||||
{-0.062500,-0.675000,-0.062500,0.062500,0.500000,0.062500},
|
||||
{-0.037500,-0.975000,0.037500,0.037500,0.500000,-0.025000},
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_node("cavestuff:stalactite_3",{
|
||||
drawtype="nodebox",
|
||||
tiles = {"undergrowth_pebble.png"},
|
||||
groups = {cracky=3,attached_node=1,not_in_creative_inventory=1},
|
||||
drop = "cavestuff:stalactite_1",
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.187500,0.387500,-0.150003,0.162500,0.500000,0.162500},
|
||||
{-0.112500,0.037500,-0.100000,0.087500,0.475000,0.087500},
|
||||
{-0.062500,-0.437500,-0.062500,0.062500,0.500000,0.062500},
|
||||
{-0.037500,-1.237500,0.037500,0.037500,0.500000,-0.025000},
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
--Stalagmites
|
||||
|
||||
|
||||
|
BIN
cavestuff/textures/undergrowth_desert_pebble.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
cavestuff/textures/undergrowth_pebble.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
360
dryplants/crafting.lua
Normal file
@ -0,0 +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"}
|
||||
},
|
||||
})]]
|
3
dryplants/depends.txt
Normal file
@ -0,0 +1,3 @@
|
||||
default
|
||||
farming
|
||||
plants_lib
|
185
dryplants/init.lua
Normal file
@ -0,0 +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.env: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.env: 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.env: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.env:add_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.env:add_node(pos, {name="default:dirt_with_grass"})
|
||||
end,
|
||||
})
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
print("[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...")
|
||||
-----------------------------------------------------------------------------------------------
|
127
dryplants/juncus.lua
Normal file
@ -0,0 +1,127 @@
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- Grasses - Juncus 0.0.5
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- by Mossmanikin
|
||||
-- textures & ideas partly by Neuromancer
|
||||
|
||||
-- License (everything): WTFPL
|
||||
-- Contains code from: plants_lib
|
||||
-- Looked at code from: default
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
abstract_dryplants.grow_juncus = function(pos)
|
||||
local juncus_type = math.random(2,3)
|
||||
local right_here = {x=pos.x, y=pos.y+1, z=pos.z}
|
||||
if minetest.env:get_node(right_here).name == "air" -- instead of check_air = true,
|
||||
or minetest.env:get_node(right_here).name == "default:junglegrass" then
|
||||
if juncus_type == 2 then
|
||||
minetest.env:add_node(right_here, {name="dryplants:juncus_02"})
|
||||
else
|
||||
minetest.env:add_node(right_here, {name="dryplants:juncus"})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_node("dryplants:juncus", {
|
||||
description = "Juncus",
|
||||
drawtype = "plantlike",
|
||||
visual_scale = 2,
|
||||
paramtype = "light",
|
||||
tiles = {"dryplants_juncus_03.png"},
|
||||
inventory_image = "dryplants_juncus_inv.png",
|
||||
walkable = false,
|
||||
groups = {
|
||||
snappy=3,
|
||||
flammable=2,
|
||||
attached_node=1,
|
||||
flora=1
|
||||
--not_in_creative_inventory=1
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-7/16, -1/2, -7/16, 7/16, 0, 7/16},
|
||||
},
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local pos = pointed_thing.under
|
||||
local juncus_type = math.random(2,3)
|
||||
local right_here = {x=pos.x, y=pos.y+1, z=pos.z}
|
||||
if juncus_type == 2 then
|
||||
minetest.env:add_node(right_here, {name="dryplants:juncus_02"})
|
||||
else
|
||||
minetest.env:add_node(right_here, {name="dryplants:juncus"})
|
||||
end
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
minetest.register_node("dryplants:juncus_02", {
|
||||
description = "Juncus",
|
||||
drawtype = "plantlike",
|
||||
visual_scale = 2,
|
||||
paramtype = "light",
|
||||
tiles = {"dryplants_juncus_02.png"},
|
||||
walkable = false,
|
||||
groups = {
|
||||
snappy=3,
|
||||
flammable=2,
|
||||
attached_node=1,
|
||||
flora=1,
|
||||
not_in_creative_inventory=1
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-7/16, -1/2, -7/16, 7/16, 0, 7/16},
|
||||
},
|
||||
drop = "dryplants:juncus",
|
||||
})
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- GENERATE SMALL JUNCUS
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- near water or swamp
|
||||
plantslib:register_generate_plant({
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
--"default:desert_sand",
|
||||
--"default:sand",
|
||||
"stoneage:grass_with_silex",
|
||||
"sumpf:peat",
|
||||
"sumpf:sumpf"
|
||||
},
|
||||
max_count = JUNCUS_NEAR_WATER_PER_MAPBLOCK,
|
||||
rarity = 101 - JUNCUS_NEAR_WATER_RARITY,
|
||||
min_elevation = 1, -- above sea level
|
||||
near_nodes = {"default:water_source","sumpf:dirtywater_source","sumpf:sumpf"},
|
||||
near_nodes_size = 2,
|
||||
near_nodes_vertical = 1,
|
||||
near_nodes_count = 1,
|
||||
plantlife_limit = -0.9,
|
||||
check_air = false,
|
||||
},
|
||||
"abstract_dryplants.grow_juncus"
|
||||
)
|
||||
-- at dunes/beach
|
||||
plantslib:register_generate_plant({
|
||||
surface = {
|
||||
--"default:dirt_with_grass",
|
||||
--"default:desert_sand",
|
||||
"default:sand",
|
||||
--"stoneage:grass_with_silex",
|
||||
--"sumpf:peat",
|
||||
--"sumpf:sumpf"
|
||||
},
|
||||
max_count = JUNCUS_AT_BEACH_PER_MAPBLOCK,
|
||||
rarity = 101 - JUNCUS_AT_BEACH_RARITY,
|
||||
min_elevation = 1, -- above sea level
|
||||
near_nodes = {"default:dirt_with_grass"},
|
||||
near_nodes_size = 2,
|
||||
near_nodes_vertical = 1,
|
||||
near_nodes_count = 1,
|
||||
plantlife_limit = -0.9,
|
||||
check_air = false,
|
||||
},
|
||||
"abstract_dryplants.grow_juncus"
|
||||
)
|
27
dryplants/meadowvariation.lua
Normal file
@ -0,0 +1,27 @@
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- Grasses - Meadow Variation 0.0.1
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- by Mossmanikin
|
||||
|
||||
-- License (everything): WTFPL
|
||||
-- Contains code from: plants_lib
|
||||
-- Looked at code from: default
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
abstract_dryplants.grow_grass_variation = function(pos)
|
||||
local right_here = {x=pos.x, y=pos.y, z=pos.z}
|
||||
minetest.add_node(right_here, {name="dryplants:grass_short"})
|
||||
end
|
||||
|
||||
plantslib:register_generate_plant({
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
},
|
||||
max_count = 4800,
|
||||
rarity = 25,
|
||||
min_elevation = 1, -- above sea level
|
||||
plantlife_limit = -0.9,
|
||||
check_air = false,
|
||||
},
|
||||
"abstract_dryplants.grow_grass_variation"
|
||||
)
|
35
dryplants/moregrass.lua
Normal file
@ -0,0 +1,35 @@
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- 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.add_node(right_here, {name="default:grass_"..grass_size})
|
||||
end
|
||||
end
|
||||
|
||||
plantslib:register_generate_plant({
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"dryplants:grass_short",
|
||||
"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,
|
||||
check_air = false,
|
||||
},
|
||||
"abstract_dryplants.grow_grass"
|
||||
)
|
380
dryplants/reed.lua
Normal file
@ -0,0 +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.env:get_node({x=pos.x+1, y=pos.y, z=pos.z })
|
||||
local node_west = minetest.env:get_node({x=pos.x-1, y=pos.y, z=pos.z })
|
||||
local node_north = minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z+1})
|
||||
local node_south = minetest.env: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.env:add_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.env:add_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.env:add_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.env:add_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.env:add_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.env:add_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.env:add_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.env:add_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.env:add_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(),
|
||||
})
|
410
dryplants/reedmace.lua
Normal file
@ -0,0 +1,410 @@
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- Grasses - Reedmace 0.1.1
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- by Mossmanikin
|
||||
-- textures & ideas partly by Neuromancer
|
||||
|
||||
-- License (everything): WTFPL
|
||||
-- Contains code from: plants_lib
|
||||
-- Looked at code from: default, trees
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
-- NOTES (from wikipedia, some of this might get implemented)
|
||||
-- rhizomes are edible
|
||||
-- outer portion of young plants can be peeled and the heart can be eaten raw or boiled and eaten like asparagus
|
||||
-- leaf bases can be eaten raw or cooked
|
||||
-- sheath can be removed from the developing green flower spike, which can then be boiled and eaten like corn on the cob
|
||||
-- pollen can be collected and used as a flour supplement or thickener
|
||||
-- Typha stems and leaves can be used to make paper
|
||||
-- The seed hairs were used by some Native American groups as tinder for starting fires
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- REEDMACE SHAPES
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
abstract_dryplants.grow_reedmace = function(pos)
|
||||
local size = math.random(1,3)
|
||||
local spikes = math.random(1,3)
|
||||
local pos_01 = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
local pos_02 = {x = pos.x, y = pos.y + 2, z = pos.z}
|
||||
local pos_03 = {x = pos.x, y = pos.y + 3, z = pos.z}
|
||||
if minetest.env:get_node(pos_01).name == "air" -- bug fix
|
||||
or minetest.env:get_node(pos_01).name == "dryplants:reedmace_sapling" then
|
||||
if minetest.env:get_node(pos_02).name ~= "air" then
|
||||
minetest.env:add_node(pos_01, {name="dryplants:reedmace_top"})
|
||||
elseif minetest.env:get_node(pos_03).name ~= "air" then
|
||||
minetest.env:add_node(pos_01, {name="dryplants:reedmace_height_2"})
|
||||
elseif size == 1 then
|
||||
minetest.env:add_node(pos_01, {name="dryplants:reedmace_top"})
|
||||
elseif size == 2 then
|
||||
minetest.env:add_node(pos_01, {name="dryplants:reedmace_height_2"})
|
||||
elseif size == 3 then
|
||||
if spikes == 1 then
|
||||
minetest.env:add_node(pos_01, {name="dryplants:reedmace_height_3_spikes"})
|
||||
else
|
||||
minetest.env:add_node(pos_01, {name="dryplants:reedmace_height_3"})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
abstract_dryplants.grow_reedmace_water = function(pos)
|
||||
local size = math.random(1,3)
|
||||
local spikes = math.random(1,3)
|
||||
local pos_01 = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
local pos_02 = {x = pos.x, y = pos.y + 2, z = pos.z}
|
||||
local pos_03 = {x = pos.x, y = pos.y + 3, z = pos.z}
|
||||
local pos_04 = {x = pos.x, y = pos.y + 4, z = pos.z}
|
||||
minetest.add_entity(pos_01, "dryplants:reedmace_water_entity")
|
||||
if minetest.env:get_node(pos_02).name == "air" then -- bug fix
|
||||
if minetest.env:get_node(pos_03).name ~= "air" then
|
||||
minetest.env:add_node(pos_02, {name="dryplants:reedmace_top"})
|
||||
elseif minetest.env:get_node(pos_04).name ~= "air" then
|
||||
minetest.env:add_node(pos_02, {name="dryplants:reedmace_height_2"})
|
||||
elseif size == 1 then
|
||||
minetest.env:add_node(pos_02, {name="dryplants:reedmace_top"})
|
||||
elseif size == 2 then
|
||||
minetest.env:add_node(pos_02, {name="dryplants:reedmace_height_2"})
|
||||
elseif size == 3 then
|
||||
if spikes == 1 then
|
||||
minetest.env:add_node(pos_02, {name="dryplants:reedmace_height_3_spikes"})
|
||||
else
|
||||
minetest.env:add_node(pos_02, {name="dryplants:reedmace_height_3"})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- REEDMACE SPIKES
|
||||
-----------------------------------------------------------------------------------------------
|
||||
minetest.register_node("dryplants:reedmace_spikes", {
|
||||
description = "Reedmace",
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
tiles = {"dryplants_reedmace_spikes.png"},
|
||||
inventory_image = "dryplants_reedmace_spikes.png",
|
||||
walkable = false,
|
||||
groups = {
|
||||
snappy=3,
|
||||
flammable=2,
|
||||
not_in_creative_inventory=1
|
||||
},
|
||||
drop = 'dryplants:reedmace_sapling',
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
|
||||
},
|
||||
})
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- REEDMACE height: 1
|
||||
-----------------------------------------------------------------------------------------------
|
||||
minetest.register_node("dryplants:reedmace_top", {
|
||||
description = "Reedmace, height: 1",
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
tiles = {"dryplants_reedmace_top.png"},
|
||||
inventory_image = "dryplants_reedmace_top.png",
|
||||
walkable = false,
|
||||
groups = {
|
||||
snappy=3,
|
||||
flammable=2,
|
||||
not_in_creative_inventory=1
|
||||
},
|
||||
drop = 'dryplants:reedmace_sapling',
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
|
||||
},
|
||||
})
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- REEDMACE height: 2
|
||||
-----------------------------------------------------------------------------------------------
|
||||
minetest.register_node("dryplants:reedmace_height_2", {
|
||||
description = "Reedmace, height: 2",
|
||||
drawtype = "plantlike",
|
||||
visual_scale = 2,
|
||||
paramtype = "light",
|
||||
tiles = {"dryplants_reedmace_height_2.png"},
|
||||
inventory_image = "dryplants_reedmace_top.png",
|
||||
walkable = false,
|
||||
groups = {
|
||||
snappy=3,
|
||||
flammable=2--,
|
||||
--not_in_creative_inventory=1
|
||||
},
|
||||
drop = 'dryplants:reedmace_sapling',
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
|
||||
},
|
||||
})
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- REEDMACE height: 3
|
||||
-----------------------------------------------------------------------------------------------
|
||||
minetest.register_node("dryplants:reedmace_height_3", {
|
||||
description = "Reedmace, height: 3",
|
||||
drawtype = "plantlike",
|
||||
visual_scale = 2,
|
||||
paramtype = "light",
|
||||
tiles = {"dryplants_reedmace_height_3.png"},
|
||||
inventory_image = "dryplants_reedmace_top.png",
|
||||
walkable = false,
|
||||
groups = {
|
||||
snappy=3,
|
||||
flammable=2--,
|
||||
--not_in_creative_inventory=1
|
||||
},
|
||||
drop = 'dryplants:reedmace_sapling',
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
|
||||
},
|
||||
})
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- REEDMACE height: 3 & Spikes
|
||||
-----------------------------------------------------------------------------------------------
|
||||
minetest.register_node("dryplants:reedmace_height_3_spikes", {
|
||||
description = "Reedmace, height: 3 & Spikes",
|
||||
drawtype = "plantlike",
|
||||
visual_scale = 2,
|
||||
paramtype = "light",
|
||||
tiles = {"dryplants_reedmace_height_3_spikes.png"},
|
||||
inventory_image = "dryplants_reedmace_top.png",
|
||||
walkable = false,
|
||||
groups = {
|
||||
snappy=3,
|
||||
flammable=2--,
|
||||
--not_in_creative_inventory=1
|
||||
},
|
||||
drop = 'dryplants:reedmace_sapling',
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
|
||||
},
|
||||
})
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- REEDMACE STEMS
|
||||
-----------------------------------------------------------------------------------------------
|
||||
minetest.register_node("dryplants:reedmace", {
|
||||
description = "Reedmace",
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
tiles = {"dryplants_reedmace.png"},
|
||||
inventory_image = "dryplants_reedmace.png",
|
||||
walkable = false,
|
||||
groups = {
|
||||
snappy=3,
|
||||
flammable=2,
|
||||
not_in_creative_inventory=1
|
||||
},
|
||||
drop = 'dryplants:reedmace_sapling',
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
|
||||
},
|
||||
after_destruct = function(pos,oldnode)
|
||||
local node = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z})
|
||||
if node.name == "dryplants:reedmace_top"
|
||||
or node.name == "dryplants:reedmace_spikes" then
|
||||
minetest.dig_node({x=pos.x,y=pos.y+1,z=pos.z})
|
||||
minetest.add_item(pos,"dryplants:reedmace_sapling")
|
||||
end
|
||||
end,
|
||||
})
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- REEDMACE BOTTOM
|
||||
-----------------------------------------------------------------------------------------------
|
||||
minetest.register_node("dryplants:reedmace_bottom", {
|
||||
description = "Reedmace",
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
tiles = {"dryplants_reedmace_bottom.png"},
|
||||
inventory_image = "dryplants_reedmace_bottom.png",
|
||||
walkable = false,
|
||||
groups = {
|
||||
snappy=3,
|
||||
flammable=2,
|
||||
not_in_creative_inventory=1
|
||||
},
|
||||
drop = 'dryplants:reedmace_sapling',
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
|
||||
},
|
||||
after_destruct = function(pos,oldnode)
|
||||
local node = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z})
|
||||
if node.name == "dryplants:reedmace"
|
||||
or node.name == "dryplants:reedmace_top"
|
||||
or node.name == "dryplants:reedmace_spikes" then
|
||||
minetest.dig_node({x=pos.x,y=pos.y+1,z=pos.z})
|
||||
minetest.add_item(pos,"dryplants:reedmace_sapling")
|
||||
end
|
||||
end,
|
||||
})
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- REEDMACE "SAPLING" (the drop from the above)
|
||||
-----------------------------------------------------------------------------------------------
|
||||
minetest.register_node("dryplants:reedmace_sapling", {
|
||||
description = "Reedmace",
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
tiles = {"dryplants_reedmace_sapling.png"},
|
||||
inventory_image = "dryplants_reedmace_sapling.png",
|
||||
walkable = false,
|
||||
groups = {
|
||||
snappy=3,
|
||||
flammable=2,
|
||||
attached_node=1
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
|
||||
},
|
||||
})
|
||||
-- abm
|
||||
minetest.register_abm({
|
||||
nodenames = "dryplants:reedmace_sapling",
|
||||
interval = REEDMACE_GROWING_TIME,
|
||||
chance = 100/REEDMACE_GROWING_CHANCE,
|
||||
action = function(pos, node, _, _)
|
||||
if string.find(minetest.env:get_node({x = pos.x + 1, y = pos.y, z = pos.z }).name, "default:water")
|
||||
or string.find(minetest.env:get_node({x = pos.x, y = pos.y, z = pos.z + 1}).name, "default:water")
|
||||
or string.find(minetest.env:get_node({x = pos.x - 1, y = pos.y, z = pos.z }).name, "default:water")
|
||||
or string.find(minetest.env:get_node({x = pos.x, y = pos.y, z = pos.z - 1}).name, "default:water") then
|
||||
if minetest.env:get_node({x = pos.x, y = pos.y + 1, z = pos.z}).name == "air" then
|
||||
abstract_dryplants.grow_reedmace_water({x = pos.x, y = pos.y - 1, z = pos.z})
|
||||
end
|
||||
minetest.env:add_node({x=pos.x, y=pos.y, z=pos.z}, {name="default:water_source"})
|
||||
else
|
||||
abstract_dryplants.grow_reedmace({x = pos.x, y = pos.y - 1, z = pos.z})
|
||||
end
|
||||
end
|
||||
})
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- REEDMACE WATER (for entity)
|
||||
-----------------------------------------------------------------------------------------------
|
||||
minetest.register_node("dryplants:reedmace_water", {
|
||||
description = "Reedmace",
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
tiles = {"dryplants_reedmace_water.png"},
|
||||
inventory_image = "dryplants_reedmace_water.png",
|
||||
groups = {not_in_creative_inventory=1},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
|
||||
},
|
||||
})
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- REEDMACE WATER ENTITY
|
||||
-----------------------------------------------------------------------------------------------
|
||||
minetest.register_entity("dryplants:reedmace_water_entity",{
|
||||
visual = "wielditem",
|
||||
visual_size = {x=2/3, y=2/3, z=2/3},
|
||||
textures = {"dryplants:reedmace_water"},
|
||||
collisionbox = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3},
|
||||
on_punch = function(self, puncher)
|
||||
if puncher:is_player() and puncher:get_inventory() then
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
puncher:get_inventory():add_item("main", "dryplants:reedmace_sapling")
|
||||
end
|
||||
self.object:remove()
|
||||
end
|
||||
end,
|
||||
})
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- SPAWN REEDMACE
|
||||
-----------------------------------------------------------------------------------------------
|
||||
--[[plantslib:spawn_on_surfaces({
|
||||
spawn_delay = 1200,
|
||||
spawn_plants = {"dryplants:reedmace_sapling"},
|
||||
spawn_chance = 400,
|
||||
spawn_surfaces = {
|
||||
"default:dirt_with_grass",
|
||||
"default:desert_sand",
|
||||
"default:sand",
|
||||
"dryplants:grass_short",
|
||||
"stoneage:grass_with_silex"
|
||||
},
|
||||
seed_diff = 329,
|
||||
near_nodes = {"default:water_source"},
|
||||
near_nodes_size = 2,
|
||||
near_nodes_vertical = 1,
|
||||
near_nodes_count = 1,
|
||||
})]]
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- GENERATE REEDMACE
|
||||
-----------------------------------------------------------------------------------------------
|
||||
-- near water or swamp
|
||||
plantslib:register_generate_plant({
|
||||
surface = {
|
||||
"default:dirt_with_grass",
|
||||
"default:desert_sand",
|
||||
"stoneage:grass_with_silex",
|
||||
"sumpf:peat",
|
||||
"sumpf:sumpf"
|
||||
},
|
||||
max_count = REEDMACE_NEAR_WATER_PER_MAPBLOCK,
|
||||
rarity = 101 - REEDMACE_NEAR_WATER_RARITY,
|
||||
--rarity = 60,
|
||||
min_elevation = 1, -- above sea level
|
||||
near_nodes = {"default:water_source","sumpf:dirtywater_source","sumpf:sumpf"},
|
||||
near_nodes_size = 2,
|
||||
near_nodes_vertical = 1,
|
||||
near_nodes_count = 1,
|
||||
plantlife_limit = -0.9,
|
||||
},
|
||||
"abstract_dryplants.grow_reedmace"
|
||||
)
|
||||
-- in water
|
||||
plantslib:register_generate_plant({
|
||||
surface = {
|
||||
"default:dirt",
|
||||
"default:dirt_with_grass",
|
||||
--"default:desert_sand",
|
||||
--"stoneage:grass_with_silex",
|
||||
"stoneage:sand_with_silex",
|
||||
"sumpf:peat",
|
||||
"sumpf:sumpf"
|
||||
},
|
||||
max_count = REEDMACE_IN_WATER_PER_MAPBLOCK,
|
||||
rarity = 101 - REEDMACE_IN_WATER_RARITY,
|
||||
--rarity = 35,
|
||||
min_elevation = 0, -- a bit below sea level
|
||||
max_elevation = 0, -- ""
|
||||
near_nodes = {"default:water_source","sumpf:dirtywater_source"},
|
||||
near_nodes_size = 1,
|
||||
near_nodes_count = 1,
|
||||
plantlife_limit = -0.9,
|
||||
},
|
||||
"abstract_dryplants.grow_reedmace_water"
|
||||
)
|
||||
-- for oases & tropical beaches & tropical swamps
|
||||
plantslib:register_generate_plant({
|
||||
surface = {
|
||||
"default:sand",
|
||||
"sumpf:sumpf"
|
||||
},
|
||||
max_count = REEDMACE_FOR_OASES_PER_MAPBLOCK,
|
||||
rarity = 101 - REEDMACE_FOR_OASES_RARITY,
|
||||
--rarity = 10,
|
||||
neighbors = {"default:water_source","sumpf:dirtywater_source","sumpf:sumpf"},
|
||||
ncount = 1,
|
||||
min_elevation = 1, -- above sea level
|
||||
near_nodes = {"default:desert_sand","sumpf:sumpf"},
|
||||
near_nodes_size = 2,
|
||||
near_nodes_vertical = 1,
|
||||
near_nodes_count = 1,
|
||||
plantlife_limit = -0.9,
|
||||
},
|
||||
"abstract_dryplants.grow_reedmace"
|
||||
)
|
52
dryplants/settings.txt
Normal file
@ -0,0 +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
|
||||
|
BIN
dryplants/textures/default_grass_1.png
Normal file
After Width: | Height: | Size: 313 B |
BIN
dryplants/textures/default_grass_2.png
Normal file
After Width: | Height: | Size: 419 B |
BIN
dryplants/textures/default_grass_3.png
Normal file
After Width: | Height: | Size: 530 B |
BIN
dryplants/textures/default_grass_4.png
Normal file
After Width: | Height: | Size: 624 B |
BIN
dryplants/textures/default_grass_5.png
Normal file
After Width: | Height: | Size: 710 B |
BIN
dryplants/textures/dryplants_grass.png
Normal file
After Width: | Height: | Size: 571 B |
BIN
dryplants/textures/dryplants_grass_short.png
Normal file
After Width: | Height: | Size: 868 B |
BIN
dryplants/textures/dryplants_grass_short_side.png
Normal file
After Width: | Height: | Size: 502 B |
BIN
dryplants/textures/dryplants_hay.png
Normal file
After Width: | Height: | Size: 605 B |
BIN
dryplants/textures/dryplants_juncus_02.png
Normal file
After Width: | Height: | Size: 929 B |
BIN
dryplants/textures/dryplants_juncus_03.png
Normal file
After Width: | Height: | Size: 963 B |
BIN
dryplants/textures/dryplants_juncus_inv.png
Normal file
After Width: | Height: | Size: 685 B |
BIN
dryplants/textures/dryplants_reed.png
Normal file
After Width: | Height: | Size: 795 B |
BIN
dryplants/textures/dryplants_reed_wet.png
Normal file
After Width: | Height: | Size: 767 B |
BIN
dryplants/textures/dryplants_reedmace.png
Normal file
After Width: | Height: | Size: 734 B |
BIN
dryplants/textures/dryplants_reedmace_bottom.png
Normal file
After Width: | Height: | Size: 864 B |
BIN
dryplants/textures/dryplants_reedmace_height_2.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
dryplants/textures/dryplants_reedmace_height_3.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
dryplants/textures/dryplants_reedmace_height_3_spikes.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
dryplants/textures/dryplants_reedmace_sapling.png
Normal file
After Width: | Height: | Size: 582 B |
BIN
dryplants/textures/dryplants_reedmace_spikes.png
Normal file
After Width: | Height: | Size: 575 B |
BIN
dryplants/textures/dryplants_reedmace_top.png
Normal file
After Width: | Height: | Size: 446 B |
BIN
dryplants/textures/dryplants_reedmace_water.png
Normal file
After Width: | Height: | Size: 675 B |
BIN
dryplants/textures/dryplants_sickle.png
Normal file
After Width: | Height: | Size: 260 B |
BIN
dryplants/textures/not_in_use/big_pic_8.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
dryplants/textures/not_in_use/big_pic_9.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
dryplants/textures/not_in_use/dryplants_cattailsG_m2.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
dryplants/textures/not_in_use/dryplants_juncus_02_left.png
Normal file
After Width: | Height: | Size: 444 B |
BIN
dryplants/textures/not_in_use/dryplants_juncus_02_right.png
Normal file
After Width: | Height: | Size: 477 B |
BIN
dryplants/textures/not_in_use/dryplants_juncus_02_whole2.png
Normal file
After Width: | Height: | Size: 712 B |
BIN
dryplants/textures/not_in_use/dryplants_juncus_03_left.png
Normal file
After Width: | Height: | Size: 497 B |
BIN
dryplants/textures/not_in_use/dryplants_juncus_03_right.png
Normal file
After Width: | Height: | Size: 473 B |
BIN
dryplants/textures/not_in_use/dryplants_juncus_03_whole2.png
Normal file
After Width: | Height: | Size: 768 B |
BIN
dryplants/textures/not_in_use/dryplants_reedmace_01.png
Normal file
After Width: | Height: | Size: 487 B |
BIN
dryplants/textures/not_in_use/dryplants_reedmace_02.png
Normal file
After Width: | Height: | Size: 910 B |
BIN
dryplants/textures/not_in_use/dryplants_reedmace_03.png
Normal file
After Width: | Height: | Size: 1.3 KiB |