Fix fertilizer turning some blocks into sth. else
This commit is contained in:
parent
963f1c67e1
commit
cb6937bfa9
@ -14,6 +14,7 @@ minetest.register_node(
|
||||
groups = {
|
||||
crumbly = 3,
|
||||
soil = 1,
|
||||
normal_dirt = 1,
|
||||
plantable_soil = 1,
|
||||
plantable_fertilizer = 1,
|
||||
fall_damage_add_percent = -5,
|
||||
@ -52,16 +53,15 @@ minetest.register_craftitem(
|
||||
local pos = pointed_thing.above
|
||||
|
||||
local undernode = minetest.get_node(pointed_thing.under)
|
||||
local underdef = minetest.registered_nodes[undernode.name]
|
||||
|
||||
local diff = vector.subtract(pointed_thing.above, pointed_thing.under)
|
||||
if diff.y > 0 then
|
||||
if underdef.groups then
|
||||
if underdef.groups.plantable_soil then
|
||||
minetest.set_node(pointed_thing.under, {name = "default:fertilized_dirt"})
|
||||
elseif underdef.groups.plantable_sandy then
|
||||
minetest.set_node(pointed_thing.under, {name = "default:fertilized_sand"})
|
||||
end
|
||||
if minetest.get_item_group(undernode.name, "plantable_fertilizer") ~= 0 then
|
||||
return itemstack
|
||||
elseif minetest.get_item_group(undernode.name, "normal_dirt") ~= 0 then
|
||||
minetest.set_node(pointed_thing.under, {name = "default:fertilized_dirt"})
|
||||
elseif undernode.name == "default:sand" then
|
||||
minetest.set_node(pointed_thing.under, {name = "default:fertilized_sand"})
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -171,7 +171,7 @@ minetest.register_node(
|
||||
description = S("Dirt"),
|
||||
tiles = {"default_dirt.png"},
|
||||
stack_max = 240,
|
||||
groups = {crumbly = 3, soil = 1, plantable_soil = 1, fall_damage_add_percent = -5},
|
||||
groups = {crumbly = 3, soil = 1, normal_dirt = 1, plantable_soil = 1, fall_damage_add_percent = -5},
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
})
|
||||
|
||||
@ -181,7 +181,7 @@ minetest.register_node(
|
||||
description = S("Dry Dirt"),
|
||||
tiles = {"default_dirt.png"},
|
||||
stack_max = 240,
|
||||
groups = {crumbly = 3, soil = 1, plantable_sandy = 1, fall_damage_add_percent = -10},
|
||||
groups = {crumbly = 3, soil = 1, dry_dirt = 1, plantable_dry = 1, fall_damage_add_percent = -10},
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
})
|
||||
|
||||
@ -191,7 +191,7 @@ minetest.register_node(
|
||||
description = S("Swamp Dirt"),
|
||||
tiles = {"default_swamp_dirt.png"},
|
||||
stack_max = 240,
|
||||
groups = {crumbly = 3, soil = 1, plantable_soil = 1, fall_damage_add_percent = -10},
|
||||
groups = {crumbly = 3, soil = 1, swamp_dirt = 1, plantable_soil = 1, fall_damage_add_percent = -10},
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
})
|
||||
|
||||
@ -204,7 +204,7 @@ minetest.register_node(
|
||||
"default_dirt.png",
|
||||
"default_dirt.png^default_dry_grass_side.png"
|
||||
},
|
||||
groups = {crumbly = 3, soil = 1, plantable_sandy = 1, grass_cover = 1,
|
||||
groups = {crumbly = 3, soil = 1, normal_dirt = 1, plantable_sandy = 1, grass_cover = 1,
|
||||
fall_damage_add_percent = -5, not_in_craft_guide = 1},
|
||||
drop = {
|
||||
max_items = 3,
|
||||
@ -230,7 +230,7 @@ minetest.register_node(
|
||||
"default_swamp_dirt.png",
|
||||
"default_swamp_dirt.png^default_swamp_grass_side.png"
|
||||
},
|
||||
groups = {crumbly = 3, soil = 1, plantable_soil = 1, grass_cover = 1,
|
||||
groups = {crumbly = 3, soil = 1, swamp_dirt = 1, plantable_soil = 1, grass_cover = 1,
|
||||
fall_damage_add_percent = -5, not_in_craft_guide = 1},
|
||||
drop = {
|
||||
max_items = 3,
|
||||
@ -256,7 +256,7 @@ minetest.register_node(
|
||||
"default_dirt.png",
|
||||
"default_dirt.png^default_grass_side.png"
|
||||
},
|
||||
groups = {crumbly = 3, soil = 1, plantable_soil = 1, grass_cover = 1,
|
||||
groups = {crumbly = 3, soil = 1, normal_dirt = 1, plantable_soil = 1, grass_cover = 1,
|
||||
fall_damage_add_percent = -5, not_in_craft_guide = 1},
|
||||
drop = {
|
||||
max_items = 3,
|
||||
@ -279,7 +279,7 @@ minetest.register_node(
|
||||
{
|
||||
description = S("Dirt with Grass and Footsteps"),
|
||||
tiles = {"default_grass_footstep.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"},
|
||||
groups = {crumbly = 3, soil = 1, plantable_soil = 1, grass_cover = 1, fall_damage_add_percent = -5, not_in_craft_guide = 1},
|
||||
groups = {crumbly = 3, soil = 1, normal_dirt = 1, plantable_soil = 1, grass_cover = 1, fall_damage_add_percent = -5, not_in_craft_guide = 1},
|
||||
drop = {
|
||||
max_items = 3,
|
||||
items = {
|
||||
|
@ -21,7 +21,7 @@ farming.register_plant(
|
||||
grow_time = 780,
|
||||
grows_near = {"group:water"},
|
||||
growing_distance = 4,
|
||||
grows_on = {"group:plantable_sandy", "group:plantable_soil"},
|
||||
grows_on = {"group:plantable_sandy", "group:plantable_soil", "group:plantable_dry"},
|
||||
light_min = 12,
|
||||
light_max = 15,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user