Super flat moss, rotated moss

master
Mossmanikin 2013-10-06 19:12:27 +02:00
parent a01850c376
commit 681f0be278
3 changed files with 56 additions and 53 deletions

View File

@ -336,9 +336,9 @@ abstract_trunks.grow_moss_on_ground = function(pos)
local moss_type = math.random(1,21)
if moss_type == 1 then
minetest.add_node(on_ground, {name="trunks:moss_fungus", param2= 1})
minetest.add_node(on_ground, {name="trunks:moss_fungus", param2=math.random(0,3)})
else
minetest.add_node(on_ground, {name="trunks:moss", param2= 1})
minetest.add_node(on_ground, {name="trunks:moss", param2=math.random(0,3)})
end
end
@ -383,50 +383,48 @@ abstract_trunks.grow_moss_on_trunk = function(pos)
local node_west = minetest.get_node(at_side_w)
local node_under = minetest.get_node(undrneath)
if minetest.get_item_group(node_under.name, "tree") < 1 then
local moss_type = math.random(1,41)
if minetest.registered_nodes[node_here.name].buildable_to then -- instead of check_air = true,
if moss_type == 1 then
minetest.add_node(on_ground, {name="trunks:moss_fungus", param2= 1})
elseif moss_type < 22 then
minetest.add_node(on_ground, {name="trunks:moss", param2= 1})
--if minetest.get_item_group(node_under.name, "tree") < 1 then
local moss_type = math.random(1,41)
if minetest.registered_nodes[node_here.name].buildable_to then -- instead of check_air = true,
if moss_type == 1 then
minetest.add_node(on_ground, {name="trunks:moss_fungus", param2=math.random(0,3) --[[1]]})
elseif moss_type < 22 then
minetest.add_node(on_ground, {name="trunks:moss", param2=math.random(0,3) --[[1]]})
end
end
end
local moss_type = math.random(1,31)
if minetest.registered_nodes[node_north.name].buildable_to then -- instead of check_air = true,
if moss_type == 1 then
minetest.add_node(at_side_n, {name="trunks:moss_fungus", param2= 5})
elseif moss_type < 22 then
minetest.add_node(at_side_n, {name="trunks:moss", param2= 5})
local moss_type = math.random(1,31) -- cliche of more moss at north
if minetest.registered_nodes[node_north.name].buildable_to then -- instead of check_air = true,
if moss_type == 1 then
minetest.add_node(at_side_n, {name="trunks:moss_fungus", param2=math.random(4,7)}) -- 5,4,6,7
elseif moss_type < 22 then
minetest.add_node(at_side_n, {name="trunks:moss", param2=math.random(4,7)})
end
end
end
local moss_type = math.random(1,41)
if minetest.registered_nodes[node_east.name].buildable_to then -- instead of check_air = true,
if moss_type == 1 then
minetest.add_node(at_side_e, {name="trunks:moss_fungus", param2= 3})
elseif moss_type < 22 then
minetest.add_node(at_side_e, {name="trunks:moss", param2= 3})
local moss_type = math.random(1,41)
if minetest.registered_nodes[node_east.name].buildable_to then -- instead of check_air = true,
if moss_type == 1 then
minetest.add_node(at_side_e, {name="trunks:moss_fungus", param2=math.random(12,15)})
elseif moss_type < 22 then
minetest.add_node(at_side_e, {name="trunks:moss", param2=math.random(12,15)})
end
end
end
local moss_type = math.random(1,41)
if minetest.registered_nodes[node_south.name].buildable_to then -- instead of check_air = true,
if moss_type == 1 then
minetest.add_node(at_side_s, {name="trunks:moss_fungus", param2= 4})
elseif moss_type < 22 then
minetest.add_node(at_side_s, {name="trunks:moss", param2= 4})
local moss_type = math.random(1,41)
if minetest.registered_nodes[node_south.name].buildable_to then -- instead of check_air = true,
if moss_type == 1 then
minetest.add_node(at_side_s, {name="trunks:moss_fungus", param2=math.random(8,11)})
elseif moss_type < 22 then
minetest.add_node(at_side_s, {name="trunks:moss", param2=math.random(8,11)})
end
end
end
local moss_type = math.random(1,41)
if minetest.registered_nodes[node_west.name].buildable_to then -- instead of check_air = true,
if moss_type == 1 then
minetest.add_node(at_side_w, {name="trunks:moss_fungus", param2= 2})
elseif moss_type < 22 then
minetest.add_node(at_side_w, {name="trunks:moss", param2= 2})
local moss_type = math.random(1,41)
if minetest.registered_nodes[node_west.name].buildable_to then -- instead of check_air = true,
if moss_type == 1 then
minetest.add_node(at_side_w, {name="trunks:moss_fungus", param2=math.random(16,19)})
elseif moss_type < 22 then
minetest.add_node(at_side_w, {name="trunks:moss", param2=math.random(16,19)})
end
end
end
end
--minetest.add_node(on_ground, {name="trunks:moss", param2=math.random(0,3)})
--end
end
plantslib:register_generate_plant({
@ -447,16 +445,17 @@ plantslib:register_generate_plant({
"moretrees:rubber_tree_trunk_empty",
"moretrees:sequoia_trunk",
"moretrees:spruce_trunk",
"moretrees:willow_trunk"
"moretrees:willow_trunk",
"default:mossycobble"
},
max_count = Moss_on_trunk_Max_Count,
rarity = Moss_on_trunk_Rarity,
min_elevation = 1,
max_elevation = 40,
near_nodes = {"default:dirt_with_grass"},
near_nodes_size = 1,
near_nodes_vertical = 1,
near_nodes_count = 1,
--near_nodes = {"default:dirt_with_grass"},
--near_nodes_size = 1,
--near_nodes_vertical = 1,
--near_nodes_count = 1,
plantlife_limit = -0.9,
check_air = false,
},

View File

@ -1,6 +1,6 @@
-----------------------------------------------------------------------------------------------
local title = "Trunks"
local version = "0.0.9"
local version = "0.1.0"
local mname = "trunks"
-----------------------------------------------------------------------------------------------

View File

@ -52,17 +52,20 @@ end
-----------------------------------------------------------------------------------------------
-- MoSS
-----------------------------------------------------------------------------------------------
local flat_moss = {-1/2, -1/2, -1/2, 1/2, -15/32--[[<-flickers if smaller]], 1/2}
minetest.register_node("trunks:moss", {
description = "Moss",
drawtype = "signlike",
drawtype = "nodebox",--"signlike",
tiles = {"trunks_moss.png"},
inventory_image = "trunks_moss.png",
wield_image = "trunks_moss.png",
paramtype = "light",
paramtype2 = "wallmounted",
paramtype2 = "facedir",--"wallmounted",
sunlight_propagates = true,
walkable = false,
selection_box = {type = "wallmounted"},
node_box = {type = "fixed", fixed = flat_moss},
selection_box = {type = "fixed", fixed = flat_stick},--{type = "wallmounted"},
groups = {dig_immediate=2,attached_node=1},
sounds = default.node_sound_leaves_defaults(),
})
@ -72,15 +75,16 @@ minetest.register_node("trunks:moss", {
-----------------------------------------------------------------------------------------------
minetest.register_node("trunks:moss_fungus", {
description = "Moss & Fungus",
drawtype = "signlike",
drawtype = "nodebox",--"signlike",
tiles = {"trunks_moss_fungus.png"},
inventory_image = "trunks_moss_fungus.png",
wield_image = "trunks_moss_fungus.png",
paramtype = "light",
paramtype2 = "wallmounted",
paramtype2 = "facedir",--"wallmounted",
sunlight_propagates = true,
walkable = false,
selection_box = {type = "wallmounted"},
node_box = {type = "fixed", fixed = flat_moss},
selection_box = {type = "fixed", fixed = flat_stick},--{type = "wallmounted"},
groups = {dig_immediate=2,attached_node=1},
sounds = default.node_sound_leaves_defaults(),
})