Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

woodsoils:dirt_with_leaves_2 isn't in use? #55

Open
fluxionary opened this issue Aug 15, 2023 · 4 comments
Open

woodsoils:dirt_with_leaves_2 isn't in use? #55

fluxionary opened this issue Aug 15, 2023 · 4 comments
Labels
question Further information is requested

Comments

@fluxionary
Copy link
Member

i'm not sure what the intention is, but there's no code which adds that node currently.

@wsor4035
Copy link
Contributor

link to where it is referenced?

@OgelGames
Copy link
Contributor

OgelGames commented Aug 16, 2023

Registered here:

minetest.register_node("woodsoils:dirt_with_leaves_2", {
description = S("Forest Soil 2"),
tiles = {
"woodsoils_ground.png",
"default_dirt.png",
"default_dirt.png^woodsoils_ground_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},
}),
soil = {
base = "woodsoils:dirt_with_leaves_2",
dry = "farming:soil",
wet = "farming:soil_wet"
}
})

And used here:

minetest.register_abm({
nodenames = {"default:papyrus"},
neighbors = {
"woodsoils:dirt_with_leaves_1",
"woodsoils:dirt_with_leaves_2",
"woodsoils:grass_with_leaves_1",
"woodsoils:grass_with_leaves_2"
},
interval = 50,
chance = 20,
action = function(pos, node)
pos.y = pos.y-1
local name = minetest.get_node(pos).name
if string.find(name, "_with_leaves_") then
if minetest.find_node_near(pos, 3, {"group:water"}) == nil then
return
end
pos.y = pos.y+1
local height = 0
while minetest.get_node(pos).name == "default:papyrus" and height < 4 do
height = height+1
pos.y = pos.y+1
end
if height < 4 then
if minetest.get_node(pos).name == "air" then
minetest.swap_node(pos, {name="default:papyrus"})
end
end
end
end,
})

@OgelGames OgelGames added the question Further information is requested label Aug 16, 2023
@fluxionary
Copy link
Member Author

fluxionary commented Aug 16, 2023

well, that's an ABM that triggers if the node were in the world, but there's no code to add the node to the world, nor is there a recipe or other way for non-creative players to get a hold of it.

@OgelGames
Copy link
Contributor

Hmm, looks like it should be used here:

abstract_woodsoils.place_soil = function(pos)
if minetest.get_item_group(minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z}).name, "soil") > 0
or minetest.get_item_group(minetest.get_node({x=pos.x,y=pos.y-2,z=pos.z}).name, "soil") > 0 then
for i in pairs(RaDiuS) do
local WE1 = RaDiuS[i][1]
local NS1 = RaDiuS[i][2]
local WE2 = RaDiuS[i][3]
local NS2 = RaDiuS[i][4]
local WE3 = RaDiuS[i][5]
local NS3 = RaDiuS[i][6]
local radius_1a = {x=pos.x+WE1,y=pos.y-1,z=pos.z+NS1}
local radius_1b = {x=pos.x+WE1,y=pos.y-2,z=pos.z+NS1}
local radius_2a = {x=pos.x+WE2,y=pos.y-1,z=pos.z+NS2}
local radius_2b = {x=pos.x+WE2,y=pos.y-2,z=pos.z+NS2}
local radius_3a = {x=pos.x+WE3,y=pos.y-1,z=pos.z+NS3}
local radius_3b = {x=pos.x+WE3,y=pos.y-2,z=pos.z+NS3}
--local node_1a = minetest.get_node(radius_1a)
--local node_1b = minetest.get_node(radius_1b)
local node_2a = minetest.get_node(radius_2a)
local node_2b = minetest.get_node(radius_2b)
local node_3a = minetest.get_node(radius_3a)
local node_3b = minetest.get_node(radius_3b)
-- Dirt with Leaves 1
if minetest.get_item_group(minetest.get_node(radius_1a).name, "soil") > 0 then
minetest.swap_node(radius_1a, {name="woodsoils:dirt_with_leaves_1"})
end
if minetest.get_item_group(minetest.get_node(radius_1b).name, "soil") > 0 then
minetest.swap_node(radius_1b, {name="woodsoils:dirt_with_leaves_1"})
end
-- Grass with Leaves 2
if string.find(node_2a.name, "dirt_with_grass") then
minetest.swap_node(radius_2a, {name="woodsoils:grass_with_leaves_2"})
end
if string.find(node_2b.name, "dirt_with_grass") then
minetest.swap_node(radius_2b, {name="woodsoils:grass_with_leaves_2"})
end
-- Grass with Leaves 1
if string.find(node_3a.name, "dirt_with_grass") then
minetest.swap_node(radius_3a, {name="woodsoils:grass_with_leaves_1"})
end
if string.find(node_3b.name, "dirt_with_grass") then
minetest.swap_node(radius_3b, {name="woodsoils:grass_with_leaves_1"})
end
end
end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants