tidy code
This commit is contained in:
parent
a6b38705e2
commit
4912e50f4c
@ -283,7 +283,7 @@ minetest.register_tool("ethereal:crystal_gilly_staff", {
|
|||||||
|
|
||||||
on_use = function(itemstack, user, pointed_thing)
|
on_use = function(itemstack, user, pointed_thing)
|
||||||
|
|
||||||
if user:get_breath() < 10 then
|
if user and user:get_breath() < 10 then
|
||||||
user:set_breath(10)
|
user:set_breath(10)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
56
decor.lua
56
decor.lua
@ -185,48 +185,28 @@ add_node({"default:sandstone"}, 0.002, {"sandstone_desert"}, 1, 100,
|
|||||||
add_node({"default:desert_sand"}, 0.005, {"desert"}, 1, 100,
|
add_node({"default:desert_sand"}, 0.005, {"desert"}, 1, 100,
|
||||||
{"default:cactus"}, 4, nil, nil, ethereal.desert)
|
{"default:cactus"}, 4, nil, nil, ethereal.desert)
|
||||||
|
|
||||||
-- wild red mushroom
|
|
||||||
add_node({"ethereal:mushroom_dirt"}, 0.01, {"mushroom"}, 1, 100,
|
|
||||||
{"flowers:mushroom_red"}, nil, nil, nil, ethereal.mushroom)
|
|
||||||
|
|
||||||
-- spore grass
|
-- spore grass
|
||||||
add_node({"ethereal:mushroom_dirt"}, 0.1, {"mushroom"}, 1, 100,
|
add_node({"ethereal:mushroom_dirt"}, 0.1, {"mushroom"}, 1, 100,
|
||||||
{"ethereal:spore_grass"}, nil, nil, nil, ethereal.mushroom)
|
{"ethereal:spore_grass"}, nil, nil, nil, ethereal.mushroom)
|
||||||
|
|
||||||
|
-- red and brown mushrooms
|
||||||
local list = {
|
minetest.register_decoration({
|
||||||
{"junglee", {"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"}, ethereal.junglee},
|
deco_type = "simple",
|
||||||
{"deciduous_forest", {"default:dirt_with_grass"}, ethereal.grassy},
|
place_on = {
|
||||||
{"grassytwo", {"default:dirt_with_grass"}, ethereal.grassytwo},
|
"default:dirt_with_rainforest_litter",
|
||||||
{"prairie", {"ethereal:prairie_dirt"}, ethereal.prairie},
|
"default:dirt_with_grass",
|
||||||
{"mushroom", {"ethereal:mushroom_dirt"}, ethereal.mushroom},
|
"ethereal:prairie_dirt",
|
||||||
{"swamp", {"default:dirt_with_grass"}, ethereal.swamp}
|
"ethereal:mushroom_dirt"
|
||||||
}
|
},
|
||||||
|
sidelen = 16,
|
||||||
-- wild red and brown mushrooms
|
fill_ratio = 0.01,
|
||||||
for _, row in pairs(list) do
|
biomes = {
|
||||||
|
"junglee", "deciduous_forest", "grassytwo", "prairie", "swamp", "mushroom"
|
||||||
if row[3] == 1 then
|
},
|
||||||
|
y_min = 1,
|
||||||
minetest.register_decoration({
|
y_max = 120,
|
||||||
deco_type = "simple",
|
decoration = {"flowers:mushroom_brown", "flowers:mushroom_red"}
|
||||||
place_on = row[2],
|
})
|
||||||
sidelen = 16,
|
|
||||||
noise_params = {
|
|
||||||
offset = 0,
|
|
||||||
scale = 0.009,
|
|
||||||
spread = {x = 200, y = 200, z = 200},
|
|
||||||
seed = 2,
|
|
||||||
octaves = 3,
|
|
||||||
persist = 0.66
|
|
||||||
},
|
|
||||||
biomes = {row[1]},
|
|
||||||
y_min = 1,
|
|
||||||
y_max = 120,
|
|
||||||
decoration = {"flowers:mushroom_brown", "flowers:mushroom_red"}
|
|
||||||
})
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- jungle grass
|
-- jungle grass
|
||||||
add_node({"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"},
|
add_node({"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"},
|
||||||
|
3
dirt.lua
3
dirt.lua
@ -27,8 +27,7 @@ minetest.register_craft({
|
|||||||
|
|
||||||
-- register ethereal dirt types
|
-- register ethereal dirt types
|
||||||
local dirts = {
|
local dirts = {
|
||||||
"Bamboo", "Jungle", "Grove", "Prairie", "Cold",
|
"Bamboo", "Jungle", "Grove", "Prairie", "Cold", "Crystal", "Mushroom", "Fiery", "Gray"
|
||||||
"Crystal", "Mushroom", "Fiery", "Gray"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for n = 1, #dirts do
|
for n = 1, #dirts do
|
||||||
|
@ -3,7 +3,6 @@ local S = ethereal.translate
|
|||||||
|
|
||||||
local door_mod = minetest.get_modpath("doors")
|
local door_mod = minetest.get_modpath("doors")
|
||||||
|
|
||||||
|
|
||||||
local add_fence = function(name, node, desc, texture)
|
local add_fence = function(name, node, desc, texture)
|
||||||
|
|
||||||
if default.register_fence then
|
if default.register_fence then
|
||||||
|
2
init.lua
2
init.lua
@ -7,7 +7,7 @@
|
|||||||
]]
|
]]
|
||||||
|
|
||||||
|
|
||||||
ethereal = {version = "20240320"}
|
ethereal = {version = "20240417"}
|
||||||
|
|
||||||
|
|
||||||
local function setting(stype, name, default)
|
local function setting(stype, name, default)
|
||||||
|
@ -524,7 +524,7 @@ minetest.register_node("ethereal:basandra_bush_leaves", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
-- compatibility check for new mt version with leafdecay function
|
-- compatibility check for new mt version with leafdecay function
|
||||||
if minetest.registered_nodes["default:dirt_with_rainforest_litter"] then
|
if default.register_leafdecay then
|
||||||
|
|
||||||
default.register_leafdecay({
|
default.register_leafdecay({
|
||||||
trunks = {"default:tree"},
|
trunks = {"default:tree"},
|
||||||
|
@ -153,7 +153,7 @@ end
|
|||||||
|
|
||||||
function ethereal.grow_banana_tree(pos)
|
function ethereal.grow_banana_tree(pos)
|
||||||
|
|
||||||
if math.random(3) == 1 and minetest.find_node_near(pos, 1, {"farming:soil_wet"}) then
|
if math.random(2) == 1 and minetest.find_node_near(pos, 1, {"farming:soil_wet"}) then
|
||||||
|
|
||||||
add_tree(pos, 3, 0, 3, ethereal.bananatree,
|
add_tree(pos, 3, 0, 3, ethereal.bananatree,
|
||||||
{{"ethereal:banana", "ethereal:banana_bunch"}})
|
{{"ethereal:banana", "ethereal:banana_bunch"}})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user