mirror of
https://codeberg.org/tenplus1/farming.git
synced 2025-01-15 04:10:18 +01:00
code consistency
This commit is contained in:
parent
7be6bee04c
commit
ff8e0d73a4
@ -187,14 +187,17 @@ farming.register_plant("farming:cotton", {
|
|||||||
})]]
|
})]]
|
||||||
|
|
||||||
-- mapgen
|
-- mapgen
|
||||||
local grow_on = farming.mapgen == "v6" and {"default:dirt_with_grass"}
|
local mg = farming.mapgen == "v6"
|
||||||
or {"default:dry_dirt_with_dry_grass"}
|
|
||||||
local biome = farming.mapgen == "v6" and {"jungle"} or {"savanna"}
|
def = {
|
||||||
|
grow_on = mg and {"default:dirt_with_grass"} or {"default:dry_dirt_with_dry_grass"},
|
||||||
|
biome = mg and {"jungle"} or {"savanna"}
|
||||||
|
}
|
||||||
|
|
||||||
minetest.register_decoration({
|
minetest.register_decoration({
|
||||||
name = "farming:cotton_wild",
|
name = "farming:cotton_wild",
|
||||||
deco_type = "simple",
|
deco_type = "simple",
|
||||||
place_on = grow_on,
|
place_on = def.grow_on,
|
||||||
sidelen = 16,
|
sidelen = 16,
|
||||||
noise_params = {
|
noise_params = {
|
||||||
offset = -0.1,
|
offset = -0.1,
|
||||||
@ -204,7 +207,7 @@ minetest.register_decoration({
|
|||||||
octaves = 3,
|
octaves = 3,
|
||||||
persist = 0.7
|
persist = 0.7
|
||||||
},
|
},
|
||||||
biomes = biome,
|
biomes = def.biome,
|
||||||
y_max = 31000,
|
y_max = 31000,
|
||||||
y_min = 1,
|
y_min = 1,
|
||||||
decoration = "farming:cotton_wild"
|
decoration = "farming:cotton_wild"
|
||||||
|
@ -156,12 +156,15 @@ farming.registered_plants["farming:pepper"] = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
-- mapgen
|
-- mapgen
|
||||||
local grow_on = farming.mapgen == "v6" and {"default:dirt_with_grass"}
|
local mg = farming.mapgen == "v6"
|
||||||
or {"default:dirt_with_rainforest_litter"}
|
|
||||||
|
def = {
|
||||||
|
grow_on = mg and {"default:dirt_with_grass"} or {"default:dirt_with_rainforest_litter"}
|
||||||
|
}
|
||||||
|
|
||||||
minetest.register_decoration({
|
minetest.register_decoration({
|
||||||
deco_type = "simple",
|
deco_type = "simple",
|
||||||
place_on = grow_on,
|
place_on = def.grow_on,
|
||||||
sidelen = 16,
|
sidelen = 16,
|
||||||
noise_params = {
|
noise_params = {
|
||||||
offset = 0,
|
offset = 0,
|
||||||
|
@ -142,14 +142,18 @@ farming.registered_plants["farming:pineapple"] = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
-- mapgen
|
-- mapgen
|
||||||
local grow_on = farming.mapgen == "v6" and {"default:dirt_with_grass"}
|
local mg = farming.mapgen == "v6"
|
||||||
or {"default:dirt_with_dry_grass", "default:dry_dirt_with_dry_grass"}
|
|
||||||
local grow_near = farming.mapgen == "v6" and "default:desert_sand" or nil
|
def = {
|
||||||
local num = farming.mapgen == "v6" and 1 or -1
|
grow_on = mg and {"default:dirt_with_grass"} or {"default:dirt_with_dry_grass",
|
||||||
|
"default:dry_dirt_with_dry_grass"},
|
||||||
|
grow_near = mg and "default:desert_sand" or nil,
|
||||||
|
num = mg and 1 or -1
|
||||||
|
}
|
||||||
|
|
||||||
minetest.register_decoration({
|
minetest.register_decoration({
|
||||||
deco_type = "simple",
|
deco_type = "simple",
|
||||||
place_on = grow_on,
|
place_on = def.grow_on,
|
||||||
sidelen = 16,
|
sidelen = 16,
|
||||||
noise_params = {
|
noise_params = {
|
||||||
offset = 0,
|
offset = 0,
|
||||||
@ -162,6 +166,6 @@ minetest.register_decoration({
|
|||||||
y_min = 18,
|
y_min = 18,
|
||||||
y_max = 30,
|
y_max = 30,
|
||||||
decoration = {"farming:pineapple_8"},
|
decoration = {"farming:pineapple_8"},
|
||||||
spawn_by = grow_near,
|
spawn_by = def.grow_near,
|
||||||
num_spawn_by = num
|
num_spawn_by = def.num
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user