3 different twigs, twigs on water, more settings
This commit is contained in:
parent
139f5d9eff
commit
47c8eac79c
@ -1,4 +1,4 @@
|
|||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "default:stick",
|
output = "default:stick",
|
||||||
recipe = {{"trunks:twig"}}
|
recipe = {{"trunks:twig_1"}}
|
||||||
})
|
})
|
@ -3,13 +3,14 @@
|
|||||||
-----------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------
|
||||||
abstract_trunks.place_twig = function(pos)
|
abstract_trunks.place_twig = function(pos)
|
||||||
local right_here = {x=pos.x, y=pos.y+1, z=pos.z}
|
local right_here = {x=pos.x, y=pos.y+1, z=pos.z}
|
||||||
minetest.add_node(right_here, {name="trunks:twig", param2=math.random(0,3)})
|
minetest.add_node(right_here, {name="trunks:twig_"..math.random(1,3), param2=math.random(0,3)})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if Twigs_on_ground == true then
|
||||||
plantslib:register_generate_plant({
|
plantslib:register_generate_plant({
|
||||||
surface = {"default:dirt_with_grass"},
|
surface = {"default:dirt_with_grass"},
|
||||||
max_count = Twigs_Max_Count,
|
max_count = Twigs_on_ground_Max_Count,
|
||||||
rarity = Twigs_Rarity,
|
rarity = Twigs_on_ground_Rarity,
|
||||||
min_elevation = 1,
|
min_elevation = 1,
|
||||||
max_elevation = 40,
|
max_elevation = 40,
|
||||||
near_nodes = {"group:tree","ferns:fern_03","ferns:fern_02","ferns:fern_01"},
|
near_nodes = {"group:tree","ferns:fern_03","ferns:fern_02","ferns:fern_01"},
|
||||||
@ -20,6 +21,24 @@ plantslib:register_generate_plant({
|
|||||||
},
|
},
|
||||||
"abstract_trunks.place_twig"
|
"abstract_trunks.place_twig"
|
||||||
)
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
if Twigs_on_water == true then
|
||||||
|
plantslib:register_generate_plant({
|
||||||
|
surface = {"default:water_source"},
|
||||||
|
max_count = Twigs_on_water_Max_Count,
|
||||||
|
rarity = Twigs_on_water_Rarity,
|
||||||
|
min_elevation = 1,
|
||||||
|
max_elevation = 40,
|
||||||
|
near_nodes = {"group:tree"},
|
||||||
|
near_nodes_size = 3,
|
||||||
|
near_nodes_vertical = 1,
|
||||||
|
near_nodes_count = 1,
|
||||||
|
plantlife_limit = -0.9,
|
||||||
|
},
|
||||||
|
"abstract_trunks.place_twig"
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
-----------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------
|
||||||
-- TRuNKS
|
-- TRuNKS
|
||||||
@ -170,6 +189,7 @@ plantslib:register_generate_plant({
|
|||||||
-----------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------
|
||||||
-- MoSS & FuNGuS -- on ground
|
-- MoSS & FuNGuS -- on ground
|
||||||
-----------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------
|
||||||
|
if Moss_on_ground == true then
|
||||||
abstract_trunks.grow_moss_on_ground = function(pos)
|
abstract_trunks.grow_moss_on_ground = function(pos)
|
||||||
local on_ground = {x=pos.x, y=pos.y+1, z=pos.z}
|
local on_ground = {x=pos.x, y=pos.y+1, z=pos.z}
|
||||||
local moss_type = math.random(1,21)
|
local moss_type = math.random(1,21)
|
||||||
@ -201,10 +221,12 @@ plantslib:register_generate_plant({
|
|||||||
},
|
},
|
||||||
"abstract_trunks.grow_moss_on_ground"
|
"abstract_trunks.grow_moss_on_ground"
|
||||||
)
|
)
|
||||||
|
end
|
||||||
|
|
||||||
-----------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------
|
||||||
-- MoSS & FuNGuS -- on trunks
|
-- MoSS & FuNGuS -- on trunks
|
||||||
-----------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------
|
||||||
|
if Moss_on_trunk == true then
|
||||||
abstract_trunks.grow_moss_on_trunk = function(pos)
|
abstract_trunks.grow_moss_on_trunk = function(pos)
|
||||||
local on_ground = {x=pos.x, y=pos.y+1, z=pos.z}
|
local on_ground = {x=pos.x, y=pos.y+1, z=pos.z}
|
||||||
local at_side_n = {x=pos.x, y=pos.y, z=pos.z+1}
|
local at_side_n = {x=pos.x, y=pos.y, z=pos.z+1}
|
||||||
@ -298,4 +320,5 @@ plantslib:register_generate_plant({
|
|||||||
check_air = false,
|
check_air = false,
|
||||||
},
|
},
|
||||||
"abstract_trunks.grow_moss_on_trunk"
|
"abstract_trunks.grow_moss_on_trunk"
|
||||||
)
|
)
|
||||||
|
end
|
@ -1,6 +1,6 @@
|
|||||||
-----------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------
|
||||||
local title = "Trunks"
|
local title = "Trunks"
|
||||||
local version = "0.0.5"
|
local version = "0.0.6"
|
||||||
local mname = "trunks"
|
local mname = "trunks"
|
||||||
-----------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -1,25 +1,48 @@
|
|||||||
-----------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------
|
||||||
-- TWiG
|
-- TWiGS
|
||||||
-----------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------
|
||||||
local flat_stick = {-1/2, -1/2, -1/2, 1/2, -7/16, 1/2}
|
-- For compatibility with older stuff
|
||||||
|
minetest.register_alias("trunks:twig", "trunks:twig_1")
|
||||||
|
|
||||||
minetest.register_node("trunks:twig", {
|
local flat_stick = {-1/2, -1/2, -1/2, 1/2, -7/16, 1/2}
|
||||||
description = "Twig",
|
local NoDe = { {1}, {2}, {3} }
|
||||||
inventory_image = "trunks_twig.png",
|
|
||||||
wield_image = "trunks_twig.png",
|
for i in pairs(NoDe) do
|
||||||
drawtype = "nodebox",
|
local NR = NoDe[i][1]
|
||||||
tiles = { "trunks_twig.png" },
|
local iNV = NR - 1
|
||||||
paramtype = "light",
|
minetest.register_node("trunks:twig_"..NR, {
|
||||||
paramtype2 = "facedir",
|
description = "Twig",
|
||||||
sunlight_propagates = true,
|
inventory_image = "trunks_twig_"..NR..".png",
|
||||||
buildable_to = true,
|
wield_image = "trunks_twig_"..NR..".png",
|
||||||
node_box = {type = "fixed", fixed = flat_stick},
|
drawtype = "nodebox",
|
||||||
groups = {
|
tiles = { "trunks_twig_"..NR..".png" },
|
||||||
dig_immediate=3, -- almost literally immediate, like just picking up
|
paramtype = "light",
|
||||||
attached_node=1
|
paramtype2 = "facedir",
|
||||||
},
|
walkable = false,
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sunlight_propagates = true,
|
||||||
})
|
buildable_to = true,
|
||||||
|
node_box = {type = "fixed", fixed = flat_stick},
|
||||||
|
groups = {
|
||||||
|
dig_immediate=3, -- almost literally immediate, like just picking up
|
||||||
|
attached_node=1,
|
||||||
|
not_in_creative_inventory=iNV
|
||||||
|
},
|
||||||
|
drop = "trunks:twig_1",
|
||||||
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
|
liquids_pointable = true,
|
||||||
|
on_place = function(itemstack, placer, pointed_thing)
|
||||||
|
local pt = pointed_thing
|
||||||
|
local direction = minetest.dir_to_facedir(placer:get_look_dir())
|
||||||
|
if minetest.get_node(pt.above).name=="air" then
|
||||||
|
minetest.set_node(pt.above, {name="trunks:twig_"..math.random(1,3), param2=direction})
|
||||||
|
if not minetest.setting_getbool("creative_mode") then
|
||||||
|
itemstack:take_item()
|
||||||
|
end
|
||||||
|
return itemstack
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
-----------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------
|
||||||
-- MoSS
|
-- MoSS
|
||||||
@ -36,7 +59,6 @@ minetest.register_node("trunks:moss", {
|
|||||||
walkable = false,
|
walkable = false,
|
||||||
selection_box = {type = "wallmounted"},
|
selection_box = {type = "wallmounted"},
|
||||||
groups = {dig_immediate=2,attached_node=1},
|
groups = {dig_immediate=2,attached_node=1},
|
||||||
--legacy_wallmounted = true,
|
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -55,6 +77,5 @@ minetest.register_node("trunks:moss_fungus", {
|
|||||||
walkable = false,
|
walkable = false,
|
||||||
selection_box = {type = "wallmounted"},
|
selection_box = {type = "wallmounted"},
|
||||||
groups = {dig_immediate=2,attached_node=1},
|
groups = {dig_immediate=2,attached_node=1},
|
||||||
--legacy_wallmounted = true,
|
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
})
|
})
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 277 B |
BIN
trunks/textures/trunks_twig_1.png
Normal file
BIN
trunks/textures/trunks_twig_1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 244 B |
BIN
trunks/textures/trunks_twig_2.png
Normal file
BIN
trunks/textures/trunks_twig_2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 251 B |
BIN
trunks/textures/trunks_twig_3.png
Normal file
BIN
trunks/textures/trunks_twig_3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 262 B |
@ -1,15 +1,48 @@
|
|||||||
-- Settings for generation of trunks (at map-generation time)
|
-- Settings for generation of stuff (at map-generation time)
|
||||||
|
|
||||||
Horizontal_Trunks = true
|
|
||||||
|
|
||||||
Trunks_Max_Count = 320 -- absolute maximum number in an area of 80x80x80 nodes
|
|
||||||
Trunks_Rarity = 99 -- larger values make trunks more rare (100 means chance of 0 %)
|
|
||||||
|
|
||||||
Twigs_Max_Count = 640 -- absolute maximum number in an area of 80x80x80 nodes
|
|
||||||
Twigs_Rarity = 66 -- larger values make twigs more rare (100 means chance of 0 %)
|
Horizontal_Trunks = true
|
||||||
|
|
||||||
|
|
||||||
|
Trunks_Max_Count = 320 -- absolute maximum number in an area of 80x80x80 nodes
|
||||||
|
|
||||||
|
Trunks_Rarity = 99 -- larger values make trunks more rare (100 means chance of 0 %)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Twigs_on_ground = true
|
||||||
|
|
||||||
|
|
||||||
|
Twigs_on_ground_Max_Count = 640 -- absolute maximum number in an area of 80x80x80 nodes
|
||||||
|
Twigs_on_ground_Rarity = 66 -- larger values make twigs more rare (100 means chance of 0 %)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Twigs_on_water = true
|
||||||
|
|
||||||
|
|
||||||
|
Twigs_on_water_Max_Count = 320 -- absolute maximum number in an area of 80x80x80 nodes
|
||||||
|
|
||||||
|
Twigs_on_water_Rarity = 33 -- larger values make twigs more rare (100 means chance of 0 %)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Moss_on_ground = true
|
||||||
|
|
||||||
|
|
||||||
Moss_on_ground_Max_Count = 400 -- absolute maximum number in an area of 80x80x80 nodes
|
Moss_on_ground_Max_Count = 400 -- absolute maximum number in an area of 80x80x80 nodes
|
||||||
Moss_on_ground_Rarity = 79 -- larger values makes moss more rare (100 means chance of 0 %)
|
Moss_on_ground_Rarity = 79 -- larger values makes moss more rare (100 means chance of 0 %)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Moss_on_trunk = true
|
||||||
|
|
||||||
|
|
||||||
Moss_on_trunk_Max_Count = 640 -- absolute maximum number in an area of 80x80x80 nodes
|
Moss_on_trunk_Max_Count = 640 -- absolute maximum number in an area of 80x80x80 nodes
|
||||||
Moss_on_trunk_Rarity = 24 -- larger values makes moss more rare (100 means chance of 0 %)
|
Moss_on_trunk_Rarity = 24 -- larger values makes moss more rare (100 means chance of 0 %)
|
Loading…
x
Reference in New Issue
Block a user