deleted unused stuff & renamed textures
|
@ -1,35 +0,0 @@
|
|||
--abms
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"default:dirt_with_grass"},
|
||||
interval = 1,
|
||||
chance = 3,
|
||||
action = function(pos)
|
||||
if minetest.find_node_near({x=pos.x,y=pos.y+1,z=pos.z}, 3, {"group:tree"}) then
|
||||
minetest.env:add_node(pos, {name="forestsoils:dirt_with_leaves_1"})
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"default:dirt_with_grass"},
|
||||
interval = 1,
|
||||
chance = 6,
|
||||
action = function(pos)
|
||||
if minetest.find_node_near({x=pos.x,y=pos.y+1,z=pos.z}, 1, {"forestsoils:dirt_with_leaves_1"}) then
|
||||
minetest.env:add_node(pos, {name="forestsoils:grass_with_leaves_2"})
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"default:dirt_with_grass"},
|
||||
interval = 1,
|
||||
chance = 12,
|
||||
action = function(pos)
|
||||
if minetest.find_node_near({x=pos.x,y=pos.y+1,z=pos.z}, 1, {"forestsoils:grass_with_leaves_2"}) then
|
||||
minetest.env:add_node(pos, {name="forestsoils:grass_with_leaves_1"})
|
||||
end
|
||||
|
||||
end,
|
||||
})
|
|
@ -1,58 +0,0 @@
|
|||
-- generate
|
||||
|
||||
minetest.register_on_generated(function(minp, maxp, seed)
|
||||
if maxp.y >= 2 and minp.y <= 0 then
|
||||
-- Generate forest soil
|
||||
-- perlin like plants_lib default and "default:grass_*"
|
||||
local perlin1 = minetest.get_perlin(329, 3, 0.6, 100)
|
||||
-- Assume X and Z lengths are equal
|
||||
local divlen = 8--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)
|
||||
-- dirt_with_leaves_1
|
||||
local forest_soil_amount = 100
|
||||
-- Find random positions for grass based on this random
|
||||
local pr = PseudoRandom(seed)--+1)
|
||||
for i=0,forest_soil_amount do
|
||||
local x = pr:next(x0, x1)
|
||||
local z = pr:next(z0, z1)
|
||||
-- Find ground level (0...38)
|
||||
local ground_y = nil
|
||||
for y=38,0,-1 do
|
||||
local nn = minetest.get_node({x=x,y=y,z=z}).name
|
||||
if nn == "default:dirt_with_grass" then
|
||||
ground_y = y
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if ground_y then
|
||||
local pos = {x=x,y=ground_y,z=z}
|
||||
local pos1 = {x=x,y=ground_y+1,z=z}
|
||||
local nn = minetest.get_node(pos).name
|
||||
-- Check if the node can be replaced
|
||||
if minetest.find_node_near(pos1, 3, {"group:tree"}) then
|
||||
if table.getn(minetest.find_nodes_in_area({x=x-3, y=ground_y-1, z=z-3}, {x=x+3, y=ground_y+1, z=z+3}, {"group:tree"})) >= 4 then -- from plants_lib
|
||||
minetest.set_node(pos,{name="forestsoils:dirt_with_leaves_1"})
|
||||
end
|
||||
end
|
||||
if minetest.find_node_near(pos, 1, {"forestsoils:dirt_with_leaves_1"}) then
|
||||
minetest.set_node(pos,{name="forestsoils:grass_with_leaves_2"})
|
||||
end
|
||||
if minetest.find_node_near(pos, 1, {"forestsoils:grass_with_leaves_2"}) then
|
||||
minetest.set_node(pos,{name="forestsoils:grass_with_leaves_1"})
|
||||
end
|
||||
if minetest.find_node_near(pos, 1, {"forestsoils:grass_with_leaves_1"}) then
|
||||
minetest.set_node(pos,{name="forestsoils:dirt_with_leaves_2"})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
|
@ -1,6 +1,6 @@
|
|||
-----------------------------------------------------------------------------------------------
|
||||
local title = "Forrest Soils"
|
||||
local version = "0.0.4"
|
||||
local version = "0.0.5"
|
||||
local mname = "forestsoils"
|
||||
-----------------------------------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
minetest.register_node("forestsoils:dirt_with_leaves_1", {
|
||||
description = "Forrest Soil 1",
|
||||
tiles = {
|
||||
"default_dirt.png^leaves_ground_9_cover.png",
|
||||
"default_dirt.png^forestsoils_ground_cover.png",
|
||||
"default_dirt.png",
|
||||
"default_dirt.png^leaves_ground_9_cover_side.png"},
|
||||
"default_dirt.png^forestsoils_ground_cover_side.png"},
|
||||
is_ground_content = true,
|
||||
groups = {
|
||||
crumbly=3,
|
||||
|
@ -21,9 +21,9 @@ minetest.register_node("forestsoils:dirt_with_leaves_1", {
|
|||
minetest.register_node("forestsoils:dirt_with_leaves_2", {
|
||||
description = "Forrest Soil 2",
|
||||
tiles = {
|
||||
"leaves_ground_9.png",
|
||||
"forestsoils_ground.png",
|
||||
"default_dirt.png",
|
||||
"default_dirt.png^leaves_ground_9_side.png"},
|
||||
"default_dirt.png^forestsoils_ground_side.png"},
|
||||
is_ground_content = true,
|
||||
groups = {
|
||||
crumbly=3,
|
||||
|
@ -39,9 +39,9 @@ minetest.register_node("forestsoils:dirt_with_leaves_2", {
|
|||
minetest.register_node("forestsoils:grass_with_leaves_1", {
|
||||
description = "Forrest Soil 3",
|
||||
tiles = {
|
||||
"default_grass.png^leaves_ground_9_cover2.png",
|
||||
"default_grass.png^forestsoils_ground_cover2.png",
|
||||
"default_dirt.png",
|
||||
"default_dirt.png^default_grass_side.png^leaves_ground_9_cover_side2.png"},
|
||||
"default_dirt.png^default_grass_side.png^forestsoils_ground_cover_side2.png"},
|
||||
is_ground_content = true,
|
||||
groups = {
|
||||
crumbly=3,
|
||||
|
@ -57,9 +57,9 @@ minetest.register_node("forestsoils:grass_with_leaves_1", {
|
|||
minetest.register_node("forestsoils:grass_with_leaves_2", {
|
||||
description = "Forrest Soil 4",
|
||||
tiles = {
|
||||
"default_grass.png^leaves_ground_9_cover.png",
|
||||
"default_grass.png^forestsoils_ground_cover.png",
|
||||
"default_dirt.png",
|
||||
"default_dirt.png^default_grass_side.png^leaves_ground_9_cover_side.png"},
|
||||
"default_dirt.png^default_grass_side.png^forestsoils_ground_cover_side.png"},
|
||||
is_ground_content = true,
|
||||
groups = {
|
||||
crumbly=3,
|
||||
|
|
Before Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 868 B |
Before Width: | Height: | Size: 776 B After Width: | Height: | Size: 776 B |
Before Width: | Height: | Size: 853 B After Width: | Height: | Size: 853 B |
Before Width: | Height: | Size: 785 B After Width: | Height: | Size: 785 B |
Before Width: | Height: | Size: 436 B After Width: | Height: | Size: 436 B |
Before Width: | Height: | Size: 426 B After Width: | Height: | Size: 426 B |
Before Width: | Height: | Size: 447 B After Width: | Height: | Size: 447 B |
Before Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 677 B |
Before Width: | Height: | Size: 660 B |
Before Width: | Height: | Size: 828 B |
Before Width: | Height: | Size: 825 B |
Before Width: | Height: | Size: 829 B |
Before Width: | Height: | Size: 834 B |
Before Width: | Height: | Size: 826 B |
Before Width: | Height: | Size: 420 B |
Before Width: | Height: | Size: 470 B |