Tidy and tweak with minetest 5.1 as base

This commit is contained in:
tenplus1 2024-08-16 11:05:33 +01:00
parent 9082c7181e
commit c292a0a345
26 changed files with 929 additions and 1081 deletions

View File

@ -101,6 +101,7 @@ who helped make this mod bigger and better throughout it's release :)
- Add {eatable} groups to food items - Add {eatable} groups to food items
- Use underground decoration placement for illumishrooms to improve performance - Use underground decoration placement for illumishrooms to improve performance
- Use worldalign textures for stairs - Use worldalign textures for stairs
- Tidy and tweak code to run on Minetest 5.1 and above
### 1.31 ### 1.31
- Fix fishing biome checks - Fix fishing biome checks

View File

@ -1,40 +1,9 @@
local S = ethereal.translate
-- Blue Marble Nodes
minetest.register_node("ethereal:blue_marble", {
description = S("Blue Marble"),
tiles = {"ethereal_blue_marble.png"},
groups = {cracky = 1, stone = 1},
sounds = default.node_sound_stone_defaults()
})
minetest.register_node("ethereal:blue_marble_tile", {
description = S("Blue Marble Tile"),
tiles = {"ethereal_blue_marble_tile.png"},
groups = {cracky = 1, stone = 1},
sounds = default.node_sound_stone_defaults()
})
minetest.register_craft({
output = "ethereal:blue_marble_tile 9",
recipe = {
{"ethereal:blue_marble", "ethereal:blue_marble", "ethereal:blue_marble"},
{"ethereal:blue_marble", "ethereal:blue_marble", "ethereal:blue_marble"},
{"ethereal:blue_marble", "ethereal:blue_marble", "ethereal:blue_marble"}
}
})
-- helper strings
local tmp, tmp2
-- helper function -- helper function
local add_biome = function(a, l, m, n, o, p, b, c, d, e, f, g, nd, na, ns)
-- if not 1 then biome disabled, don't add local function add_biome(a, l, m, n, o, p, b, c, d, e, f, g, nd, na, ns)
if p ~= 1 then return end
if p ~= 1 then return end -- if not 1 then biome disabled
minetest.register_biome({ minetest.register_biome({
name = a, name = a,
@ -59,8 +28,8 @@ local add_biome = function(a, l, m, n, o, p, b, c, d, e, f, g, nd, na, ns)
}) })
end end
-- always registered biomes -- always registered biomes
add_biome("mountain", 140, 31000, 50, 50, 1, add_biome("mountain", 140, 31000, 50, 50, 1,
nil, "default:snow", 1, "default:snowblock", 2) nil, "default:snow", 1, "default:snowblock", 2)
@ -85,19 +54,18 @@ minetest.register_biome({
--add_biome("underground", -31000, -192, 50, 50, 1, --add_biome("underground", -31000, -192, 50, 50, 1,
-- nil, nil, nil, nil, nil) -- nil, nil, nil, nil, nil)
-- biomes with disable setting -- biomes with disable setting
tmp = "default:desert_stone"
add_biome("desert", 3, 23, 35, 20, ethereal.desert, add_biome("desert", 3, 23, 35, 20, ethereal.desert,
nil, "default:desert_sand", 1, "default:desert_sand", 3, tmp, nil, "default:desert_sand", 1, "default:desert_sand", 3, "default:desert_stone",
"default:desert_stone", nil, "stairs:stair_desert_stone") "default:desert_stone", nil, "stairs:stair_desert_stone")
add_biome("desert_ocean", -192, 3, 35, 20, ethereal.desert, add_biome("desert_ocean", -192, 3, 35, 20, ethereal.desert,
nil, "default:sand", 1, "default:sand", 2, tmp, nil, "default:sand", 1, "default:sand", 2, "default:desert_stone",
"default:desert_stone", nil, "stairs:stair_desert_stone") "default:desert_stone", nil, "stairs:stair_desert_stone")
if ethereal.desert then if ethereal.desert then
minetest.register_biome({ minetest.register_biome({
name = "desert_under", name = "desert_under",
node_cave_liquid = {"default:water_source", "default:lava_source"}, node_cave_liquid = {"default:water_source", "default:lava_source"},
@ -127,21 +95,15 @@ add_biome("mesa", 1, 71, 25, 28, ethereal.mesa,
add_biome("mesa_ocean", -192, 2, 25, 28, ethereal.mesa, add_biome("mesa_ocean", -192, 2, 25, 28, ethereal.mesa,
nil, "default:sand", 1, "default:sand", 2) nil, "default:sand", 1, "default:sand", 2)
tmp = "default:dirt_with_coniferous_litter"
if not minetest.registered_nodes[tmp] then
tmp = "ethereal:cold_dirt"
end
-- was 'snowy' biome -- was 'snowy' biome
add_biome("coniferous_forest", 5, 40, 10, 40, ethereal.snowy, add_biome("coniferous_forest", 5, 40, 10, 40, ethereal.snowy,
nil, tmp, 1, "default:dirt", 2) nil, "default:dirt_with_coniferous_litter", 1, "default:dirt", 2)
add_biome("coniferous_forest_ocean", -192, 1, 10, 40, (ethereal.snowy or ethereal.frost), add_biome("coniferous_forest_ocean", -192, 1, 10, 40, (ethereal.snowy or ethereal.frost),
nil, "default:silver_sand", 1, "default:sand", 2) nil, "default:silver_sand", 1, "default:sand", 2)
if ethereal.snowy then if ethereal.snowy then
minetest.register_biome({ minetest.register_biome({
name = "coniferous_forest_under", name = "coniferous_forest_under",
node_cave_liquid = {"default:water_source", "default:lava_source"}, node_cave_liquid = {"default:water_source", "default:lava_source"},
@ -159,6 +121,7 @@ add_biome("taiga", 40, 140, 10, 40, ethereal.alpine,
nil, "default:dirt_with_snow", 1, "default:dirt", 2) nil, "default:dirt_with_snow", 1, "default:dirt", 2)
if ethereal.alpine then if ethereal.alpine then
minetest.register_biome({ minetest.register_biome({
name = "taiga_under", name = "taiga_under",
node_cave_liquid = {"default:water_source", "default:lava_source"}, node_cave_liquid = {"default:water_source", "default:lava_source"},
@ -186,6 +149,7 @@ add_biome("deciduous_forest_ocean", -31000, 3, 13, 40, ethereal.grassy,
nil, "default:sand", 2, "default:gravel", 1) nil, "default:sand", 2, "default:gravel", 1)
if ethereal.grassy then if ethereal.grassy then
minetest.register_biome({ minetest.register_biome({
name = "deciduous_forest_under", name = "deciduous_forest_under",
node_cave_liquid = {"default:water_source", "default:lava_source"}, node_cave_liquid = {"default:water_source", "default:lava_source"},
@ -202,20 +166,14 @@ end
add_biome("caves", 4, 41, 15, 25, ethereal.caves, add_biome("caves", 4, 41, 15, 25, ethereal.caves,
nil, "default:desert_stone", 3, "air", 8) nil, "default:desert_stone", 3, "air", 8)
tmp = "default:silver_sand"
if not minetest.registered_nodes[tmp] then
tmp = "default:sand"
end
add_biome("grayness", 2, 41, 15, 30, ethereal.grayness, add_biome("grayness", 2, 41, 15, 30, ethereal.grayness,
nil, "ethereal:gray_dirt", 1, "default:dirt", 3) nil, "ethereal:gray_dirt", 1, "default:dirt", 3)
add_biome("grayness_ocean", -18, 2, 15, 30, ethereal.grayness, add_biome("grayness_ocean", -18, 2, 15, 30, ethereal.grayness,
nil, tmp, 2, "default:sand", 2, "ethereal:blue_marble") nil, "default:silver_sand", 2, "default:sand", 2, "ethereal:blue_marble")
if ethereal.grayness then if ethereal.grayness then
minetest.register_biome({ minetest.register_biome({
name = "grayness_under", name = "grayness_under",
node_cave_liquid = {"default:water_source", "default:lava_source"}, node_cave_liquid = {"default:water_source", "default:lava_source"},
@ -249,19 +207,14 @@ add_biome("jumble", 1, 71, 25, 50, ethereal.jumble,
add_biome("jumble_ocean", -192, 1, 25, 50, ethereal.jumble, add_biome("jumble_ocean", -192, 1, 25, 50, ethereal.jumble,
nil, "default:sand", 1, "default:sand", 2) nil, "default:sand", 1, "default:sand", 2)
tmp = "default:dirt_with_rainforest_litter"
if not minetest.registered_nodes[tmp] then
tmp = "ethereal:jungle_dirt"
end
add_biome("junglee", 1, 71, 30, 60, ethereal.junglee, add_biome("junglee", 1, 71, 30, 60, ethereal.junglee,
nil, tmp, 1, "default:dirt", 3) nil, "default:dirt_with_rainforest_litter", 1, "default:dirt", 3)
add_biome("junglee_ocean", -192, 2, 30, 60, ethereal.junglee, add_biome("junglee_ocean", -192, 2, 30, 60, ethereal.junglee,
nil, "default:sand", 1, "default:sand", 2) nil, "default:sand", 1, "default:sand", 2)
if ethereal.junglee then if ethereal.junglee then
minetest.register_biome({ minetest.register_biome({
name = "junglee_under", name = "junglee_under",
node_cave_liquid = {"default:water_source", "default:lava_source"}, node_cave_liquid = {"default:water_source", "default:lava_source"},
@ -302,6 +255,7 @@ add_biome("sandstone_desert_ocean", -192, 2, 50, 20, ethereal.sandstone,
"default:sandstone", nil, "stairs:stair_sandstone") "default:sandstone", nil, "stairs:stair_sandstone")
if ethereal.sandstone then if ethereal.sandstone then
minetest.register_biome({ minetest.register_biome({
name = "sandstone_desert_under", name = "sandstone_desert_under",
node_cave_liquid = {"default:water_source", "default:lava_source"}, node_cave_liquid = {"default:water_source", "default:lava_source"},
@ -325,21 +279,14 @@ add_biome("plains", 3, 25, 65, 25, ethereal.plains,
add_biome("plains_ocean", -192, 2, 55, 25, ethereal.plains, add_biome("plains_ocean", -192, 2, 55, 25, ethereal.plains,
nil, "default:sand", 1, "default:sand", 2) nil, "default:sand", 1, "default:sand", 2)
tmp = "default:dry_dirt_with_dry_grass"
tmp2 = "default:dry_dirt"
if not minetest.registered_nodes[tmp] then
tmp = "default:dirt_with_dry_grass"
tmp2 = "default:dirt"
end
add_biome("savanna", 3, 50, 55, 25, ethereal.savanna, add_biome("savanna", 3, 50, 55, 25, ethereal.savanna,
nil, tmp, 1, tmp2, 3) nil, "default:dry_dirt_with_dry_grass", 1, "default:dry_dirt", 3)
add_biome("savanna_ocean", -192, 2, 55, 25, ethereal.savanna, add_biome("savanna_ocean", -192, 2, 55, 25, ethereal.savanna,
nil, "default:sand", 1, "default:sand", 2) nil, "default:sand", 1, "default:sand", 2)
if ethereal.savanna then if ethereal.savanna then
minetest.register_biome({ minetest.register_biome({
name = "savanna_under", name = "savanna_under",
node_cave_liquid = {"default:water_source", "default:lava_source"}, node_cave_liquid = {"default:water_source", "default:lava_source"},
@ -363,6 +310,7 @@ add_biome("fiery_ocean", -192, 2, 75, 10, ethereal.fiery,
nil, "default:sand", 1, "default:sand", 2) nil, "default:sand", 1, "default:sand", 2)
if ethereal.fiery then if ethereal.fiery then
minetest.register_biome({ minetest.register_biome({
name = "fiery_under", name = "fiery_under",
node_cave_liquid = {"default:lava_source"}, node_cave_liquid = {"default:lava_source"},
@ -437,7 +385,7 @@ if ethereal.glacier == 1 then
end end
if ethereal.tundra == 1 and minetest.registered_nodes["default:permafrost"] then if ethereal.tundra == 1 then
minetest.register_biome({ minetest.register_biome({
name = "tundra_highland", name = "tundra_highland",

View File

@ -1,24 +1,29 @@
-- storage tables
local old_biomes = {} local old_biomes = {}
local old_decor = {} local old_decor = {}
-- backup registered biomes
-- backup registered biome data
for key, def in pairs(minetest.registered_biomes) do for key, def in pairs(minetest.registered_biomes) do
old_biomes[key] = def old_biomes[key] = def
end end
-- backup registered decorations
for key, def in pairs(minetest.registered_decorations) do for key, def in pairs(minetest.registered_decorations) do
old_decor[key] = def old_decor[key] = def
end end
-- clear current biome data -- clear current biome data
minetest.clear_registered_biomes() minetest.clear_registered_biomes()
minetest.clear_registered_decorations() minetest.clear_registered_decorations()
-- minetest.clear_registered_ores() -- minetest.clear_registered_ores()
-- create list of default biomes to remove -- create list of default biomes to remove
local def_biomes = { local def_biomes = {
["rainforest_swamp"] = 1, ["rainforest_swamp"] = 1,
["grassland_dunes"] = 1, ["grassland_dunes"] = 1,
@ -65,17 +70,15 @@ local def_biomes = {
["coniferous_forest"] = 1 ["coniferous_forest"] = 1
} }
-- only re-register biomes that aren't on the list -- only re-register biomes that aren't on the list
for key, def in pairs(old_biomes) do for key, def in pairs(old_biomes) do
if not def_biomes[key] then if not def_biomes[key] then minetest.register_biome(def) end
minetest.register_biome(def)
end
end end
-- loop through decorations -- loop through decorations
for key, def in pairs(old_decor) do for key, def in pairs(old_decor) do
local can_add = true local can_add = true
@ -86,15 +89,11 @@ for key, def in pairs(old_decor) do
-- loop through decoration biomes, only re-add one's not on above list -- loop through decoration biomes, only re-add one's not on above list
for num, bio in pairs(def.biomes) do for num, bio in pairs(def.biomes) do
if not def_biomes[bio] then if not def_biomes[bio] then table.insert(new_biomes, bio) end
table.insert(new_biomes, bio)
end
end end
-- if no biomes are left on new list, do not re-add decoration -- if no biomes are left on new list, do not re-add decoration
if #new_biomes == 0 then if #new_biomes == 0 then can_add = false end
can_add = false
end
elseif type(def.biomes) == "string" then elseif type(def.biomes) == "string" then
@ -104,9 +103,7 @@ for key, def in pairs(old_decor) do
new_biomes = {def.biomes} -- convert to table new_biomes = {def.biomes} -- convert to table
end end
elseif not def.biomes then elseif not def.biomes then new_biomes = nil end -- keep it nil for re-adding
new_biomes = nil -- keep it nil for re-adding
end
if can_add == true then if can_add == true then

View File

@ -1,5 +1,6 @@
-- add compatibility for ethereal nodes already in default game or name changed -- add compatibility for ethereal nodes already added to default game or name changed
minetest.register_alias("ethereal:acacia_trunk", "default:acacia_tree") minetest.register_alias("ethereal:acacia_trunk", "default:acacia_tree")
minetest.register_alias("ethereal:acacia_wood", "default:acacia_wood") minetest.register_alias("ethereal:acacia_wood", "default:acacia_wood")
@ -44,8 +45,3 @@ minetest.register_alias("ethereal:tree_sapling", "default:sapling")
minetest.register_alias("ethereal:jungle_tree_sapling", "default:junglesapling") minetest.register_alias("ethereal:jungle_tree_sapling", "default:junglesapling")
minetest.register_alias("ethereal:acacia_sapling", "default:acacia_sapling") minetest.register_alias("ethereal:acacia_sapling", "default:acacia_sapling")
minetest.register_alias("ethereal:pine_tree_sapling", "default:pine_sapling") minetest.register_alias("ethereal:pine_tree_sapling", "default:pine_sapling")
-- check if pine bush stem exists, if not create alias
if not minetest.registered_nodes["default:pine_bush_stem"] then
minetest.register_alias("default:pine_bush_stem", "default:wood")
end

View File

@ -1,8 +1,26 @@
local S = ethereal.translate local S = minetest.get_translator("ethereal")
-- Crystal Ingot and recipe
minetest.register_craftitem("ethereal:crystal_ingot", {
description = S("Crystal Ingot"),
inventory_image = "ethereal_crystal_ingot.png",
wield_image = "ethereal_crystal_ingot.png"
})
minetest.register_craft({
output = "ethereal:crystal_ingot",
recipe = {
{"default:mese_crystal", "ethereal:crystal_spike"},
{"ethereal:crystal_spike", "default:mese_crystal"},
{"bucket:bucket_water", ""}
},
replacements = {{"bucket:bucket_water", "bucket:bucket_empty"}}
})
-- Crystal Spike (Hurts if you touch it) -- Crystal Spike (Hurts if you touch it)
minetest.register_node("ethereal:crystal_spike", { minetest.register_node("ethereal:crystal_spike", {
description = S("Crystal Spike"), description = S("Crystal Spike"),
drawtype = "plantlike", drawtype = "plantlike",
@ -21,83 +39,55 @@ minetest.register_node("ethereal:crystal_spike", {
}, },
node_box = { node_box = {
type = "fixed", fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 0, 5 / 16} type = "fixed", fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 0, 5 / 16}
} },
})
dropped_step = function(self, pos, dtime) -- custom function for builtin_item use
-- Crystal Ingot self.ctimer = (self.ctimer or 0) + dtime
minetest.register_craftitem("ethereal:crystal_ingot", { if self.ctimer < 5.0 then return end -- 5 second timer
description = S("Crystal Ingot"), self.ctimer = 0
inventory_image = "ethereal_crystal_ingot.png",
wield_image = "ethereal_crystal_ingot.png"
})
-- Check for builtin_item mod and add custom drop code to crystal spikes if self.node_inside and self.node_inside.name ~= "default:water_source" then
if minetest.get_modpath("builtin_item") then return
end
minetest.override_item("ethereal:crystal_spike", { local objs = minetest.get_objects_inside_radius(pos, 0.8)
dropped_step = function(self, pos, dtime) if not objs or #objs ~= 2 then return end
self.ctimer = (self.ctimer or 0) + dtime local crystal, mese, ent = nil, nil, nil
if self.ctimer < 5.0 then return end
self.ctimer = 0
if self.node_inside for k, obj in pairs(objs) do
and self.node_inside.name ~= "default:water_source" then
return
end
local objs = minetest.get_objects_inside_radius(pos, 0.8) ent = obj:get_luaentity()
if not objs or #objs ~= 2 then return end if ent and ent.name == "__builtin:item" then
local crystal, mese, ent = nil, nil, nil if ent.itemstring == "default:mese_crystal 2" and not mese then
for k, obj in pairs(objs) do mese = obj
ent = obj:get_luaentity() elseif ent.itemstring == "ethereal:crystal_spike 2" and not crystal then
if ent and ent.name == "__builtin:item" then crystal = obj
if ent.itemstring == "default:mese_crystal 2"
and not mese then
mese = obj
elseif ent.itemstring == "ethereal:crystal_spike 2"
and not crystal then
crystal = obj
end
end end
end end
if mese and crystal then
mese:remove()
crystal:remove()
minetest.add_item(pos, "ethereal:crystal_ingot")
return false
end
end end
})
end
minetest.register_craft({ if mese and crystal then
output = "ethereal:crystal_ingot",
recipe = { mese:remove()
{"default:mese_crystal", "ethereal:crystal_spike"}, crystal:remove()
{"ethereal:crystal_spike", "default:mese_crystal"},
{"bucket:bucket_water", ""} minetest.add_item(pos, "ethereal:crystal_ingot")
},
replacements = {{"bucket:bucket_water", "bucket:bucket_empty"}} return false
end
end
}) })
-- Crystal Block and recipe
-- Crystal Block
minetest.register_node("ethereal:crystal_block", { minetest.register_node("ethereal:crystal_block", {
description = S("Crystal Block"), description = S("Crystal Block"),
tiles = {"ethereal_crystal_block.png"}, tiles = {"ethereal_crystal_block.png"},
@ -121,8 +111,8 @@ minetest.register_craft({
recipe = {{"ethereal:crystal_block"}} recipe = {{"ethereal:crystal_block"}}
}) })
-- Crystal Sword (Powerful wee beastie) -- Crystal Sword (Powerful wee beastie)
minetest.register_tool("ethereal:sword_crystal", { minetest.register_tool("ethereal:sword_crystal", {
description = S("Crystal Sword"), description = S("Crystal Sword"),
inventory_image = "ethereal_crystal_sword.png", inventory_image = "ethereal_crystal_sword.png",
@ -132,9 +122,7 @@ minetest.register_tool("ethereal:sword_crystal", {
max_drop_level = 1, max_drop_level = 1,
groupcaps = { groupcaps = {
snappy = { snappy = {
times = {[1] = 1.70, [2] = 0.70, [3] = 0.25}, times = {[1] = 1.70, [2] = 0.70, [3] = 0.25}, uses = 50, maxlevel = 3
uses = 50,
maxlevel = 3
} }
}, },
damage_groups = {fleshy = 10} damage_groups = {fleshy = 10}
@ -152,8 +140,8 @@ minetest.register_craft({
} }
}) })
-- Crystal Axe -- Crystal Axe
minetest.register_tool("ethereal:axe_crystal", { minetest.register_tool("ethereal:axe_crystal", {
description = S("Crystal Axe"), description = S("Crystal Axe"),
inventory_image = "ethereal_crystal_axe.png", inventory_image = "ethereal_crystal_axe.png",
@ -163,9 +151,7 @@ minetest.register_tool("ethereal:axe_crystal", {
max_drop_level = 1, max_drop_level = 1,
groupcaps = { groupcaps = {
choppy = { choppy = {
times = {[1] = 2.00, [2] = 0.80, [3] = 0.40}, times = {[1] = 2.00, [2] = 0.80, [3] = 0.40}, uses = 40, maxlevel = 3
uses = 40,
maxlevel = 3
} }
}, },
damage_groups = {fleshy = 7} damage_groups = {fleshy = 7}
@ -192,8 +178,8 @@ minetest.register_craft({
} }
}) })
-- Crystal Pick (This will last a while) -- Crystal Pick (This will last a while)
minetest.register_tool("ethereal:pick_crystal", { minetest.register_tool("ethereal:pick_crystal", {
description = S("Crystal Pickaxe"), description = S("Crystal Pickaxe"),
inventory_image = "ethereal_crystal_pick.png", inventory_image = "ethereal_crystal_pick.png",
@ -203,9 +189,7 @@ minetest.register_tool("ethereal:pick_crystal", {
max_drop_level = 3, max_drop_level = 3,
groupcaps={ groupcaps={
cracky = { cracky = {
times = {[1] = 1.8, [2] = 0.8, [3] = 0.40}, times = {[1] = 1.8, [2] = 0.8, [3] = 0.40}, uses = 40, maxlevel = 3
uses = 40,
maxlevel = 3
} }
}, },
damage_groups = {fleshy = 6} damage_groups = {fleshy = 6}
@ -223,8 +207,8 @@ minetest.register_craft({
} }
}) })
-- backup old function and replace with new silk touch ability for crystal shovel
-- dig override for crystal shovel's silk touch ability
local old_handle_node_drops = minetest.handle_node_drops local old_handle_node_drops = minetest.handle_node_drops
function minetest.handle_node_drops(pos, drops, digger) function minetest.handle_node_drops(pos, drops, digger)
@ -245,6 +229,8 @@ function minetest.handle_node_drops(pos, drops, digger)
return old_handle_node_drops(pos, {ItemStack(nn)}, digger) return old_handle_node_drops(pos, {ItemStack(nn)}, digger)
end end
-- Crystal Shovel
minetest.register_tool("ethereal:shovel_crystal", { minetest.register_tool("ethereal:shovel_crystal", {
description = S("Crystal Shovel"), description = S("Crystal Shovel"),
inventory_image = "ethereal_crystal_shovel.png", inventory_image = "ethereal_crystal_shovel.png",
@ -254,9 +240,7 @@ minetest.register_tool("ethereal:shovel_crystal", {
max_drop_level = 1, max_drop_level = 1,
groupcaps = { groupcaps = {
crumbly = { crumbly = {
times = {[1] = 1.10, [2] = 0.50, [3] = 0.30}, times = {[1] = 1.10, [2] = 0.50, [3] = 0.30}, uses = 30, maxlevel = 3
uses = 30,
maxlevel = 3
} }
}, },
damage_groups = {fleshy = 4} damage_groups = {fleshy = 4}
@ -274,8 +258,8 @@ minetest.register_craft({
} }
}) })
-- Crystal Gilly Staff (replenishes air supply when used) -- Crystal Gilly Staff (replenishes air supply when used)
minetest.register_tool("ethereal:crystal_gilly_staff", { minetest.register_tool("ethereal:crystal_gilly_staff", {
description = S("Crystal Gilly Staff"), description = S("Crystal Gilly Staff"),
inventory_image = "ethereal_crystal_gilly_staff.png", inventory_image = "ethereal_crystal_gilly_staff.png",
@ -283,9 +267,7 @@ minetest.register_tool("ethereal:crystal_gilly_staff", {
on_use = function(itemstack, user, pointed_thing) on_use = function(itemstack, user, pointed_thing)
if user and user:get_breath() < 10 then if user and user:get_breath() < 10 then user:set_breath(10) end
user:set_breath(10)
end
end end
}) })
@ -298,12 +280,11 @@ minetest.register_craft({
}, },
}) })
-- Add Toolranks mod support
-- Add [toolranks] mod support if found
if minetest.get_modpath("toolranks") then if minetest.get_modpath("toolranks") then
-- Helper function local function add_tool(name, desc, afteruse) -- helper function
local function add_tool(name, desc, afteruse)
minetest.override_item(name, { minetest.override_item(name, {
original_description = desc, original_description = desc,

400
decor.lua
View File

@ -1,4 +1,6 @@
-- wild cotton added in 5.3.0
if minetest.registered_nodes["farming:cotton_wild"] then if minetest.registered_nodes["farming:cotton_wild"] then
minetest.register_decoration({ minetest.register_decoration({
@ -21,69 +23,67 @@ if minetest.registered_nodes["farming:cotton_wild"] then
}) })
end end
-- water pools in swamp areas if 5.0 detected -- water pools in swamp areas
if minetest.registered_nodes["default:permafrost"] then
minetest.register_decoration({ minetest.register_decoration({
deco_type = "simple", deco_type = "simple",
place_on = {"default:dirt_with_grass"}, place_on = {"default:dirt_with_grass"},
place_offset_y = -1, place_offset_y = -1,
sidelen = 16, sidelen = 16,
fill_ratio = 0.01, fill_ratio = 0.01,
biomes = {"swamp"}, biomes = {"swamp"},
y_max = 2, y_max = 2,
y_min = 1, y_min = 1,
flags = "force_placement", flags = "force_placement",
decoration = "default:water_source", decoration = "default:water_source",
spawn_by = "default:dirt_with_grass", spawn_by = "default:dirt_with_grass",
num_spawn_by = 8 num_spawn_by = 8
}) })
minetest.register_decoration({ minetest.register_decoration({
deco_type = "simple", deco_type = "simple",
place_on = {"default:dirt_with_grass"}, place_on = {"default:dirt_with_grass"},
place_offset_y = -1, place_offset_y = -1,
sidelen = 16, sidelen = 16,
fill_ratio = 0.1, fill_ratio = 0.1,
biomes = {"swamp"}, biomes = {"swamp"},
y_max = 2, y_max = 2,
y_min = 1, y_min = 1,
flags = "force_placement", flags = "force_placement",
decoration = "default:water_source", decoration = "default:water_source",
spawn_by = {"default:dirt_with_grass", "default:water_source"}, spawn_by = {"default:dirt_with_grass", "default:water_source"},
num_spawn_by = 8 num_spawn_by = 8
}) })
end
if minetest.registered_nodes["default:dry_dirt_with_dry_grass"] then -- dry dirt patches
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dry_dirt_with_dry_grass"},
sidelen = 4,
noise_params = {
offset = -1.5,
scale = -1.5,
spread = {x = 200, y = 200, z = 200},
seed = 329,
octaves = 4,
persist = 1.0
},
biomes = {"savanna"},
y_max = 31000,
y_min = 1,
decoration = "default:dry_dirt",
place_offset_y = -1,
flags = "force_placement"
})
end
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dry_dirt_with_dry_grass"},
sidelen = 4,
noise_params = {
offset = -1.5,
scale = -1.5,
spread = {x = 200, y = 200, z = 200},
seed = 329,
octaves = 4,
persist = 1.0
},
biomes = {"savanna"},
y_max = 31000,
y_min = 1,
decoration = "default:dry_dirt",
place_offset_y = -1,
flags = "force_placement"
})
-- helper string -- helper string
local tmp local tmp
-- helper function -- decoration helper function
local add_node = function(a, b, c, d, e, f, g, h, i, j)
local function add_deco(a, b, c, d, e, f, g, h, i, j)
if j ~= 1 then return end if j ~= 1 then return end
@ -102,60 +102,65 @@ local add_node = function(a, b, c, d, e, f, g, h, i, j)
}) })
end end
--firethorn shrub --firethorn shrub
add_node({"default:snowblock"}, 0.001, {"glacier"}, 1, 30,
add_deco({"default:snowblock"}, 0.001, {"glacier"}, 1, 30,
{"ethereal:firethorn"}, nil, nil, nil, ethereal.glacier) {"ethereal:firethorn"}, nil, nil, nil, ethereal.glacier)
-- scorched tree -- scorched tree
add_node({"ethereal:dry_dirt"}, 0.006, {"plains"}, 1, 100,
add_deco({"ethereal:dry_dirt"}, 0.006, {"plains"}, 1, 100,
{"ethereal:scorched_tree"}, 6, nil, nil, ethereal.plains) {"ethereal:scorched_tree"}, 6, nil, nil, ethereal.plains)
-- dry shrub -- dry shrub
add_node({"ethereal:dry_dirt"}, 0.015, {"plains"}, 1, 100,
add_deco({"ethereal:dry_dirt"}, 0.015, {"plains"}, 1, 100,
{"default:dry_shrub"}, nil, nil, nil, ethereal.plains) {"default:dry_shrub"}, nil, nil, nil, ethereal.plains)
add_node({"default:sand"}, 0.015, {"deciduous_forest_ocean"}, 1, 100, add_deco({"default:sand"}, 0.015, {"deciduous_forest_ocean"}, 1, 100,
{"default:dry_shrub"}, nil, nil, nil, ethereal.grassy) {"default:dry_shrub"}, nil, nil, nil, ethereal.grassy)
add_node({"default:desert_sand"}, 0.015, {"desert"}, 1, 100, add_deco({"default:desert_sand"}, 0.015, {"desert"}, 1, 100,
{"default:dry_shrub"}, nil, nil, nil, ethereal.desert) {"default:dry_shrub"}, nil, nil, nil, ethereal.desert)
add_node({"default:sandstone"}, 0.015, {"sandstone_desert"}, 1, 100, add_deco({"default:sandstone"}, 0.015, {"sandstone_desert"}, 1, 100,
{"default:dry_shrub"}, nil, nil, nil, ethereal.sandstone) {"default:dry_shrub"}, nil, nil, nil, ethereal.sandstone)
add_node({"bakedclay:red", "bakedclay:orange"}, 0.015, {"mesa"}, 1, 100, add_deco({"bakedclay:red", "bakedclay:orange"}, 0.015, {"mesa"}, 1, 100,
{"default:dry_shrub"}, nil, nil, nil, ethereal.mesa) {"default:dry_shrub"}, nil, nil, nil, ethereal.mesa)
-- dry grass -- dry grass
add_node({"default:dry_dirt_with_dry_grass",
add_deco({"default:dry_dirt_with_dry_grass",
"default:dirt_with_dry_grass"}, 0.25, {"savanna"}, 1, 100, "default:dirt_with_dry_grass"}, 0.25, {"savanna"}, 1, 100,
{"default:dry_grass_2", "default:dry_grass_3", "default:dry_grass_4", {"default:dry_grass_2", "default:dry_grass_3", "default:dry_grass_4",
"default:dry_grass_5"}, nil, nil, nil, ethereal.savanna) "default:dry_grass_5"}, nil, nil, nil, ethereal.savanna)
add_node({"default:dirt_with_dry_grass"}, 0.10, {"mesa"}, 1, 100, add_deco({"default:dirt_with_dry_grass"}, 0.10, {"mesa"}, 1, 100,
{"default:dry_grass_2", "default:dry_grass_3", "default:dry_grass_4", {"default:dry_grass_2", "default:dry_grass_3", "default:dry_grass_4",
"default:dry_grass_5"}, nil, nil, nil, ethereal.mesa) "default:dry_grass_5"}, nil, nil, nil, ethereal.mesa)
add_node({"default:desert_stone"}, 0.005, {"caves"}, 5, 40, add_deco({"default:desert_stone"}, 0.005, {"caves"}, 5, 40,
{"default:dry_grass_2", "default:dry_grass_3", "default:dry_shrub"}, {"default:dry_grass_2", "default:dry_grass_3", "default:dry_shrub"},
nil, nil, nil, ethereal.caves) nil, nil, nil, ethereal.caves)
-- flowers & strawberry -- flowers & strawberry
add_node({"default:dirt_with_grass"}, 0.025, {"deciduous_forest"}, 1, 100,
add_deco({"default:dirt_with_grass"}, 0.025, {"deciduous_forest"}, 1, 100,
{"flowers:dandelion_white", "flowers:dandelion_yellow", {"flowers:dandelion_white", "flowers:dandelion_yellow",
"flowers:geranium", "flowers:rose", "flowers:tulip", "flowers:geranium", "flowers:rose", "flowers:tulip",
"flowers:viola", "ethereal:strawberry_7"}, nil, nil, nil, "flowers:viola", "ethereal:strawberry_7"}, nil, nil, nil,
ethereal.grassy) ethereal.grassy)
add_node({"default:dirt_with_grass"}, 0.025, {"grassytwo"}, 1, 100, add_deco({"default:dirt_with_grass"}, 0.025, {"grassytwo"}, 1, 100,
{"flowers:dandelion_white", "flowers:dandelion_yellow", {"flowers:dandelion_white", "flowers:dandelion_yellow",
"flowers:geranium", "flowers:rose", "flowers:tulip", "flowers:geranium", "flowers:rose", "flowers:tulip",
"flowers:viola", "ethereal:strawberry_7"}, nil, nil, nil, "flowers:viola", "ethereal:strawberry_7"}, nil, nil, nil,
ethereal.grassytwo) ethereal.grassytwo)
-- prairie flowers & strawberry -- prairie flowers & strawberry
add_node({"ethereal:prairie_dirt"}, 0.035, {"prairie"}, 1, 100,
add_deco({"ethereal:prairie_dirt"}, 0.035, {"prairie"}, 1, 100,
{"flowers:dandelion_white", "flowers:dandelion_yellow", {"flowers:dandelion_white", "flowers:dandelion_yellow",
"flowers:geranium", "flowers:rose", "flowers:tulip", "flowers:geranium", "flowers:rose", "flowers:tulip",
"flowers:viola", "ethereal:strawberry_7", "flowers:viola", "ethereal:strawberry_7",
@ -163,40 +168,43 @@ add_node({"ethereal:prairie_dirt"}, 0.035, {"prairie"}, 1, 100,
ethereal.prairie) ethereal.prairie)
-- crystal spike & crystal grass -- crystal spike & crystal grass
add_node({"ethereal:crystal_dirt"}, 0.02, {"frost", "frost_floatland"}, 1, 1750,
add_deco({"ethereal:crystal_dirt"}, 0.02, {"frost", "frost_floatland"}, 1, 1750,
{"ethereal:crystal_spike", "ethereal:crystalgrass"}, nil, nil, nil, {"ethereal:crystal_spike", "ethereal:crystalgrass"}, nil, nil, nil,
ethereal.frost) ethereal.frost)
-- red shrub -- red shrub
add_node({"ethereal:fiery_dirt"}, 0.10, {"fiery"}, 1, 100,
add_deco({"ethereal:fiery_dirt"}, 0.10, {"fiery"}, 1, 100,
{"ethereal:dry_shrub"}, nil, nil, nil, ethereal.fiery) {"ethereal:dry_shrub"}, nil, nil, nil, ethereal.fiery)
-- snowy grass -- snowy grass
add_node({"ethereal:gray_dirt"}, 0.05, {"grayness"}, 1, 100, add_deco({"ethereal:gray_dirt"}, 0.05, {"grayness"}, 1, 100,
{"ethereal:snowygrass"}, nil, nil, nil, ethereal.grayness) {"ethereal:snowygrass"}, nil, nil, nil, ethereal.grayness)
add_node({"ethereal:cold_dirt", "default:dirt_with_coniferous_litter"}, 0.05, add_deco({"ethereal:cold_dirt", "default:dirt_with_coniferous_litter"}, 0.05,
{"coniferous_forest"}, 1, 100, {"ethereal:snowygrass"}, nil, nil, nil, ethereal.snowy) {"coniferous_forest"}, 1, 100, {"ethereal:snowygrass"}, nil, nil, nil, ethereal.snowy)
-- cactus -- cactus
add_node({"default:sandstone"}, 0.002, {"sandstone_desert"}, 1, 100,
add_deco({"default:sandstone"}, 0.002, {"sandstone_desert"}, 1, 100,
{"default:cactus"}, 3, nil, nil, ethereal.sandstone) {"default:cactus"}, 3, nil, nil, ethereal.sandstone)
add_node({"default:desert_sand"}, 0.005, {"desert"}, 1, 100, add_deco({"default:desert_sand"}, 0.005, {"desert"}, 1, 100,
{"default:cactus"}, 4, nil, nil, ethereal.desert) {"default:cactus"}, 4, nil, nil, ethereal.desert)
-- spore grass -- spore grass
add_node({"ethereal:mushroom_dirt"}, 0.1, {"mushroom"}, 1, 100,
add_deco({"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 -- red and brown mushrooms
minetest.register_decoration({ minetest.register_decoration({
deco_type = "simple", deco_type = "simple",
place_on = { place_on = {
"default:dirt_with_rainforest_litter", "default:dirt_with_rainforest_litter", "default:dirt_with_grass",
"default:dirt_with_grass", "ethereal:prairie_dirt", "ethereal:mushroom_dirt"
"ethereal:prairie_dirt",
"ethereal:mushroom_dirt"
}, },
sidelen = 16, sidelen = 16,
fill_ratio = 0.01, fill_ratio = 0.01,
@ -209,105 +217,107 @@ minetest.register_decoration({
}) })
-- jungle grass -- jungle grass
add_node({"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"},
add_deco({"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"},
0.10, {"junglee"}, 1, 100, {"default:junglegrass"}, nil, nil, nil, 0.10, {"junglee"}, 1, 100, {"default:junglegrass"}, nil, nil, nil,
ethereal.junglee) ethereal.junglee)
add_node({"default:dirt_with_grass"}, 0.15, {"jumble"}, 1, 100, add_deco({"default:dirt_with_grass"}, 0.15, {"jumble"}, 1, 100,
{"default:junglegrass"}, nil, nil, nil, ethereal.jumble) {"default:junglegrass"}, nil, nil, nil, ethereal.jumble)
add_node({"default:dirt_with_grass"}, 0.25, {"swamp"}, 1, 100, add_deco({"default:dirt_with_grass"}, 0.25, {"swamp"}, 1, 100,
{"default:junglegrass"}, nil, nil, nil, ethereal.swamp) {"default:junglegrass"}, nil, nil, nil, ethereal.swamp)
-- grass -- grass
add_node({"default:dirt_with_grass"}, 0.35, {"deciduous_forest"}, 1, 100,
add_deco({"default:dirt_with_grass"}, 0.35, {"deciduous_forest"}, 1, 100,
{"default:grass_2", "default:grass_3", "default:grass_4", {"default:grass_2", "default:grass_3", "default:grass_4",
"default:grass_5"}, nil, nil, nil, ethereal.grassy) "default:grass_5"}, nil, nil, nil, ethereal.grassy)
add_node({"default:dirt_with_grass"}, 0.35, {"grassytwo"}, 1, 100, add_deco({"default:dirt_with_grass"}, 0.35, {"grassytwo"}, 1, 100,
{"default:grass_2", "default:grass_3", "default:grass_4", {"default:grass_2", "default:grass_3", "default:grass_4",
"default:grass_5"}, nil, nil, nil, ethereal.grassytwo) "default:grass_5"}, nil, nil, nil, ethereal.grassytwo)
add_node({"default:dirt_with_grass"}, 0.35, {"jumble"}, 1, 100, add_deco({"default:dirt_with_grass"}, 0.35, {"jumble"}, 1, 100,
{"default:grass_2", "default:grass_3", "default:grass_4", {"default:grass_2", "default:grass_3", "default:grass_4",
"default:grass_5"}, nil, nil, nil, ethereal.jumble) "default:grass_5"}, nil, nil, nil, ethereal.jumble)
add_node({"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"}, add_deco({"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"},
0.35, {"junglee"}, 1, 100, {"default:grass_2", "default:grass_3", 0.35, {"junglee"}, 1, 100, {"default:grass_2", "default:grass_3",
"default:grass_4", "default:grass_5"}, nil, nil, nil, ethereal.junglee) "default:grass_4", "default:grass_5"}, nil, nil, nil, ethereal.junglee)
add_node({"ethereal:prairie_dirt"}, 0.35, {"prairie"}, 1, 100, add_deco({"ethereal:prairie_dirt"}, 0.35, {"prairie"}, 1, 100,
{"default:grass_2", "default:grass_3", "default:grass_4", {"default:grass_2", "default:grass_3", "default:grass_4",
"default:grass_5"}, nil, nil, nil, ethereal.prairie) "default:grass_5"}, nil, nil, nil, ethereal.prairie)
add_node({"ethereal:grove_dirt"}, 0.35, {"grove"}, 1, 100, add_deco({"ethereal:grove_dirt"}, 0.35, {"grove"}, 1, 100,
{"default:grass_2", "default:grass_3", "default:grass_4", {"default:grass_2", "default:grass_3", "default:grass_4",
"default:grass_5"}, nil, nil, nil, ethereal.grove) "default:grass_5"}, nil, nil, nil, ethereal.grove)
add_node({"ethereal:grove_dirt"}, 0.35, {"mediterranean"}, 1, 100, add_deco({"ethereal:grove_dirt"}, 0.35, {"mediterranean"}, 1, 100,
{"default:grass_2", "default:grass_3", "default:grass_4", {"default:grass_2", "default:grass_3", "default:grass_4",
"default:grass_5"}, nil, nil, nil, ethereal.mediterranean) "default:grass_5"}, nil, nil, nil, ethereal.mediterranean)
add_node({"ethereal:bamboo_dirt"}, 0.35, {"bamboo"}, 1, 100, add_deco({"ethereal:bamboo_dirt"}, 0.35, {"bamboo"}, 1, 100,
{"default:grass_2", "default:grass_3", "default:grass_4", {"default:grass_2", "default:grass_3", "default:grass_4",
"default:grass_5"}, nil, nil, nil, ethereal.bamboo) "default:grass_5"}, nil, nil, nil, ethereal.bamboo)
add_node({"default:dirt_with_grass"}, 0.35, {"grassland", "swamp"}, add_deco({"default:dirt_with_grass"}, 0.35, {"grassland", "swamp"},
1, 100, {"default:grass_3", "default:grass_4"}, nil, nil, nil, 1) 1, 100, {"default:grass_3", "default:grass_4"}, nil, nil, nil, 1)
add_node({"ethereal:bamboo_dirt"}, 0.35, {"sakura"}, 1, 100, add_deco({"ethereal:bamboo_dirt"}, 0.35, {"sakura"}, 1, 100,
{"default:grass_2", "default:grass_3", "default:grass_4", {"default:grass_2", "default:grass_3", "default:grass_4",
"default:grass_5"}, nil, nil, nil, ethereal.sakura) "default:grass_5"}, nil, nil, nil, ethereal.sakura)
add_node({"ethereal:bamboo_dirt"}, 0.025, {"sakura"}, 1, 100, add_deco({"ethereal:bamboo_dirt"}, 0.025, {"sakura"}, 1, 100,
{"ethereal:lilac"}, nil, nil, nil, ethereal.sakura) {"ethereal:lilac"}, nil, nil, nil, ethereal.sakura)
-- grass on sand -- marram grass
if minetest.registered_nodes["default:marram_grass_1"] then
add_node({"default:sand"}, 0.25, {"sandclay"}, 3, 4, {"default:marram_grass_1", add_deco({"default:sand"}, 0.25, {"sandclay"}, 3, 4, {"default:marram_grass_1",
"default:marram_grass_2", "default:marram_grass_3"}, nil, nil, nil, "default:marram_grass_2", "default:marram_grass_3"}, nil, nil, nil,
ethereal.sandclay) ethereal.sandclay)
else
add_node({"default:sand"}, 0.25, {"sandclay"}, 3, 4, {"default:grass_2",
"default:grass_3"}, nil, nil, nil, ethereal.sandclay)
end
-- ferns -- ferns
add_node({"ethereal:grove_dirt"}, 0.2, {"grove"}, 1, 100, {"ethereal:fern"},
add_deco({"ethereal:grove_dirt"}, 0.2, {"grove"}, 1, 100, {"ethereal:fern"},
nil, nil, nil, ethereal.grove) nil, nil, nil, ethereal.grove)
add_node({"default:dirt_with_grass"}, 0.1, {"swamp"}, 1, 100, add_deco({"default:dirt_with_grass"}, 0.1, {"swamp"}, 1, 100,
{"ethereal:fern"}, nil, nil, nil, ethereal.swamp) {"ethereal:fern"}, nil, nil, nil, ethereal.swamp)
add_node({"ethereal:crystal_dirt"}, 0.001, {"frost_floatlands"}, 1025, 1750, add_deco({"ethereal:crystal_dirt"}, 0.001, {"frost_floatlands"}, 1025, 1750,
{"ethereal:fern"}, nil, nil, nil, ethereal.frost) {"ethereal:fern"}, nil, nil, nil, ethereal.frost)
-- snow -- snow
add_node({"ethereal:cold_dirt", "default:dirt_with_coniferous_litter"},
add_deco({"ethereal:cold_dirt", "default:dirt_with_coniferous_litter"},
0.8, {"coniferous_forest"}, 20, 40, {"default:snow"}, nil, nil, nil, ethereal.snowy) 0.8, {"coniferous_forest"}, 20, 40, {"default:snow"}, nil, nil, nil, ethereal.snowy)
add_node({"default:dirt_with_snow"}, 0.8, {"taiga"}, 40, 140, add_deco({"default:dirt_with_snow"}, 0.8, {"taiga"}, 40, 140,
{"default:snow"}, nil, nil, nil, ethereal.alpine) {"default:snow"}, nil, nil, nil, ethereal.alpine)
-- Check onion setting -- Check onion setting
local abundant = minetest.settings:get_bool("ethereal.abundant_onions") ~= false local abundant = minetest.settings:get_bool("ethereal.abundant_onions") ~= false
local onion_rate = abundant and 0.025 or 0.005 local onion_rate = abundant and 0.025 or 0.005
-- wild onion -- wild onion
add_node({"default:dirt_with_grass", "ethereal:prairie_dirt"}, onion_rate,
add_deco({"default:dirt_with_grass", "ethereal:prairie_dirt"}, onion_rate,
{"deciduous_forest", "grassytwo", "jumble", "prairie"}, 1, 100, {"deciduous_forest", "grassytwo", "jumble", "prairie"}, 1, 100,
{"ethereal:onion_4"}, nil, nil, nil, 1) {"ethereal:onion_4"}, nil, nil, nil, 1)
-- papyrus -- papyrus
add_node({"default:dirt_with_grass"}, 0.1, {"deciduous_forest"}, 1, 1,
add_deco({"default:dirt_with_grass"}, 0.1, {"deciduous_forest"}, 1, 1,
{"default:papyrus"}, 4, "default:water_source", 1, ethereal.grassy) {"default:papyrus"}, 4, "default:water_source", 1, ethereal.grassy)
add_node({"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"}, add_deco({"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"},
0.1, {"junglee"}, 1, 1, {"default:papyrus"}, 4, "default:water_source", 0.1, {"junglee"}, 1, 1, {"default:papyrus"}, 4, "default:water_source",
1, ethereal.junglee) 1, ethereal.junglee)
add_node({"default:dirt_with_grass"}, 0.1, {"swamp"}, 1, 1, add_deco({"default:dirt_with_grass"}, 0.1, {"swamp"}, 1, 1,
{"default:papyrus"}, 4, "default:water_source", 1, ethereal.swamp) {"default:papyrus"}, 4, "default:water_source", 1, ethereal.swamp)
--= Farming Redo plants --= Farming Redo plants
@ -317,12 +327,14 @@ if farming and farming.mod and farming.mod == "redo" then
print ("[MOD] Ethereal - Farming Redo detected and in use") print ("[MOD] Ethereal - Farming Redo detected and in use")
-- potato -- potato
add_node({"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"},
add_deco({"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"},
0.002, {"junglee"}, 1, 100, {"farming:potato_3"}, nil, nil, nil, 0.002, {"junglee"}, 1, 100, {"farming:potato_3"}, nil, nil, nil,
ethereal.junglee) ethereal.junglee)
-- carrot, cucumber, potato, tomato, corn, coffee, raspberry, rhubarb -- carrot, cucumber, potato, tomato, corn, coffee, raspberry, rhubarb
add_node({"default:dirt_with_grass"}, 0.002, {"grassytwo"}, 1, 100,
add_deco({"default:dirt_with_grass"}, 0.002, {"grassytwo"}, 1, 100,
{"farming:carrot_7", "farming:cucumber_4", "farming:potato_3", "farming:vanilla_7", {"farming:carrot_7", "farming:cucumber_4", "farming:potato_3", "farming:vanilla_7",
"farming:tomato_7", "farming:corn_8", "farming:coffee_5", "farming:blackberry_4", "farming:tomato_7", "farming:corn_8", "farming:coffee_5", "farming:blackberry_4",
"farming:raspberry_4", "farming:rhubarb_3", "farming:blueberry_4", "farming:raspberry_4", "farming:rhubarb_3", "farming:blueberry_4",
@ -330,66 +342,72 @@ add_node({"default:dirt_with_grass"}, 0.002, {"grassytwo"}, 1, 100,
"farming:asparagus"}, nil, nil, nil, "farming:asparagus"}, nil, nil, nil,
ethereal.grassytwo) ethereal.grassytwo)
add_node({"default:dirt_with_grass"}, 0.002, {"deciduous_forest"}, 1, 100, add_deco({"default:dirt_with_grass"}, 0.002, {"deciduous_forest"}, 1, 100,
{"farming:carrot_7", "farming:cucumber_4", "farming:potato_3", "farming:vanilla_7", {"farming:carrot_7", "farming:cucumber_4", "farming:potato_3", "farming:vanilla_7",
"farming:tomato_7", "farming:corn_8", "farming:coffee_5", "farming:blackberry_4", "farming:tomato_7", "farming:corn_8", "farming:coffee_5", "farming:blackberry_4",
"farming:raspberry_4", "farming:rhubarb_3", "farming:blueberry_4", "farming:raspberry_4", "farming:rhubarb_3", "farming:blueberry_4",
"farming:beetroot_5", "farming:sunflower_8", "farming:beetroot_5", "farming:sunflower_8",
"farming:eggplant_3"}, nil, nil, nil, ethereal.grassy) "farming:eggplant_3"}, nil, nil, nil, ethereal.grassy)
add_node({"default:dirt_with_grass"}, 0.002, {"jumble"}, 1, 100, add_deco({"default:dirt_with_grass"}, 0.002, {"jumble"}, 1, 100,
{"farming:carrot_7", "farming:cucumber_4", "farming:potato_3", "farming:vanilla_7", {"farming:carrot_7", "farming:cucumber_4", "farming:potato_3", "farming:vanilla_7",
"farming:tomato_7", "farming:corn_8", "farming:coffee_5", "farming:blackberry_4", "farming:tomato_7", "farming:corn_8", "farming:coffee_5", "farming:blackberry_4",
"farming:raspberry_4", "farming:rhubarb_3", "farming:blueberry_4", "farming:raspberry_4", "farming:rhubarb_3", "farming:blueberry_4",
"farming:cabbage_6", "farming:lettuce_5", "farming:cabbage_6", "farming:lettuce_5",
"farming:spinach_3"}, nil, nil, nil, ethereal.jumble) "farming:spinach_3"}, nil, nil, nil, ethereal.jumble)
add_node({"ethereal:prairie_dirt"}, 0.025, {"prairie"}, 1, 100, add_deco({"ethereal:prairie_dirt"}, 0.025, {"prairie"}, 1, 100,
{"farming:carrot_7", "farming:cucumber_4", "farming:potato_3", "farming:parsley_3", {"farming:carrot_7", "farming:cucumber_4", "farming:potato_3", "farming:parsley_3",
"farming:tomato_7", "farming:corn_8", "farming:coffee_5", "farming:blackberry_4", "farming:tomato_7", "farming:corn_8", "farming:coffee_5", "farming:blackberry_4",
"farming:raspberry_4", "farming:rhubarb_3", "farming:blueberry_4", "farming:raspberry_4", "farming:rhubarb_3", "farming:blueberry_4",
"farming:pea_5", "farming:beetroot_5", "farming:sunflower_8"}, nil, nil, nil, "farming:pea_5", "farming:beetroot_5", "farming:sunflower_8"}, nil, nil, nil,
ethereal.prairie) ethereal.prairie)
add_node({"ethereal:grove_dirt"}, 0.002, {"mediterranean"}, 1, 100, add_deco({"ethereal:grove_dirt"}, 0.002, {"mediterranean"}, 1, 100,
{"farming:parsley_3"}, nil, nil, nil, ethereal.mediterranean) {"farming:parsley_3"}, nil, nil, nil, ethereal.mediterranean)
-- melon and pumpkin -- melon and pumpkin
add_node({"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"},
add_deco({"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"},
0.001, {"junglee"}, 1, 1, {"farming:melon_8", "farming:pumpkin_8"}, 0.001, {"junglee"}, 1, 1, {"farming:melon_8", "farming:pumpkin_8"},
nil, "default:water_source", 1, ethereal.junglee) nil, "default:water_source", 1, ethereal.junglee)
add_node({"default:dirt_with_grass"}, 0.001, {"deciduous_forest"}, 1, 1, add_deco({"default:dirt_with_grass"}, 0.001, {"deciduous_forest"}, 1, 1,
{"farming:melon_8", "farming:pumpkin_8"}, nil, "default:water_source", {"farming:melon_8", "farming:pumpkin_8"}, nil, "default:water_source",
1, ethereal.grassy) 1, ethereal.grassy)
add_node({"default:dirt_with_grass"}, 0.001, {"grassytwo"}, 1, 1, add_deco({"default:dirt_with_grass"}, 0.001, {"grassytwo"}, 1, 1,
{"farming:melon_8", "farming:pumpkin_8"}, nil, "default:water_source", {"farming:melon_8", "farming:pumpkin_8"}, nil, "default:water_source",
1, ethereal.grassytwo) 1, ethereal.grassytwo)
add_node({"default:dirt_with_grass"}, 0.001, {"jumble"}, 1, 1, add_deco({"default:dirt_with_grass"}, 0.001, {"jumble"}, 1, 1,
{"farming:melon_8", "farming:pumpkin_8"}, nil, "default:water_source", {"farming:melon_8", "farming:pumpkin_8"}, nil, "default:water_source",
1, ethereal.jumble) 1, ethereal.jumble)
-- mint -- mint
add_node({"default:dirt_with_grass", "default:dirt_with_coniferous_litter",
add_deco({"default:dirt_with_grass", "default:dirt_with_coniferous_litter",
"ethereal:bamboo_dirt"}, 0.005, nil, 1, 75, "farming:mint_4", nil, "ethereal:bamboo_dirt"}, 0.005, nil, 1, 75, "farming:mint_4", nil,
{"group:water", "group:sand"}, 1, 1) {"group:water", "group:sand"}, 1, 1)
-- green beans -- green beans
add_node({"default:dirt_with_grass"}, 0.001, {"grassytwo"}, 1, 100,
add_deco({"default:dirt_with_grass"}, 0.001, {"grassytwo"}, 1, 100,
{"farming:beanbush"}, nil, nil, nil, ethereal.grassytwo) {"farming:beanbush"}, nil, nil, nil, ethereal.grassytwo)
-- grape bushel -- grape bushel
add_node({"default:dirt_with_grass"}, 0.001, {"grassytwo"}, 1, 100,
add_deco({"default:dirt_with_grass"}, 0.001, {"grassytwo"}, 1, 100,
{"farming:grapebush"}, nil, nil, nil, ethereal.grassytwo) {"farming:grapebush"}, nil, nil, nil, ethereal.grassytwo)
add_node({"default:dirt_with_grass"}, 0.001, {"deciduous_forest"}, 1, 100, add_deco({"default:dirt_with_grass"}, 0.001, {"deciduous_forest"}, 1, 100,
{"farming:grapebush"}, nil, nil, nil, ethereal.grassy) {"farming:grapebush"}, nil, nil, nil, ethereal.grassy)
add_node({"ethereal:prairie_dirt"}, 0.001, {"prairie"}, 1, 100, add_deco({"ethereal:prairie_dirt"}, 0.001, {"prairie"}, 1, 100,
{"farming:grapebush"}, nil, nil, nil, ethereal.prairie) {"farming:grapebush"}, nil, nil, nil, ethereal.prairie)
-- chili, garlic, pepper, onion, hemp, soy, ginger
minetest.register_decoration({ minetest.register_decoration({
deco_type = "simple", deco_type = "simple",
place_on = {"default:dirt_with_grass", "ethereal:prairie_dirt", place_on = {"default:dirt_with_grass", "ethereal:prairie_dirt",
@ -414,6 +432,8 @@ minetest.register_decoration({
num_spawn_by = 1 num_spawn_by = 1
}) })
-- pineapple,soy
minetest.register_decoration({ minetest.register_decoration({
deco_type = "simple", deco_type = "simple",
place_on = {"default:dirt_with_dry_grass"}, place_on = {"default:dirt_with_dry_grass"},
@ -431,6 +451,8 @@ minetest.register_decoration({
decoration = {"farming:pineapple_8", "farming:soy_5"} decoration = {"farming:pineapple_8", "farming:soy_5"}
}) })
-- artichoke
minetest.register_decoration({ minetest.register_decoration({
deco_type = "simple", deco_type = "simple",
place_on = {"ethereal:grove_dirt"}, place_on = {"ethereal:grove_dirt"},
@ -451,15 +473,14 @@ minetest.register_decoration({
}) })
end end
-- new flowers from baked clay mod
-- is baked clay mod active? add new flowers if so
if minetest.get_modpath("bakedclay") then if minetest.get_modpath("bakedclay") then
minetest.register_decoration({ minetest.register_decoration({
deco_type = "simple", deco_type = "simple",
place_on = { place_on = {
"ethereal:prairie_dirt", "default:dirt_with_grass", "ethereal:prairie_dirt", "default:dirt_with_grass", "ethereal:grove_dirt"
"ethereal:grove_dirt"
}, },
sidelen = 16, sidelen = 16,
noise_params = { noise_params = {
@ -534,6 +555,7 @@ minetest.register_decoration({
}) })
end end
-- blue agave from wine mod
if ethereal.desert == 1 and minetest.get_modpath("wine") then if ethereal.desert == 1 and minetest.get_modpath("wine") then
@ -548,7 +570,7 @@ if ethereal.desert == 1 and minetest.get_modpath("wine") then
end end
if ethereal.snowy == 1 and minetest.registered_nodes["default:fern_1"] then if ethereal.snowy == 1 then
local function register_fern_decoration(seed, length) local function register_fern_decoration(seed, length)
@ -577,8 +599,9 @@ if ethereal.snowy == 1 and minetest.registered_nodes["default:fern_1"] then
register_fern_decoration(5, 1) register_fern_decoration(5, 1)
end end
-- Tundra moss and stones
if ethereal.tundra == 1 and minetest.registered_nodes["default:permafrost"] then if ethereal.tundra == 1 then
-- Tundra moss -- Tundra moss
@ -628,6 +651,7 @@ if ethereal.tundra == 1 and minetest.registered_nodes["default:permafrost"] then
}) })
end end
-- butterflies mod
if minetest.get_modpath("butterflies") then if minetest.get_modpath("butterflies") then
@ -659,12 +683,11 @@ if minetest.get_modpath("butterflies") then
}, },
run_at_every_load = true, run_at_every_load = true,
action = function(pos) action = function(pos) minetest.get_node_timer(pos):start(5) end
minetest.get_node_timer(pos):start(5)
end
}) })
end end
-- fireflies mod
if minetest.get_modpath("fireflies") then if minetest.get_modpath("fireflies") then
@ -694,70 +717,65 @@ if minetest.get_modpath("fireflies") then
nodenames = {"fireflies:firefly", "fireflies:hidden_firefly"}, nodenames = {"fireflies:firefly", "fireflies:hidden_firefly"},
run_at_every_load = true, run_at_every_load = true,
action = function(pos) action = function(pos) minetest.get_node_timer(pos):start(5) end
minetest.get_node_timer(pos):start(5)
end
}) })
end end
-- Coral Reef
-- Coral Reef (Minetest 5.0) minetest.register_decoration({
if minetest.registered_nodes["default:coral_green"] then name = "default:corals",
deco_type = "simple",
place_on = {"default:sand"},
place_offset_y = -1,
sidelen = 4,
noise_params = {
offset = -4,
scale = 4,
spread = {x = 50, y = 50, z = 50},
seed = 7013,
octaves = 3,
persist = 0.7,
},
biomes = {"desert_ocean", "savanna_ocean", "junglee_ocean"},
y_max = -2,
y_min = -8,
flags = "force_placement",
decoration = {
"default:coral_green", "default:coral_pink",
"default:coral_cyan", "default:coral_brown",
"default:coral_orange", "default:coral_skeleton"
}
})
minetest.register_decoration({ -- Kelp
name = "default:corals",
deco_type = "simple",
place_on = {"default:sand"},
place_offset_y = -1,
sidelen = 4,
noise_params = {
offset = -4,
scale = 4,
spread = {x = 50, y = 50, z = 50},
seed = 7013,
octaves = 3,
persist = 0.7,
},
biomes = {"desert_ocean", "savanna_ocean", "junglee_ocean"},
y_max = -2,
y_min = -8,
flags = "force_placement",
decoration = {
"default:coral_green", "default:coral_pink",
"default:coral_cyan", "default:coral_brown",
"default:coral_orange", "default:coral_skeleton"
}
})
-- Kelp
minetest.register_decoration({
name = "default:kelp",
deco_type = "simple",
place_on = {"default:sand"},
place_offset_y = -1,
sidelen = 16,
noise_params = {
offset = -0.04,
scale = 0.1,
spread = {x = 200, y = 200, z = 200},
seed = 87112,
octaves = 3,
persist = 0.7
},
biomes = {
"frost_ocean", "deciduous_forest_ocean", "sandstone_ocean", "swamp_ocean"},
y_max = -5,
y_min = -10,
flags = "force_placement",
decoration = "default:sand_with_kelp",
param2 = 48,
param2_max = 96
})
end
minetest.register_decoration({
name = "default:kelp",
deco_type = "simple",
place_on = {"default:sand"},
place_offset_y = -1,
sidelen = 16,
noise_params = {
offset = -0.04,
scale = 0.1,
spread = {x = 200, y = 200, z = 200},
seed = 87112,
octaves = 3,
persist = 0.7
},
biomes = {
"frost_ocean", "deciduous_forest_ocean", "sandstone_ocean", "swamp_ocean"},
y_max = -5,
y_min = -10,
flags = "force_placement",
decoration = "default:sand_with_kelp",
param2 = 48,
param2_max = 96
})
-- illumishrooms using underground decoration placement -- illumishrooms using underground decoration placement
local function add_illumishroom(low, high, nodename) local function add_illumishroom(low, high, nodename)
minetest.register_decoration({ minetest.register_decoration({

View File

@ -1,14 +1,16 @@
local S = ethereal.translate local S = minetest.get_translator("ethereal")
-- override default dirt (to stop caves cutting away dirt) -- override default dirt (to stop caves cutting away dirt)
minetest.override_item("default:dirt", {is_ground_content = ethereal.cavedirt}) minetest.override_item("default:dirt", {is_ground_content = ethereal.cavedirt})
-- replace old green_dirt with default grass
minetest.register_alias("ethereal:green_dirt", "default:dirt_with_grass") minetest.register_alias("ethereal:green_dirt", "default:dirt_with_grass")
-- dry dirt -- dry dirt
minetest.register_node("ethereal:dry_dirt", { minetest.register_node("ethereal:dry_dirt", {
description = S("Dried Dirt"), description = S("Dried Dirt"),
tiles = {"ethereal_dry_dirt.png"}, tiles = {"ethereal_dry_dirt.png"},
@ -24,12 +26,14 @@ minetest.register_craft({
cooktime = 3, cooktime = 3,
}) })
-- ethereal dirt types
-- register ethereal dirt types
local dirts = { local dirts = {
"Bamboo", "Jungle", "Grove", "Prairie", "Cold", "Crystal", "Mushroom", "Fiery", "Gray" "Bamboo", "Jungle", "Grove", "Prairie", "Cold", "Crystal", "Mushroom", "Fiery", "Gray"
} }
-- loop through and register dirts
for n = 1, #dirts do for n = 1, #dirts do
local desc = dirts[n] local desc = dirts[n]
@ -38,8 +42,7 @@ for n = 1, #dirts do
minetest.register_node("ethereal:" .. name .. "_dirt", { minetest.register_node("ethereal:" .. name .. "_dirt", {
description = S(desc .. " Dirt"), description = S(desc .. " Dirt"),
tiles = { tiles = {
"ethereal_grass_" .. name .. "_top.png", "ethereal_grass_" .. name .. "_top.png", "default_dirt.png",
"default_dirt.png",
{ {
name = "default_dirt.png^ethereal_grass_" .. name .. "_side.png", name = "default_dirt.png^ethereal_grass_" .. name .. "_side.png",
tileable_vertical = false tileable_vertical = false
@ -59,23 +62,18 @@ for n = 1, #dirts do
}) })
end end
-- flower spread, also crystal and fire flower regeneration -- flower spread, also crystal and fire flower regeneration
local flower_spread = function(pos, node) local flower_spread = function(pos, node)
if (minetest.get_node_light(pos) or 0) < 13 then if (minetest.get_node_light(pos) or 0) < 13 then return end
return
end
local pos0 = {x = pos.x - 4, y = pos.y - 2, z = pos.z - 4} local pos0 = {x = pos.x - 4, y = pos.y - 2, z = pos.z - 4}
local pos1 = {x = pos.x + 4, y = pos.y + 2, z = pos.z + 4} local pos1 = {x = pos.x + 4, y = pos.y + 2, z = pos.z + 4}
local num = #minetest.find_nodes_in_area(pos0, pos1, "group:flora") local num = #minetest.find_nodes_in_area(pos0, pos1, "group:flora")
-- stop flowers spreading too much just below top of map block -- stop flowers spreading too much just below top of map block
if minetest.find_node_near(pos, 2, "ignore") then if minetest.find_node_near(pos, 2, "ignore") then return end
return
end
if num > 3 and node.name == "ethereal:crystalgrass" then if num > 3 and node.name == "ethereal:crystalgrass" then
@ -135,8 +133,7 @@ local flower_spread = function(pos, node)
return return
end end
local seedling = minetest.find_nodes_in_area_under_air( local seedling = minetest.find_nodes_in_area_under_air(pos0, pos1, {under.name})
pos0, pos1, {under.name})
if #seedling > 0 then if #seedling > 0 then
@ -144,16 +141,14 @@ local flower_spread = function(pos, node)
pos.y = pos.y + 1 pos.y = pos.y + 1
if (minetest.get_node_light(pos) or 0) < 13 then if (minetest.get_node_light(pos) or 0) < 13 then return end
return
end
minetest.swap_node(pos, {name = node.name}) minetest.swap_node(pos, {name = node.name})
end end
end end
-- grow papyrus up to 4 high and bamboo up to 8 high -- grow papyrus up to 4 high and bamboo up to 8 high
local grow_papyrus = function(pos, node) local grow_papyrus = function(pos, node)
local oripos = pos.y local oripos = pos.y
@ -165,32 +160,24 @@ local grow_papyrus = function(pos, node)
if not nod if not nod
or minetest.get_item_group(nod.name, "soil") < 1 or minetest.get_item_group(nod.name, "soil") < 1
or minetest.find_node_near(pos, 3, {"group:water"}) == nil then or minetest.find_node_near(pos, 3, {"group:water"}) == nil then return end
return
end
if node.name == "ethereal:bamboo" then if node.name == "ethereal:bamboo" then high = 8 end
high = 8
end
pos.y = pos.y + 1 pos.y = pos.y + 1
local height = 0 local height = 0
while height < high while height < high and minetest.get_node(pos).name == node.name do
and minetest.get_node(pos).name == node.name do
height = height + 1 height = height + 1
pos.y = pos.y + 1 pos.y = pos.y + 1
end end
nod = minetest.get_node_or_nil(pos) nod = minetest.get_node_or_nil(pos)
if nod if nod and nod.name == "air" and height < high then
and nod.name == "air"
and height < high then
if node.name == "ethereal:bamboo" if node.name == "ethereal:bamboo" and height == (high - 1) then
and height == (high - 1) then
ethereal.grow_bamboo_tree({x = pos.x, y = oripos, z = pos.z}) ethereal.grow_bamboo_tree({x = pos.x, y = oripos, z = pos.z})
else else
@ -201,11 +188,10 @@ local grow_papyrus = function(pos, node)
end end
-- override abm function -- override abm function
local function override_abm(name, redef) local function override_abm(name, redef)
if not name or not redef then if not name or not redef then return end
return
end
for _, ab in pairs(minetest.registered_abms) do for _, ab in pairs(minetest.registered_abms) do
@ -241,8 +227,8 @@ override_abm("Mushroom spread", {
nodenames = {"group:mushroom"} nodenames = {"group:mushroom"}
}) })
-- Add Red, Orange and Grey baked clay if mod isn't active
-- If Baked Clay mod not active, make Red, Orange and Grey nodes
if not minetest.get_modpath("bakedclay") then if not minetest.get_modpath("bakedclay") then
minetest.register_node(":bakedclay:red", { minetest.register_node(":bakedclay:red", {
@ -270,30 +256,8 @@ if not minetest.get_modpath("bakedclay") then
}) })
end end
-- Quicksand (new style, sinking inside shows yellow effect
-- Quicksand (old style, sinking inside shows black instead of yellow effect,
-- works ok with noclip enabled though)
minetest.register_node("ethereal:quicksand", {
description = S("Quicksand"),
tiles = {"default_sand.png"},
drop = "default:sand",
liquid_viscosity = 15,
liquidtype = "source",
liquid_alternative_flowing = "ethereal:quicksand",
liquid_alternative_source = "ethereal:quicksand",
liquid_renewable = false,
liquid_range = 0,
drowning = 1,
walkable = false,
climbable = false,
post_effect_color = {r = 230, g = 210, b = 160, a = 245},
groups = {crumbly = 3, sand = 1, liquid = 3, disable_jump = 1,
not_in_creative_inventory = 1},
sounds = default.node_sound_sand_defaults()
})
-- Quicksand (new style, sinking inside shows yellow effect with or without noclip,
-- but old quicksand is shown as black until block placed nearby to update light)
minetest.register_node("ethereal:quicksand2", { minetest.register_node("ethereal:quicksand2", {
description = S("Quicksand"), description = S("Quicksand"),
tiles = {"default_sand.png^[colorize:#00004F10"}, tiles = {"default_sand.png^[colorize:#00004F10"},
@ -314,7 +278,12 @@ minetest.register_node("ethereal:quicksand2", {
sounds = default.node_sound_sand_defaults() sounds = default.node_sound_sand_defaults()
}) })
-- alias old quicksand to new
minetest.register_alias("ethereal:quicksand", "ethereal:quicksand2")
-- craft quicksand -- craft quicksand
minetest.register_craft({ minetest.register_craft({
output = "ethereal:quicksand2", output = "ethereal:quicksand2",
recipe = { recipe = {
@ -322,7 +291,5 @@ minetest.register_craft({
{"group:sand", "bucket:bucket_water", "group:sand"}, {"group:sand", "bucket:bucket_water", "group:sand"},
{"group:sand", "group:sand", "group:sand"} {"group:sand", "group:sand", "group:sand"}
}, },
replacements = { replacements = {{"bucket:bucket_water", "bucket:bucket_empty"}}
{"bucket:bucket_water", "bucket:bucket_empty"}
}
}) })

View File

@ -1,8 +1,33 @@
local S = ethereal.translate local S = minetest.get_translator("ethereal")
-- Blue Marble Nodes and recipe
minetest.register_node("ethereal:blue_marble", {
description = S("Blue Marble"),
tiles = {"ethereal_blue_marble.png"},
groups = {cracky = 1, stone = 1},
sounds = default.node_sound_stone_defaults()
})
minetest.register_node("ethereal:blue_marble_tile", {
description = S("Blue Marble Tile"),
tiles = {"ethereal_blue_marble_tile.png"},
groups = {cracky = 1, stone = 1},
sounds = default.node_sound_stone_defaults()
})
minetest.register_craft({
output = "ethereal:blue_marble_tile 9",
recipe = {
{"ethereal:blue_marble", "ethereal:blue_marble", "ethereal:blue_marble"},
{"ethereal:blue_marble", "ethereal:blue_marble", "ethereal:blue_marble"},
{"ethereal:blue_marble", "ethereal:blue_marble", "ethereal:blue_marble"}
}
})
-- Etherium Dust -- Etherium Dust
minetest.register_craftitem("ethereal:etherium_dust", { minetest.register_craftitem("ethereal:etherium_dust", {
description = S("Etherium Dust"), description = S("Etherium Dust"),
inventory_image = "ethereal_etherium_dust.png", inventory_image = "ethereal_etherium_dust.png",
@ -10,6 +35,7 @@ minetest.register_craftitem("ethereal:etherium_dust", {
}) })
-- Ethereium Ore -- Ethereium Ore
minetest.register_node("ethereal:etherium_ore", { minetest.register_node("ethereal:etherium_ore", {
description = S("Etherium Ore"), description = S("Etherium Ore"),
tiles = {"default_desert_stone.png^ethereal_etherium_ore.png"}, tiles = {"default_desert_stone.png^ethereal_etherium_ore.png"},
@ -26,8 +52,8 @@ minetest.register_node("ethereal:stone_with_etherium_ore", {
sounds = default.node_sound_stone_defaults() sounds = default.node_sound_stone_defaults()
}) })
-- Bamboo Flooring -- Bamboo Flooring
minetest.register_node("ethereal:bamboo_floor", { minetest.register_node("ethereal:bamboo_floor", {
description = S("Bamboo Floor"), description = S("Bamboo Floor"),
drawtype = "nodebox", drawtype = "nodebox",
@ -56,8 +82,8 @@ minetest.register_craft({
} }
}) })
-- Bamboo Block -- Bamboo Block
minetest.register_node("ethereal:bamboo_block", { minetest.register_node("ethereal:bamboo_block", {
description = S("Bamboo Block"), description = S("Bamboo Block"),
tiles = {"ethereal_bamboo_floor.png"}, tiles = {"ethereal_bamboo_floor.png"},
@ -83,8 +109,8 @@ minetest.register_craft({
} }
}) })
-- Paper recipes -- Paper recipes
minetest.register_craft({ minetest.register_craft({
output = "default:paper 6", output = "default:paper 6",
recipe = { recipe = {
@ -101,8 +127,8 @@ minetest.register_craft({
} }
}) })
-- 4x red mushrooms make mushroom block -- 4x red mushrooms make mushroom block
minetest.register_craft({ minetest.register_craft({
output = "ethereal:mushroom", output = "ethereal:mushroom",
recipe = { recipe = {
@ -120,6 +146,7 @@ minetest.register_craft({
}) })
-- X pattern craft recipes (5x 'a' in X pattern gives 5 of 'b') -- X pattern craft recipes (5x 'a' in X pattern gives 5 of 'b')
if ethereal.xcraft == true then if ethereal.xcraft == true then
local cheat = { local cheat = {
@ -144,8 +171,8 @@ if ethereal.xcraft == true then
end end
end end
-- Palm Wax -- Palm Wax
minetest.register_craftitem("ethereal:palm_wax", { minetest.register_craftitem("ethereal:palm_wax", {
description = S("Palm Wax"), description = S("Palm Wax"),
inventory_image = "ethereal_palm_wax.png", inventory_image = "ethereal_palm_wax.png",
@ -159,6 +186,7 @@ minetest.register_craft({
recipe = "ethereal:palmleaves" recipe = "ethereal:palmleaves"
}) })
-- candle helper function
local function add_candle(col, dcol) local function add_candle(col, dcol)
@ -178,10 +206,7 @@ local function add_candle(col, dcol)
{ {
name = "ethereal_candle" .. col .. ".png", name = "ethereal_candle" .. col .. ".png",
animation = { animation = {
type="vertical_frames", type="vertical_frames", aspect_w = 32, aspect_h = 32, length = 1.0
aspect_w = 32,
aspect_h = 32,
length = 1.0
} }
} }
}, },
@ -192,8 +217,7 @@ local function add_candle(col, dcol)
groups = {candle = 1, dig_immediate = 3, attached_node = 1}, groups = {candle = 1, dig_immediate = 3, attached_node = 1},
sounds = default.node_sound_defaults(), sounds = default.node_sound_defaults(),
selection_box = { selection_box = {
type = "fixed", type = "fixed", fixed = { -0.15, -0.5, -0.15, 0.15, 0, 0.15 }
fixed = { -0.15, -0.5, -0.15, 0.15, 0, 0.15 }
} }
}) })
@ -224,8 +248,8 @@ add_candle("red", "Red ")
add_candle("violet", "Violet ") add_candle("violet", "Violet ")
add_candle("yellow", "Yellow ") add_candle("yellow", "Yellow ")
-- white candle recipe -- white candle recipe
minetest.register_craft({ minetest.register_craft({
output = "ethereal:candle", output = "ethereal:candle",
recipe = { recipe = {
@ -233,7 +257,8 @@ minetest.register_craft({
} }
}) })
-- candle recipe -- base candle recipe
minetest.register_craft({ minetest.register_craft({
output = "ethereal:candle 2", output = "ethereal:candle 2",
recipe = { recipe = {
@ -243,15 +268,16 @@ minetest.register_craft({
} }
}) })
-- Wooden Bowl -- Wooden Bowl
minetest.register_craftitem("ethereal:bowl", { minetest.register_craftitem("ethereal:bowl", {
description = S("Bowl"), description = S("Bowl"),
inventory_image = "ethereal_bowl.png", inventory_image = "ethereal_bowl.png",
groups = {food_bowl = 1, flammable = 2} groups = {food_bowl = 1, flammable = 2}
}) })
-- use farming redo's recipe if found -- dont add bowl recipe if farming redo already has one
if not minetest.registered_items["farming:bowl"] then if not minetest.registered_items["farming:bowl"] then
minetest.register_craft({ minetest.register_craft({
@ -263,8 +289,8 @@ if not minetest.registered_items["farming:bowl"] then
}) })
end end
-- stone Ladder -- stone Ladder
minetest.register_node("ethereal:stone_ladder", { minetest.register_node("ethereal:stone_ladder", {
description = S("Stone Ladder"), description = S("Stone Ladder"),
drawtype = "signlike", drawtype = "signlike",
@ -277,9 +303,7 @@ minetest.register_node("ethereal:stone_ladder", {
walkable = false, walkable = false,
climbable = true, climbable = true,
is_ground_content = false, is_ground_content = false,
selection_box = { selection_box = {type = "wallmounted"},
type = "wallmounted"
},
groups = {cracky = 3, oddly_breakable_by_hand = 1}, groups = {cracky = 3, oddly_breakable_by_hand = 1},
legacy_wallmounted = true, legacy_wallmounted = true,
sounds = default.node_sound_stone_defaults() sounds = default.node_sound_stone_defaults()
@ -294,8 +318,8 @@ minetest.register_craft({
} }
}) })
-- Paper Wall -- Paper Wall
minetest.register_node("ethereal:paper_wall", { minetest.register_node("ethereal:paper_wall", {
drawtype = "nodebox", drawtype = "nodebox",
description = S("Paper Wall"), description = S("Paper Wall"),
@ -310,14 +334,10 @@ minetest.register_node("ethereal:paper_wall", {
sunlight_propagates = true, sunlight_propagates = true,
paramtype2 = "facedir", paramtype2 = "facedir",
selection_box = { selection_box = {
type = "fixed", type = "fixed", fixed = {-0.5, -0.5, 5/11, 0.5, 0.5, 8/16}
fixed = {-0.5, -0.5, 5/11, 0.5, 0.5, 8/16}
}, },
node_box = { node_box = {
type = "fixed", type = "fixed", fixed = {{-0.5, -0.5, 5/11, 0.5, 0.5, 8/16}}
fixed = {
{-0.5, -0.5, 5/11, 0.5, 0.5, 8/16}
}
} }
}) })
@ -330,8 +350,8 @@ minetest.register_craft({
} }
}) })
-- Glostone (A little bit of light decoration) -- Glostone (A little bit of light decoration)
minetest.register_node("ethereal:glostone", { minetest.register_node("ethereal:glostone", {
description = S("Glo Stone"), description = S("Glo Stone"),
tiles = {"ethereal_glostone.png"}, tiles = {"ethereal_glostone.png"},
@ -350,8 +370,8 @@ minetest.register_craft({
} }
}) })
-- Charcoal Lump -- Charcoal Lump
minetest.register_craftitem("ethereal:charcoal_lump", { minetest.register_craftitem("ethereal:charcoal_lump", {
description = S("Lump of Charcoal"), description = S("Lump of Charcoal"),
inventory_image = "ethereal_charcoal_lump.png" inventory_image = "ethereal_charcoal_lump.png"
@ -378,6 +398,7 @@ minetest.register_craft({
}) })
-- Make Torch from Charcoal Lump -- Make Torch from Charcoal Lump
minetest.register_craft({ minetest.register_craft({
output = "default:torch 4", output = "default:torch 4",
recipe = { recipe = {
@ -386,14 +407,15 @@ minetest.register_craft({
} }
}) })
-- staff of light alternative node list -- staff of light alternative node list
ethereal.lightstaff_recipes = { ethereal.lightstaff_recipes = {
["nether:rack"] = "nether:glowstone", ["nether:rack"] = "nether:glowstone",
["nether:rack_deep"] = "nether:glowstone_deep" ["nether:rack_deep"] = "nether:glowstone_deep"
} }
-- Staff of Light (by Xanthin) -- Staff of Light (by Xanthin)
minetest.register_tool("ethereal:light_staff", { minetest.register_tool("ethereal:light_staff", {
description = S("Staff of Light"), description = S("Staff of Light"),
inventory_image = "ethereal_light_staff.png", inventory_image = "ethereal_light_staff.png",
@ -404,9 +426,7 @@ minetest.register_tool("ethereal:light_staff", {
on_use = function(itemstack, user, pointed_thing) on_use = function(itemstack, user, pointed_thing)
if pointed_thing.type ~= "node" then if pointed_thing.type ~= "node" then return end
return
end
local pos = pointed_thing.under local pos = pointed_thing.under
local pname = user:get_player_name() local pname = user:get_player_name()

View File

@ -1,9 +1,12 @@
local S = ethereal.translate -- translation and mod check
local S = minetest.get_translator("ethereal")
local door_mod = minetest.get_modpath("doors") local door_mod = minetest.get_modpath("doors")
local add_fence = function(name, node, desc, texture) -- fence registration helper (fence, rail, gate, mese post)
local function add_fence(name, node, desc, texture)
if default.register_fence then if default.register_fence then
@ -48,6 +51,7 @@ local add_fence = function(name, node, desc, texture)
end end
end end
-- add wooden fences, gates and mese posts
add_fence("scorched", "scorched_tree", "Scorched", "ethereal_scorched_tree") add_fence("scorched", "scorched_tree", "Scorched", "ethereal_scorched_tree")
add_fence("frostwood", "frost_wood", "Frost", "ethereal_frost_wood") add_fence("frostwood", "frost_wood", "Frost", "ethereal_frost_wood")
@ -63,21 +67,19 @@ add_fence("olive", "olive_wood", "Olive", "ethereal_olive_wood")
add_fence("basandra", "basandra_wood", "Basandra", "ethereal_basandra_bush_wood") add_fence("basandra", "basandra_wood", "Basandra", "ethereal_basandra_bush_wood")
-- add compatibility for ethereal's to default wooden gates -- add compatibility for previous ethereal gates
minetest.register_alias("ethereal:fencegate_wood_open", "doors:gate_wood_open") minetest.register_alias("ethereal:fencegate_wood_open", "doors:gate_wood_open")
minetest.register_alias("ethereal:fencegate_wood_closed", "doors:gate_wood_closed") minetest.register_alias("ethereal:fencegate_wood_closed", "doors:gate_wood_closed")
minetest.register_alias("ethereal:fencegate_acacia_open", "doors:gate_acacia_wood_open") minetest.register_alias("ethereal:fencegate_acacia_open", "doors:gate_acacia_wood_open")
minetest.register_alias("ethereal:fencegate_acacia_closed", "doors:gate_acacia_wood_closed") minetest.register_alias("ethereal:fencegate_acacia_closed", "doors:gate_acacia_wood_closed")
minetest.register_alias("ethereal:fencegate_junglewood_open", "doors:gate_junglewood_open") minetest.register_alias("ethereal:fencegate_junglewood_open", "doors:gate_junglewood_open")
minetest.register_alias("ethereal:fencegate_junglewood_closed", "doors:gate_junglewood_closed") minetest.register_alias("ethereal:fencegate_junglewood_closed", "doors:gate_junglewood_closed")
minetest.register_alias("ethereal:fencegate_pine_open", "doors:gate_pine_wood_open") minetest.register_alias("ethereal:fencegate_pine_open", "doors:gate_pine_wood_open")
minetest.register_alias("ethereal:fencegate_pine_closed", "doors:gate_pine_wood_closed") minetest.register_alias("ethereal:fencegate_pine_closed", "doors:gate_pine_wood_closed")
-- sakura door -- sakura door
if door_mod then if door_mod then
doors.register("ethereal:door_sakura", { doors.register("ethereal:door_sakura", {

View File

@ -4,7 +4,7 @@
]]-- ]]--
local S = ethereal.translate -- fish and where they can be caught
local fish_items = { local fish_items = {
"ethereal:fish_bluefin", "ethereal:fish_bluefin",
@ -46,10 +46,15 @@ local fish_items = {
-- sandstone_desert_ocean, plains_ocean, savanna_ocean, fiery_ocean, swamp_ocean, -- sandstone_desert_ocean, plains_ocean, savanna_ocean, fiery_ocean, swamp_ocean,
-- glacier_ocean, tundra_ocean -- glacier_ocean, tundra_ocean
-- translation and mod checks
local S = minetest.get_translator("ethereal")
local mod_bonemeal = minetest.get_modpath("bonemeal") local mod_bonemeal = minetest.get_modpath("bonemeal")
local mod_armor = minetest.get_modpath("3d_armor") local mod_armor = minetest.get_modpath("3d_armor")
local mod_mobs = minetest.get_modpath("mobs") local mod_mobs = minetest.get_modpath("mobs")
-- junk items to be found
local junk_items = { local junk_items = {
"ethereal:bowl", "ethereal:bowl",
"default:stick", "default:stick",
@ -65,6 +70,8 @@ local junk_items = {
mod_armor and "3d_armor:boots_wood 6000" or "default:stick" mod_armor and "3d_armor:boots_wood 6000" or "default:stick"
} }
-- bonus items to be found
local bonus_items = { local bonus_items = {
mod_mobs and "mobs:nametag" or "fireflies:bug_net", mod_mobs and "mobs:nametag" or "fireflies:bug_net",
mod_mobs and "mobs:net" or "default:sapling", mod_mobs and "mobs:net" or "default:sapling",
@ -80,28 +87,25 @@ local bonus_items = {
"ethereal:fishing_rod 9000" "ethereal:fishing_rod 9000"
} }
-- helpers
local default_item = "default:dirt" local default_item = "default:dirt"
local random = math.random -- yup we use this a lot local random = math.random -- yup we use this a lot
-- global add item function
-- add item function
ethereal.add_item = function(fish, junk, bonus) ethereal.add_item = function(fish, junk, bonus)
if fish and fish ~= "" then if fish and fish ~= "" then table.insert(fish_items, fish) end
table.insert(fish_items, fish)
end
if junk and junk ~= "" then if junk and junk ~= "" then table.insert(junk_items, junk) end
table.insert(junk_items, junk)
end
if bonus and bonus ~= "" then if bonus and bonus ~= "" then table.insert(bonus_items, bonus) end
table.insert(bonus_items, bonus)
end
end end
-- bubble particle effect
local effect = function(pos) local function effect(pos)
minetest.add_particle({ minetest.add_particle({
pos = { pos = {
@ -119,8 +123,8 @@ local effect = function(pos)
}) })
end end
-- fishing bob entity -- fishing bob entity
minetest.register_entity("ethereal:bob_entity", { minetest.register_entity("ethereal:bob_entity", {
initial_properties = { initial_properties = {
@ -157,8 +161,8 @@ if not self.cast then
-- incase of lag find water level -- incase of lag find water level
local free_fall, blocker = minetest.line_of_sight( local free_fall, blocker = minetest.line_of_sight(
{x = pos.x, y = pos.y + 2, z = pos.z}, {x = pos.x, y = pos.y + 2, z = pos.z},
{x = pos.x, y = pos.y , z = pos.z}) {x = pos.x, y = pos.y , z = pos.z})
-- do we have worms for bait, if so take one -- do we have worms for bait, if so take one
local player = self.fisher and minetest.get_player_by_name(self.fisher) local player = self.fisher and minetest.get_player_by_name(self.fisher)
@ -185,8 +189,8 @@ if not self.cast then
-- splash -- splash
effect(pos) ; effect(pos) ; effect(pos) ; effect(pos) effect(pos) ; effect(pos) ; effect(pos) ; effect(pos)
minetest.sound_play("default_water_footstep", { minetest.sound_play("default_water_footstep",
pos = pos, gain = 0.1}, true) {pos = pos, gain = 0.1}, true)
end end
else -- already cast and waiting for fish else -- already cast and waiting for fish
@ -222,12 +226,9 @@ else -- already cast and waiting for fish
-- remove bob if player is too far away -- remove bob if player is too far away
local pla_pos = player:get_pos() local pla_pos = player:get_pos()
if (pla_pos.y - pos.y) > 15 if (pla_pos.y - pos.y) > 15 or (pla_pos.y - pos.y) < -15
or (pla_pos.y - pos.y) < -15 or (pla_pos.x - pos.x) > 15 or (pla_pos.x - pos.x) < -15
or (pla_pos.x - pos.x) > 15 or (pla_pos.z - pos.z) > 15 or (pla_pos.z - pos.z) < -15 then
or (pla_pos.x - pos.x) < -15
or (pla_pos.z - pos.z) > 15
or (pla_pos.z - pos.z) < -15 then
self.object:remove() ; --print("-- out of range") self.object:remove() ; --print("-- out of range")
@ -298,8 +299,8 @@ end -- if not self.cast
end -- on_step end -- on_step
}) })
-- narrow item list depending on biome
-- narrow item list depending on biome if applicable
local find_item = function(list, pos) local find_item = function(list, pos)
local item local item
@ -327,15 +328,13 @@ local find_item = function(list, pos)
--print("==biome: " .. biome, dump(items)) --print("==biome: " .. biome, dump(items))
if #items > 0 then if #items > 0 then return items[random(#items)] end
return items[random(#items)]
end
return "" return ""
end end
-- fishing rod function that throws pre bob, places bob and catches fish when it moves -- fishing rod function that throws pre bob, places bob and catches fish when it moves
local use_rod = function(itemstack, player, pointed_thing) local use_rod = function(itemstack, player, pointed_thing)
local pos = player:get_pos() local pos = player:get_pos()
@ -348,9 +347,7 @@ local use_rod = function(itemstack, player, pointed_thing)
ent = objs[n]:get_luaentity() ent = objs[n]:get_luaentity()
if ent if ent and ent.fisher and ent.name == "ethereal:bob_entity"
and ent.fisher
and ent.name == "ethereal:bob_entity"
and player:get_player_name() == ent.fisher then and player:get_player_name() == ent.fisher then
found = false found = false
@ -364,6 +361,7 @@ local use_rod = function(itemstack, player, pointed_thing)
-- lower position to be in water -- lower position to be in water
rodpos.y = rodpos.y - 1 rodpos.y = rodpos.y - 1
-- chance between catching fish, bonuns item or junk
if r < 86 then if r < 86 then
item = find_item(fish_items, rodpos) item = find_item(fish_items, rodpos)
@ -415,9 +413,7 @@ local use_rod = function(itemstack, player, pointed_thing)
ent = objs[n]:get_luaentity() ent = objs[n]:get_luaentity()
if ent if ent and ent.fisher and ent.name == "ethereal:bob_entity"
and ent.fisher
and ent.name == "ethereal:bob_entity"
and player:get_player_name() == ent.fisher then and player:get_player_name() == ent.fisher then
found = false found = false
@ -433,7 +429,7 @@ local use_rod = function(itemstack, player, pointed_thing)
local pos = {x = playerpos.x, y = playerpos.y + 1.5, z = playerpos.z} local pos = {x = playerpos.x, y = playerpos.y + 1.5, z = playerpos.z}
minetest.sound_play("ethereal_casting_rod", minetest.sound_play("ethereal_casting_rod",
{pos = pos, gain = 1.0, max_hear_distance = 10}, true) {pos = pos, gain = 1.0, max_hear_distance = 10}, true)
-- place actual bob -- place actual bob
local obj = minetest.add_entity(pos, "ethereal:bob_entity") local obj = minetest.add_entity(pos, "ethereal:bob_entity")
@ -449,8 +445,8 @@ local use_rod = function(itemstack, player, pointed_thing)
return itemstack return itemstack
end end
-- scan area for bobs that belong to player and remove -- scan area for bobs that belong to player and remove
local remove_bob = function(player) local remove_bob = function(player)
local objs = minetest.get_objects_inside_radius(player:get_pos(), 15) local objs = minetest.get_objects_inside_radius(player:get_pos(), 15)
@ -471,20 +467,20 @@ local remove_bob = function(player)
end end
end end
-- remove bob if player signs off -- remove bob if player signs off
minetest.register_on_leaveplayer(function(player) minetest.register_on_leaveplayer(function(player)
remove_bob(player) remove_bob(player)
end) end)
-- remove bob if player dies -- remove bob if player dies
minetest.register_on_dieplayer(function(player) minetest.register_on_dieplayer(function(player)
remove_bob(player) remove_bob(player)
end) end)
-- fishing rod -- fishing rod
minetest.register_tool("ethereal:fishing_rod", { minetest.register_tool("ethereal:fishing_rod", {
description = S("Fishing Rod (USE to cast and again when the time is right)"), description = S("Fishing Rod (USE to cast and again when the time is right)"),
groups = {tool = 1}, groups = {tool = 1},
@ -511,6 +507,7 @@ minetest.register_craft({
burntime = 15 burntime = 15
}) })
-- table of fish and edibility
local fish = { local fish = {
{"Blue Fin", "bluefin", 2}, {"Blue Fin", "bluefin", 2},
@ -547,6 +544,8 @@ local fish = {
{"Stoplight Parrotfish", "parrot", 2} {"Stoplight Parrotfish", "parrot", 2}
} }
-- register above fish
for n = 1, #fish do for n = 1, #fish do
local usage local usage
@ -569,47 +568,12 @@ for n = 1, #fish do
end end
end end
-- Make Neon Tetra glow slightly -- Make Neon Tetra glow slightly
minetest.override_item("ethereal:fish_tetra", {light_source = 3}) minetest.override_item("ethereal:fish_tetra", {light_source = 3})
-- cooked fish
minetest.register_craftitem(":ethereal:fish_cooked", {
description = S("Cooked Fish"),
inventory_image = "ethereal_fish_cooked.png",
wield_image = "ethereal_fish_cooked.png",
groups = {food_fish = 1},
on_use = minetest.item_eat(5)
})
ethereal.add_eatable("ethereal:fish_cooked", 5)
minetest.register_craft({
type = "cooking",
output = "ethereal:fish_cooked",
recipe = "group:ethereal_fish",
cooktime = 8
})
-- Sashimi
minetest.register_craftitem("ethereal:sashimi", {
description = S("Sashimi"),
inventory_image = "ethereal_sashimi.png",
wield_image = "ethereal_sashimi.png",
on_use = minetest.item_eat(4)
})
ethereal.add_eatable("ethereal:sashimi", 4)
minetest.register_craft({
output = "ethereal:sashimi 2",
recipe = {
{"group:food_seaweed", "group:food_fish_raw", "group:food_seaweed"},
}
})
-- Worm -- Worm
minetest.register_craftitem("ethereal:worm", { minetest.register_craftitem("ethereal:worm", {
description = S("Worm"), description = S("Worm"),
inventory_image = "ethereal_worm.png", inventory_image = "ethereal_worm.png",
@ -624,6 +588,7 @@ minetest.register_craft({
}) })
-- compatibility -- compatibility
minetest.register_alias("ethereal:fish_raw", "ethereal:fish_cichlid") minetest.register_alias("ethereal:fish_raw", "ethereal:fish_cichlid")
minetest.register_alias("ethereal:fishing_rod_baited", "ethereal:fishing_rod") minetest.register_alias("ethereal:fishing_rod_baited", "ethereal:fishing_rod")
minetest.register_alias("ethereal:fish_chichlid", "ethereal:fish_cichlid") minetest.register_alias("ethereal:fish_chichlid", "ethereal:fish_cichlid")

View File

@ -1,24 +1,28 @@
-- translation and settings
local S = minetest.get_translator("ethereal")
local flight_secs = minetest.settings:get("ethereal.flightpotion_duration") or (5 * 60) local flight_secs = minetest.settings:get("ethereal.flightpotion_duration") or (5 * 60)
local timer_check = 5 -- seconds per check local timer_check = 5 -- seconds per check
local S = ethereal.translate
-- get player timer
local function get_timer(user) local function get_timer(user)
if not user then return end if not user then return end
local meta = user:get_meta() local meta = user:get_meta() ; if not meta then return "" end
if not meta then return "" end
return meta:get_string("ethereal:fly_timer") or "" return meta:get_string("ethereal:fly_timer") or ""
end end
-- do we have fly privs
local function has_fly(name) local function has_fly(name)
return minetest.get_player_privs(name).fly return minetest.get_player_privs(name).fly
end end
-- set player timer
local function set_timer(user, timer) local function set_timer(user, timer)
@ -27,6 +31,7 @@ local function set_timer(user, timer)
meta:set_string("ethereal:fly_timer", timer) meta:set_string("ethereal:fly_timer", timer)
end end
-- give or revoke fly priv
local function set_flight(user, set) local function set_flight(user, set)
@ -38,13 +43,11 @@ local function set_flight(user, set)
minetest.set_player_privs(name, privs) minetest.set_player_privs(name, privs)
-- when flight removed set timer to temp position -- when flight removed set timer to temp position
if set ~= true then if set ~= true then set_timer(user, "-99") end
set_timer(user, "-99")
end
end end
-- after function -- after function
local function ethereal_set_flight(user) local function ethereal_set_flight(user)
local name = user and user:get_player_name() ; if not name then return end local name = user and user:get_player_name() ; if not name then return end
@ -62,9 +65,7 @@ local function ethereal_set_flight(user)
local privs = minetest.get_player_privs(name) local privs = minetest.get_player_privs(name)
-- have we already applied 'fly' privelage? -- have we already applied 'fly' privelage?
if not privs.fly then if not privs.fly then set_flight(user, true) end
set_flight(user, true)
end
-- handle timer -- handle timer
timer = timer - timer_check timer = timer - timer_check
@ -72,16 +73,14 @@ local function ethereal_set_flight(user)
-- show expiration message and play sound -- show expiration message and play sound
if timer <= 10 then if timer <= 10 then
minetest.chat_send_player(name, minetest.chat_send_player(name, minetest.get_color_escape_sequence("#ff5500")
minetest.get_color_escape_sequence("#ff5500")
.. S("Flight timer about to expire!")) .. S("Flight timer about to expire!"))
minetest.sound_play("default_dig_dig_immediate", minetest.sound_play("default_dig_dig_immediate",
{to_player = name, gain = 1.0}, true) {to_player = name, gain = 1.0}, true)
end end
-- set updated timer set_timer(user, timer) -- set update timer
set_timer(user, timer)
-- restart checks -- restart checks
minetest.after(timer_check, function() minetest.after(timer_check, function()
@ -89,8 +88,8 @@ local function ethereal_set_flight(user)
end) end)
end end
-- on join / leave -- on join / leave
minetest.register_on_joinplayer(function(player) minetest.register_on_joinplayer(function(player)
-- wait 2 seconds before doing flight checks on player -- wait 2 seconds before doing flight checks on player
@ -111,9 +110,7 @@ minetest.register_on_joinplayer(function(player)
timer = tonumber(timer) or 0 timer = tonumber(timer) or 0
-- if timer is set to default then return -- if timer is set to default then return
if timer == -99 then if timer == -99 then return end
return
end
-- if we got this far and player is flying then start countdown check -- if we got this far and player is flying then start countdown check
if has_fly(name) then if has_fly(name) then
@ -126,8 +123,8 @@ minetest.register_on_joinplayer(function(player)
end, player) end, player)
end) end)
-- potion item -- potion item
minetest.register_node("ethereal:flight_potion", { minetest.register_node("ethereal:flight_potion", {
description = S("Flight Potion"), description = S("Flight Potion"),
drawtype = "plantlike", drawtype = "plantlike",
@ -138,19 +135,16 @@ minetest.register_node("ethereal:flight_potion", {
sunlight_propagates = true, sunlight_propagates = true,
walkable = false, walkable = false,
selection_box = { selection_box = {
type = "fixed", type = "fixed", fixed = {-0.2, -0.37, -0.2, 0.2, 0.31, 0.2}
fixed = {-0.2, -0.37, -0.2, 0.2, 0.31, 0.2}
}, },
groups = {dig_immediate = 3}, groups = {dig_immediate = 3},
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
on_use = function(itemstack, user, pointed_thing) on_use = function(itemstack, user, pointed_thing)
if user.is_fake_player then if user.is_fake_player then return end
return
end
-- get privs -- get info
local name = user:get_player_name() local name = user:get_player_name()
local privs = minetest.get_player_privs(name) local privs = minetest.get_player_privs(name)
local timer = get_timer(user) local timer = get_timer(user)
@ -159,30 +153,24 @@ minetest.register_node("ethereal:flight_potion", {
local msg = timer local msg = timer
if timer == "" or timer == "-99" then if timer == "" or timer == "-99" then msg = S("unlimited") end
msg = S("unlimited")
end
minetest.chat_send_player(name, minetest.chat_send_player(name, minetest.get_color_escape_sequence("#ffff00")
minetest.get_color_escape_sequence("#ffff00") .. S("Flight already granted, @1 seconds left!", msg))
.. S("Flight already granted, @1 seconds left!", msg))
return return
end end
-- set flight timer set_timer(user, flight_secs) -- set flight timer
set_timer(user, flight_secs)
-- show time remaining -- show time remaining
minetest.chat_send_player(name, minetest.chat_send_player(name,
minetest.get_color_escape_sequence("#1eff00") minetest.get_color_escape_sequence("#1eff00")
.. S("Flight granted, you have @1 seconds!", flight_secs)) .. S("Flight granted, you have @1 seconds!", flight_secs))
-- start check ethereal_set_flight(user) -- start check
ethereal_set_flight(user)
-- take item itemstack:take_item() -- take item
itemstack:take_item()
-- return empty bottle -- return empty bottle
local inv = user:get_inventory() local inv = user:get_inventory()
@ -197,8 +185,8 @@ minetest.register_node("ethereal:flight_potion", {
end end
}) })
-- recipe -- recipe
minetest.register_craft({ minetest.register_craft({
output = "ethereal:flight_potion", output = "ethereal:flight_potion",
recipe = { recipe = {

160
food.lua
View File

@ -1,8 +1,8 @@
local S = ethereal.translate local S = minetest.get_translator("ethereal")
-- Banana
-- Banana (Heals one heart when eaten)
minetest.register_node("ethereal:banana", { minetest.register_node("ethereal:banana", {
description = S("Banana"), description = S("Banana"),
drawtype = "torchlike", drawtype = "torchlike",
@ -13,8 +13,7 @@ minetest.register_node("ethereal:banana", {
sunlight_propagates = true, sunlight_propagates = true,
walkable = false, walkable = false,
selection_box = { selection_box = {
type = "fixed", type = "fixed", fixed = {-0.31, -0.5, -0.31, 0.31, 0.5, 0.31}
fixed = {-0.31, -0.5, -0.31, 0.31, 0.5, 0.31}
}, },
groups = { groups = {
food_banana = 1, fleshy = 3, dig_immediate = 3, leafdecay = 1, leafdecay_drop = 1 food_banana = 1, fleshy = 3, dig_immediate = 3, leafdecay = 1, leafdecay_drop = 1
@ -31,6 +30,7 @@ minetest.register_node("ethereal:banana", {
ethereal.add_eatable("ethereal:banana", 2) ethereal.add_eatable("ethereal:banana", 2)
-- Banana Bunch -- Banana Bunch
minetest.register_node("ethereal:banana_bunch", { minetest.register_node("ethereal:banana_bunch", {
description = S("Banana Bunch"), description = S("Banana Bunch"),
drawtype = "torchlike", drawtype = "torchlike",
@ -41,8 +41,7 @@ minetest.register_node("ethereal:banana_bunch", {
sunlight_propagates = true, sunlight_propagates = true,
walkable = false, walkable = false,
selection_box = { selection_box = {
type = "fixed", type = "fixed", fixed = {-0.31, -0.5, -0.31, 0.31, 0.5, 0.31}
fixed = {-0.31, -0.5, -0.31, 0.31, 0.5, 0.31}
}, },
groups = { groups = {
fleshy = 3, dig_immediate = 3, leafdecay = 1, leafdecay_drop = 1 fleshy = 3, dig_immediate = 3, leafdecay = 1, leafdecay_drop = 1
@ -58,7 +57,6 @@ minetest.register_node("ethereal:banana_bunch", {
ethereal.add_eatable("ethereal:banana_bunch", 6) ethereal.add_eatable("ethereal:banana_bunch", 6)
-- Bunch to Single
minetest.register_craft({ minetest.register_craft({
output = "ethereal:banana 3", output = "ethereal:banana 3",
recipe = {{"ethereal:banana_bunch"}} recipe = {{"ethereal:banana_bunch"}}
@ -70,6 +68,7 @@ minetest.register_craft({
}) })
-- Banana Dough -- Banana Dough
minetest.register_craftitem("ethereal:banana_dough", { minetest.register_craftitem("ethereal:banana_dough", {
description = S("Banana Dough"), description = S("Banana Dough"),
inventory_image = "ethereal_banana_dough.png" inventory_image = "ethereal_banana_dough.png"
@ -87,8 +86,8 @@ minetest.register_craft({
recipe = "ethereal:banana_dough" recipe = "ethereal:banana_dough"
}) })
-- Orange
-- Orange (Heals 2 hearts when eaten)
minetest.register_node("ethereal:orange", { minetest.register_node("ethereal:orange", {
description = S("Orange"), description = S("Orange"),
drawtype = "plantlike", drawtype = "plantlike",
@ -99,8 +98,7 @@ minetest.register_node("ethereal:orange", {
sunlight_propagates = true, sunlight_propagates = true,
walkable = false, walkable = false,
selection_box = { selection_box = {
type = "fixed", type = "fixed", fixed = {-0.27, -0.37, -0.27, 0.27, 0.44, 0.27}
fixed = {-0.27, -0.37, -0.27, 0.27, 0.44, 0.27}
}, },
groups = { groups = {
food_orange = 1, fleshy = 3, dig_immediate = 3, food_orange = 1, fleshy = 3, dig_immediate = 3,
@ -117,8 +115,8 @@ minetest.register_node("ethereal:orange", {
ethereal.add_eatable("ethereal:orange", 4) ethereal.add_eatable("ethereal:orange", 4)
-- Pine Nuts
-- Pine Nuts (Heals 1/2 heart when eaten)
minetest.register_craftitem("ethereal:pine_nuts", { minetest.register_craftitem("ethereal:pine_nuts", {
description = S("Pine Nuts"), description = S("Pine Nuts"),
inventory_image = "ethereal_pine_nuts.png", inventory_image = "ethereal_pine_nuts.png",
@ -129,7 +127,8 @@ minetest.register_craftitem("ethereal:pine_nuts", {
ethereal.add_eatable("ethereal:pine_nuts", 1) ethereal.add_eatable("ethereal:pine_nuts", 1)
-- Banana Loaf (Heals 3 hearts when eaten) -- Banana Loaf
minetest.register_craftitem("ethereal:banana_bread", { minetest.register_craftitem("ethereal:banana_bread", {
description = S("Banana Loaf"), description = S("Banana Loaf"),
inventory_image = "ethereal_banana_bread.png", inventory_image = "ethereal_banana_bread.png",
@ -141,6 +140,7 @@ minetest.register_craftitem("ethereal:banana_bread", {
ethereal.add_eatable("ethereal:banana_bread", 6) ethereal.add_eatable("ethereal:banana_bread", 6)
-- coconut settings if farming redo found -- coconut settings if farming redo found
local fredo = minetest.get_modpath("farming") and farming and farming.mod local fredo = minetest.get_modpath("farming") and farming and farming.mod
and farming.mod == "redo" and farming.mod == "redo"
@ -148,6 +148,7 @@ local cdrp = fredo and "ethereal:coconut" or "ethereal:coconut_slice 4"
local cgrp = fredo and {3, 2} or {1, 1} local cgrp = fredo and {3, 2} or {1, 1}
-- Coconut (drops 4x coconut slice by default, whole coconut if farming redo found) -- Coconut (drops 4x coconut slice by default, whole coconut if farming redo found)
minetest.register_node("ethereal:coconut", { minetest.register_node("ethereal:coconut", {
description = S("Coconut"), description = S("Coconut"),
drawtype = "plantlike", drawtype = "plantlike",
@ -158,8 +159,7 @@ minetest.register_node("ethereal:coconut", {
inventory_image = "moretrees_coconut.png", inventory_image = "moretrees_coconut.png",
wield_image = "moretrees_coconut.png", wield_image = "moretrees_coconut.png",
selection_box = { selection_box = {
type = "fixed", type = "fixed", fixed = {-0.31, -0.43, -0.31, 0.31, 0.44, 0.31}
fixed = {-0.31, -0.43, -0.31, 0.31, 0.44, 0.31}
}, },
groups = { groups = {
food_coconut = 1, snappy = cgrp[1], oddly_breakable_by_hand = cgrp[2], food_coconut = 1, snappy = cgrp[1], oddly_breakable_by_hand = cgrp[2],
@ -174,7 +174,8 @@ minetest.register_node("ethereal:coconut", {
end end
}) })
-- Coconut Slice (Heals half heart when eaten) -- Coconut Slice
minetest.register_craftitem("ethereal:coconut_slice", { minetest.register_craftitem("ethereal:coconut_slice", {
description = S("Coconut Slice"), description = S("Coconut Slice"),
inventory_image = "moretrees_coconut_slice.png", inventory_image = "moretrees_coconut_slice.png",
@ -186,6 +187,7 @@ minetest.register_craftitem("ethereal:coconut_slice", {
ethereal.add_eatable("ethereal:coconut_slice", 1) ethereal.add_eatable("ethereal:coconut_slice", 1)
-- coconut slice recipe (farming redo) -- coconut slice recipe (farming redo)
if fredo then if fredo then
minetest.register_craft({ minetest.register_craft({
@ -196,6 +198,7 @@ if fredo then
end end
-- coconut slice into whole coconut -- coconut slice into whole coconut
minetest.register_craft({ minetest.register_craft({
output = "ethereal:coconut", output = "ethereal:coconut",
recipe = { recipe = {
@ -204,8 +207,8 @@ minetest.register_craft({
} }
}) })
-- Golden Apple
-- Golden Apple (Found on Healing Tree, heals all 10 hearts)
minetest.register_node("ethereal:golden_apple", { minetest.register_node("ethereal:golden_apple", {
description = S("Golden Apple"), description = S("Golden Apple"),
drawtype = "plantlike", drawtype = "plantlike",
@ -216,8 +219,7 @@ minetest.register_node("ethereal:golden_apple", {
sunlight_propagates = true, sunlight_propagates = true,
walkable = false, walkable = false,
selection_box = { selection_box = {
type = "fixed", type = "fixed", fixed = {-0.2, -0.37, -0.2, 0.2, 0.31, 0.2}
fixed = {-0.2, -0.37, -0.2, 0.2, 0.31, 0.2}
}, },
groups = { groups = {
fleshy = 3, dig_immediate = 3, leafdecay = 3,leafdecay_drop = 1, eatable = 2 fleshy = 3, dig_immediate = 3, leafdecay = 3,leafdecay_drop = 1, eatable = 2
@ -240,8 +242,8 @@ minetest.register_node("ethereal:golden_apple", {
end end
}) })
-- Hearty Stew
-- Hearty Stew (Heals 5 hearts)
minetest.register_craftitem("ethereal:hearty_stew", { minetest.register_craftitem("ethereal:hearty_stew", {
description = S("Hearty Stew"), description = S("Hearty Stew"),
inventory_image = "ethereal_hearty_stew.png", inventory_image = "ethereal_hearty_stew.png",
@ -261,6 +263,7 @@ minetest.register_craft({
}) })
-- Extra recipe for hearty stew -- Extra recipe for hearty stew
if fredo then if fredo then
minetest.register_craft({ minetest.register_craft({
@ -273,8 +276,8 @@ if fredo then
}) })
end end
-- Bucket of Cactus Pulp -- Bucket of Cactus Pulp
minetest.register_craftitem("ethereal:bucket_cactus", { minetest.register_craftitem("ethereal:bucket_cactus", {
description = S("Bucket of Cactus Pulp"), description = S("Bucket of Cactus Pulp"),
inventory_image = "bucket_cactus.png", inventory_image = "bucket_cactus.png",
@ -291,8 +294,8 @@ minetest.register_craft({
recipe = {{"bucket:bucket_empty","default:cactus"}} recipe = {{"bucket:bucket_empty","default:cactus"}}
}) })
-- firethorn jelly -- firethorn jelly
minetest.register_craftitem("ethereal:firethorn_jelly", { minetest.register_craftitem("ethereal:firethorn_jelly", {
description = S("Firethorn Jelly"), description = S("Firethorn Jelly"),
inventory_image = "ethereal_firethorn_jelly.png", inventory_image = "ethereal_firethorn_jelly.png",
@ -303,7 +306,7 @@ minetest.register_craftitem("ethereal:firethorn_jelly", {
ethereal.add_eatable("ethereal:firethorn_jelly", 2) ethereal.add_eatable("ethereal:firethorn_jelly", 2)
if minetest.registered_items["farming:bowl"] then if fredo then
minetest.register_craft({ minetest.register_craft({
output = "ethereal:firethorn_jelly", output = "ethereal:firethorn_jelly",
@ -319,8 +322,8 @@ if minetest.registered_items["farming:bowl"] then
}) })
end end
-- Lemon -- Lemon
minetest.register_node("ethereal:lemon", { minetest.register_node("ethereal:lemon", {
description = S("Lemon"), description = S("Lemon"),
drawtype = "plantlike", drawtype = "plantlike",
@ -331,12 +334,10 @@ minetest.register_node("ethereal:lemon", {
sunlight_propagates = true, sunlight_propagates = true,
walkable = false, walkable = false,
selection_box = { selection_box = {
type = "fixed", type = "fixed", fixed = {-0.27, -0.37, -0.27, 0.27, 0.44, 0.27}
fixed = {-0.27, -0.37, -0.27, 0.27, 0.44, 0.27}
}, },
groups = { groups = {
food_lemon = 1, fleshy = 3, dig_immediate = 3, food_lemon = 1, fleshy = 3, dig_immediate = 3, leafdecay = 3, leafdecay_drop = 1
leafdecay = 3, leafdecay_drop = 1
}, },
drop = "ethereal:lemon", drop = "ethereal:lemon",
on_use = minetest.item_eat(3), on_use = minetest.item_eat(3),
@ -350,6 +351,7 @@ minetest.register_node("ethereal:lemon", {
ethereal.add_eatable("ethereal:lemon", 3) ethereal.add_eatable("ethereal:lemon", 3)
-- Candied Lemon -- Candied Lemon
minetest.register_craftitem("ethereal:candied_lemon", { minetest.register_craftitem("ethereal:candied_lemon", {
description = S("Candied Lemon"), description = S("Candied Lemon"),
inventory_image = "ethereal_candied_lemon.png", inventory_image = "ethereal_candied_lemon.png",
@ -371,6 +373,7 @@ minetest.register_craft({
}) })
-- Lemonade -- Lemonade
minetest.register_node("ethereal:lemonade", { minetest.register_node("ethereal:lemonade", {
description = S("Lemonade"), description = S("Lemonade"),
drawtype = "plantlike", drawtype = "plantlike",
@ -380,8 +383,7 @@ minetest.register_node("ethereal:lemonade", {
paramtype = "light", paramtype = "light",
walkable = false, walkable = false,
selection_box = { selection_box = {
type = "fixed", type = "fixed", fixed = {-0.25, -0.5, -0.25, 0.25, 0.25, 0.25}
fixed = {-0.25, -0.5, -0.25, 0.25, 0.25, 0.25}
}, },
groups = {vessel = 1, dig_immediate = 3, attached_node = 1, drink = 1}, groups = {vessel = 1, dig_immediate = 3, attached_node = 1, drink = 1},
on_use = minetest.item_eat(5, "vessels:drinking_glass"), on_use = minetest.item_eat(5, "vessels:drinking_glass"),
@ -401,8 +403,8 @@ minetest.register_craft({
} }
}) })
-- Olive -- Olive
minetest.register_node("ethereal:olive", { minetest.register_node("ethereal:olive", {
description = S("Olive"), description = S("Olive"),
drawtype = "plantlike", drawtype = "plantlike",
@ -414,13 +416,9 @@ minetest.register_node("ethereal:olive", {
sunlight_propagates = true, sunlight_propagates = true,
walkable = false, walkable = false,
selection_box = { selection_box = {
type = "fixed", type = "fixed", fixed = {-0.1, -0.5, -0.1, 0.1, -0.3, 0.1}
fixed = {-0.1, -0.5, -0.1, 0.1, -0.3, 0.1}
}, },
groups = { groups = {fleshy = 3, dig_immediate = 3, leafdecay = 3, leafdecay_drop = 1},
fleshy = 3, dig_immediate = 3, leafdecay = 3, leafdecay_drop = 1
},
drop = "ethereal:olive",
on_use = minetest.item_eat(1), on_use = minetest.item_eat(1),
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
@ -432,6 +430,7 @@ minetest.register_node("ethereal:olive", {
ethereal.add_eatable("ethereal:olive", 1) ethereal.add_eatable("ethereal:olive", 1)
-- Olive Oil -- Olive Oil
minetest.register_craftitem("ethereal:olive_oil", { minetest.register_craftitem("ethereal:olive_oil", {
description = S("Olive Oil"), description = S("Olive Oil"),
inventory_image = "ethereal_olive_oil.png", inventory_image = "ethereal_olive_oil.png",
@ -446,13 +445,11 @@ minetest.register_craft({
{"ethereal:olive", "ethereal:olive", "ethereal:olive"}, {"ethereal:olive", "ethereal:olive", "ethereal:olive"},
{"farming:juicer", "vessels:glass_bottle", ""} {"farming:juicer", "vessels:glass_bottle", ""}
}, },
replacements = { replacements = {{"farming:juicer", "farming:juicer"}}
{"farming:juicer", "farming:juicer"}
}
}) })
-- Kappa Maki (sushi with cucumber) -- Kappa Maki (sushi with cucumber)
minetest.register_craftitem("ethereal:sushi_kappamaki", { minetest.register_craftitem("ethereal:sushi_kappamaki", {
description = S("Kappa Maki Sushi"), description = S("Kappa Maki Sushi"),
inventory_image = "ethereal_sushi_kappa_maki.png", inventory_image = "ethereal_sushi_kappa_maki.png",
@ -468,8 +465,8 @@ minetest.register_craft({
} }
}) })
-- Nigiri (sushi with raw fish) -- Nigiri (sushi with raw fish)
minetest.register_craftitem("ethereal:sushi_nigiri", { minetest.register_craftitem("ethereal:sushi_nigiri", {
description = S("Nigiri Sushi"), description = S("Nigiri Sushi"),
inventory_image = "ethereal_sushi_nigiri.png", inventory_image = "ethereal_sushi_nigiri.png",
@ -485,8 +482,8 @@ minetest.register_craft({
} }
}) })
-- Tamago (sushi with sweet egg) -- Tamago (sushi with sweet egg)
minetest.register_craftitem("ethereal:sushi_tamago", { minetest.register_craftitem("ethereal:sushi_tamago", {
description = S("Tamago Sushi"), description = S("Tamago Sushi"),
inventory_image = "ethereal_sushi_tamago.png", inventory_image = "ethereal_sushi_tamago.png",
@ -502,8 +499,8 @@ minetest.register_craft({
} }
}) })
-- Fugu (prepared pufferfish) -- Fugu (prepared pufferfish)
minetest.register_craftitem("ethereal:fugu", { minetest.register_craftitem("ethereal:fugu", {
description = S("Fugusashi"), description = S("Fugusashi"),
inventory_image = "ethereal_fugu.png", inventory_image = "ethereal_fugu.png",
@ -534,8 +531,8 @@ minetest.register_craft({
} }
}) })
-- Teriyaki Chicken -- Teriyaki Chicken
minetest.register_craftitem("ethereal:teriyaki_chicken", { minetest.register_craftitem("ethereal:teriyaki_chicken", {
description = S("Teriyaki Chicken"), description = S("Teriyaki Chicken"),
inventory_image = "ethereal_teriyaki_chicken.png", inventory_image = "ethereal_teriyaki_chicken.png",
@ -556,8 +553,8 @@ minetest.register_craft({
} }
}) })
-- Teriyaki Beef -- Teriyaki Beef
minetest.register_craftitem("ethereal:teriyaki_beef", { minetest.register_craftitem("ethereal:teriyaki_beef", {
description = S("Teriyaki Beef"), description = S("Teriyaki Beef"),
inventory_image = "ethereal_teriyaki_beef.png", inventory_image = "ethereal_teriyaki_beef.png",
@ -579,8 +576,8 @@ minetest.register_craft({
} }
}) })
-- mushroom soup
-- mushroom soup (Heals 1 heart)
minetest.register_craftitem("ethereal:mushroom_soup", { minetest.register_craftitem("ethereal:mushroom_soup", {
description = S("Mushroom Soup"), description = S("Mushroom Soup"),
inventory_image = "ethereal_mushroom_soup.png", inventory_image = "ethereal_mushroom_soup.png",
@ -599,8 +596,8 @@ minetest.register_craft({
} }
}) })
-- boiled shrimp -- boiled shrimp
minetest.register_craftitem("ethereal:fish_shrimp_cooked", { minetest.register_craftitem("ethereal:fish_shrimp_cooked", {
description = S("Boiled Shrimp"), description = S("Boiled Shrimp"),
inventory_image = "ethereal_fish_shrimp_cooked.png", inventory_image = "ethereal_fish_shrimp_cooked.png",
@ -616,13 +613,11 @@ minetest.register_craft({
{"ethereal:fish_shrimp", "group:water_bucket", "ethereal:fish_shrimp"}, {"ethereal:fish_shrimp", "group:water_bucket", "ethereal:fish_shrimp"},
{"", "ethereal:fire_dust", ""} {"", "ethereal:fire_dust", ""}
}, },
replacements = { replacements = {{"group:water_bucket", "bucket:bucket_empty"}}
{"group:water_bucket", "bucket:bucket_empty"},
}
}) })
-- garlic butter shrimp -- garlic butter shrimp
minetest.register_craftitem("ethereal:garlic_shrimp", { minetest.register_craftitem("ethereal:garlic_shrimp", {
description = S("Garlic Butter Shrimp"), description = S("Garlic Butter Shrimp"),
inventory_image = "ethereal_garlic_butter_shrimp.png", inventory_image = "ethereal_garlic_butter_shrimp.png",
@ -640,8 +635,8 @@ minetest.register_craft({
replacements = {{"farming:skillet", "farming:skillet"}} replacements = {{"farming:skillet", "farming:skillet"}}
}) })
-- jellyfish salad -- jellyfish salad
minetest.register_craftitem("ethereal:jellyfish_salad", { minetest.register_craftitem("ethereal:jellyfish_salad", {
description = S("Jellyfish Salad"), description = S("Jellyfish Salad"),
inventory_image = "ethereal_jellyfish_salad.png", inventory_image = "ethereal_jellyfish_salad.png",
@ -658,8 +653,8 @@ minetest.register_craft({
replacements = {{"farming:cutting_board", "farming:cutting_board"}} replacements = {{"farming:cutting_board", "farming:cutting_board"}}
}) })
-- raw calamari -- raw calamari
minetest.register_craftitem("ethereal:calamari_raw", { minetest.register_craftitem("ethereal:calamari_raw", {
description = S("Raw Calamari"), description = S("Raw Calamari"),
inventory_image = "ethereal_calamari_raw.png", inventory_image = "ethereal_calamari_raw.png",
@ -677,6 +672,7 @@ minetest.register_craft({
}) })
-- cooked calamari -- cooked calamari
minetest.register_craftitem("ethereal:calamari_cooked", { minetest.register_craftitem("ethereal:calamari_cooked", {
description = S("Calamari"), description = S("Calamari"),
inventory_image = "ethereal_calamari_cooked.png", inventory_image = "ethereal_calamari_cooked.png",
@ -694,6 +690,7 @@ minetest.register_craft({
}) })
-- fish & chips -- fish & chips
minetest.register_craftitem("ethereal:fish_n_chips", { minetest.register_craftitem("ethereal:fish_n_chips", {
description = S("Fish & Chips"), description = S("Fish & Chips"),
inventory_image = "ethereal_fish_chips.png", inventory_image = "ethereal_fish_chips.png",
@ -707,7 +704,60 @@ minetest.register_craft({
recipe = { recipe = {
{"farming:baking_tray", "group:ethereal_fish", "group:food_potato"} {"farming:baking_tray", "group:ethereal_fish", "group:food_potato"}
}, },
replacements = { replacements = {{"farming:baking_tray", "farming:baking_tray"}}
{"farming:baking_tray", "farming:baking_tray"} })
-- cooked fish
minetest.register_craftitem(":ethereal:fish_cooked", {
description = S("Cooked Fish"),
inventory_image = "ethereal_fish_cooked.png",
wield_image = "ethereal_fish_cooked.png",
groups = {food_fish = 1},
on_use = minetest.item_eat(5)
})
ethereal.add_eatable("ethereal:fish_cooked", 5)
minetest.register_craft({
type = "cooking",
output = "ethereal:fish_cooked",
recipe = "group:ethereal_fish",
cooktime = 8
})
-- Sashimi
minetest.register_craftitem("ethereal:sashimi", {
description = S("Sashimi"),
inventory_image = "ethereal_sashimi.png",
wield_image = "ethereal_sashimi.png",
on_use = minetest.item_eat(4)
})
ethereal.add_eatable("ethereal:sashimi", 4)
minetest.register_craft({
output = "ethereal:sashimi 2",
recipe = {
{"group:food_seaweed", "group:food_fish_raw", "group:food_seaweed"},
} }
}) })
-- agar powder
minetest.register_craftitem("ethereal:agar_powder", {
description = S("Agar Powder"),
inventory_image = "ethereal_agar_powder.png",
groups = {food_gelatin = 1, flammable = 2}
})
minetest.register_craft({
output = "ethereal:agar_powder 3",
recipe = {
{"group:food_seaweed", "group:food_seaweed", "group:food_seaweed"},
{"bucket:bucket_water", "bucket:bucket_water", "default:torch"},
{"bucket:bucket_water", "bucket:bucket_water", "default:torch"}
},
replacements = {{"bucket:bucket_water", "bucket:bucket_empty 4"}}
})

View File

@ -6,9 +6,11 @@
Updated by TenPlus1 Updated by TenPlus1
]] ]]
-- global
ethereal = {version = "20240803"} ethereal = {version = "20240816"}
-- setting helper
local function setting(stype, name, default) local function setting(stype, name, default)
@ -22,14 +24,11 @@ local function setting(stype, name, default)
value = tonumber(minetest.settings:get("ethereal." .. name)) value = tonumber(minetest.settings:get("ethereal." .. name))
end end
if value == nil then if value == nil then value = default end
value = default
end
ethereal[name] = value ethereal[name] = value
end end
-- DO NOT change settings below, use the settings.conf file instead -- DO NOT change settings below, use the settings.conf file instead
setting("number", "leaftype", 0) setting("number", "leaftype", 0)
@ -76,28 +75,27 @@ setting("bool", "wood_rotate", true)
local path = minetest.get_modpath("ethereal") local path = minetest.get_modpath("ethereal")
-- Load settings.conf file if found -- Load settings.conf file if found
local input = io.open(path.."/settings.conf", "r") local input = io.open(path.."/settings.conf", "r")
if input then if input then
dofile(path .. "/settings.conf") dofile(path .. "/settings.conf") ; input:close() ; input = nil
input:close()
input = nil
end end
-- Translation support
ethereal.translate = minetest.get_translator("ethereal")
-- Falling node function -- Falling node function
ethereal.check_falling = minetest.check_for_falling or nodeupdate ethereal.check_falling = minetest.check_for_falling or nodeupdate
-- creative check -- creative check
local creative_mode_cache = minetest.settings:get_bool("creative_mode") local creative_mode_cache = minetest.settings:get_bool("creative_mode")
function ethereal.check_creative(name) function ethereal.check_creative(name)
return creative_mode_cache or minetest.check_player_privs(name, {creative = true}) return creative_mode_cache or minetest.check_player_privs(name, {creative = true})
end end
-- helper function to add {eatable} group to food items -- helper function to add {eatable} group to food items
function ethereal.add_eatable(item, hp) function ethereal.add_eatable(item, hp)
local def = minetest.registered_items[item] local def = minetest.registered_items[item]
@ -112,12 +110,16 @@ function ethereal.add_eatable(item, hp)
end end
end end
-- strawberry check and load
if minetest.get_modpath("farming") and farming.mod and farming.mod == "redo" then if minetest.get_modpath("farming") and farming.mod and farming.mod == "redo" then
-- farming redo already has strawberry included -- farming redo already has strawberry included
else else
dofile(path .. "/strawberry.lua") dofile(path .. "/strawberry.lua")
end end
-- load mod sections
dofile(path .. "/plantlife.lua") dofile(path .. "/plantlife.lua")
dofile(path .. "/onion.lua") dofile(path .. "/onion.lua")
dofile(path .. "/crystal.lua") dofile(path .. "/crystal.lua")
@ -144,16 +146,19 @@ dofile(path .. "/compatibility.lua")
dofile(path .. "/stairs.lua") dofile(path .. "/stairs.lua")
-- add flight if enabled -- add flight if enabled
if ethereal.flight then if ethereal.flight then
dofile(path .. "/flight.lua") dofile(path .. "/flight.lua")
end end
-- add lucky blocks if mod active -- add lucky blocks if mod active
if minetest.get_modpath("lucky_block") then if minetest.get_modpath("lucky_block") then
dofile(path .. "/lucky_block.lua") dofile(path .. "/lucky_block.lua")
end end
-- Set bonemeal aliases -- Set bonemeal aliases
if minetest.get_modpath("bonemeal") then if minetest.get_modpath("bonemeal") then
minetest.register_alias("ethereal:bone", "bonemeal:bone") minetest.register_alias("ethereal:bone", "bonemeal:bone")
minetest.register_alias("ethereal:bonemeal", "bonemeal:bonemeal") minetest.register_alias("ethereal:bonemeal", "bonemeal:bonemeal")
@ -162,9 +167,10 @@ else -- or return to where it came from
minetest.register_alias("ethereal:bonemeal", "default:dirt") minetest.register_alias("ethereal:bonemeal", "default:dirt")
end end
-- Xanadu specific decoration
if minetest.get_modpath("xanadu") then if minetest.get_modpath("xanadu") then
dofile(path .. "/plantpack.lua") dofile(path .. "/plantpack.lua")
end end
print ("[MOD] Ethereal loaded") print ("[MOD] Ethereal loaded")

View File

@ -1,8 +1,8 @@
local S = ethereal.translate local S = minetest.get_translator("ethereal")
-- set leaftype (0 for block, 1 for plantlike)
-- set leaftype (value inside init.lua)
local leaftype = "plantlike" local leaftype = "plantlike"
local leafscale = 1.4 local leafscale = 1.4
@ -12,6 +12,7 @@ if ethereal.leaftype ~= 0 then
end end
-- default apple tree leaves -- default apple tree leaves
minetest.override_item("default:leaves", { minetest.override_item("default:leaves", {
drawtype = leaftype, drawtype = leaftype,
visual_scale = leafscale, visual_scale = leafscale,
@ -21,12 +22,14 @@ minetest.override_item("default:leaves", {
}) })
-- ability to craft big tree sapling -- ability to craft big tree sapling
minetest.register_craft({ minetest.register_craft({
recipe = {{"default:sapling", "default:sapling", "default:sapling"}}, recipe = {{"default:sapling", "default:sapling", "default:sapling"}},
output = "ethereal:big_tree_sapling" output = "ethereal:big_tree_sapling"
}) })
-- default jungle tree leaves -- default jungle tree leaves
minetest.override_item("default:jungleleaves", { minetest.override_item("default:jungleleaves", {
drawtype = leaftype, drawtype = leaftype,
visual_scale = leafscale, visual_scale = leafscale,
@ -36,6 +39,7 @@ minetest.override_item("default:jungleleaves", {
}) })
-- default pine tree leaves -- default pine tree leaves
minetest.override_item("default:pine_needles", { minetest.override_item("default:pine_needles", {
drawtype = leaftype, drawtype = leaftype,
visual_scale = leafscale, visual_scale = leafscale,
@ -53,6 +57,7 @@ minetest.override_item("default:pine_needles", {
}) })
-- default acacia tree leaves -- default acacia tree leaves
minetest.override_item("default:acacia_leaves", { minetest.override_item("default:acacia_leaves", {
drawtype = leaftype, drawtype = leaftype,
inventory_image = "default_acacia_leaves.png", inventory_image = "default_acacia_leaves.png",
@ -62,6 +67,7 @@ minetest.override_item("default:acacia_leaves", {
}) })
-- default aspen tree leaves -- default aspen tree leaves
minetest.override_item("default:aspen_leaves", { minetest.override_item("default:aspen_leaves", {
drawtype = leaftype, drawtype = leaftype,
inventory_image = "default_aspen_leaves.png", inventory_image = "default_aspen_leaves.png",
@ -71,6 +77,7 @@ minetest.override_item("default:aspen_leaves", {
}) })
-- willow twig -- willow twig
minetest.register_node("ethereal:willow_twig", { minetest.register_node("ethereal:willow_twig", {
description = S("Willow Twig"), description = S("Willow Twig"),
drawtype = "plantlike", drawtype = "plantlike",
@ -94,6 +101,7 @@ minetest.register_node("ethereal:willow_twig", {
}) })
-- redwood leaves -- redwood leaves
minetest.register_node("ethereal:redwood_leaves", { minetest.register_node("ethereal:redwood_leaves", {
description = S("Redwood Leaves"), description = S("Redwood Leaves"),
drawtype = leaftype, drawtype = leaftype,
@ -117,6 +125,7 @@ minetest.register_node("ethereal:redwood_leaves", {
}) })
-- orange tree leaves -- orange tree leaves
minetest.register_node("ethereal:orange_leaves", { minetest.register_node("ethereal:orange_leaves", {
description = S("Orange Leaves"), description = S("Orange Leaves"),
drawtype = leaftype, drawtype = leaftype,
@ -140,6 +149,7 @@ minetest.register_node("ethereal:orange_leaves", {
}) })
-- banana tree leaves -- banana tree leaves
minetest.register_node("ethereal:bananaleaves", { minetest.register_node("ethereal:bananaleaves", {
description = S("Banana Leaves"), description = S("Banana Leaves"),
drawtype = leaftype, drawtype = leaftype,
@ -163,6 +173,7 @@ minetest.register_node("ethereal:bananaleaves", {
}) })
-- healing tree leaves -- healing tree leaves
minetest.register_node("ethereal:yellowleaves", { minetest.register_node("ethereal:yellowleaves", {
description = S("Healing Tree Leaves"), description = S("Healing Tree Leaves"),
drawtype = leaftype, drawtype = leaftype,
@ -181,7 +192,6 @@ minetest.register_node("ethereal:yellowleaves", {
{items = {"ethereal:yellowleaves"}} {items = {"ethereal:yellowleaves"}}
} }
}, },
-- one leaf heals half a heart when eaten
on_use = minetest.item_eat(1), on_use = minetest.item_eat(1),
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
after_place_node = default.after_place_leaves, after_place_node = default.after_place_leaves,
@ -189,6 +199,7 @@ minetest.register_node("ethereal:yellowleaves", {
}) })
-- palm tree leaves -- palm tree leaves
minetest.register_node("ethereal:palmleaves", { minetest.register_node("ethereal:palmleaves", {
description = S("Palm Leaves"), description = S("Palm Leaves"),
drawtype = leaftype, drawtype = leaftype,
@ -212,6 +223,7 @@ minetest.register_node("ethereal:palmleaves", {
}) })
-- birch tree leaves -- birch tree leaves
minetest.register_node("ethereal:birch_leaves", { minetest.register_node("ethereal:birch_leaves", {
description = S("Birch Leaves"), description = S("Birch Leaves"),
drawtype = leaftype, drawtype = leaftype,
@ -235,6 +247,7 @@ minetest.register_node("ethereal:birch_leaves", {
}) })
-- frost tree leaves -- frost tree leaves
minetest.register_node("ethereal:frost_leaves", { minetest.register_node("ethereal:frost_leaves", {
description = S("Frost Leaves"), description = S("Frost Leaves"),
drawtype = leaftype, drawtype = leaftype,
@ -259,6 +272,7 @@ minetest.register_node("ethereal:frost_leaves", {
}) })
-- bamboo stalk leaves -- bamboo stalk leaves
minetest.register_node("ethereal:bamboo_leaves", { minetest.register_node("ethereal:bamboo_leaves", {
description = S("Bamboo Leaves"), description = S("Bamboo Leaves"),
drawtype = leaftype, drawtype = leaftype,
@ -282,6 +296,7 @@ minetest.register_node("ethereal:bamboo_leaves", {
}) })
-- sakura leaves -- sakura leaves
minetest.register_node("ethereal:sakura_leaves", { minetest.register_node("ethereal:sakura_leaves", {
description = S("Sakura Leaves"), description = S("Sakura Leaves"),
drawtype = leaftype, drawtype = leaftype,
@ -327,6 +342,7 @@ minetest.register_node("ethereal:sakura_leaves2", {
}) })
-- lemon tree leaves -- lemon tree leaves
minetest.register_node("ethereal:lemon_leaves", { minetest.register_node("ethereal:lemon_leaves", {
description = S("Lemon Tree Leaves"), description = S("Lemon Tree Leaves"),
drawtype = leaftype, drawtype = leaftype,
@ -350,6 +366,7 @@ minetest.register_node("ethereal:lemon_leaves", {
}) })
-- olive tree leaves -- olive tree leaves
minetest.register_node("ethereal:olive_leaves", { minetest.register_node("ethereal:olive_leaves", {
description = S("Olive Tree Leaves"), description = S("Olive Tree Leaves"),
drawtype = leaftype, drawtype = leaftype,
@ -372,7 +389,8 @@ minetest.register_node("ethereal:olive_leaves", {
after_place_node = default.after_place_leaves after_place_node = default.after_place_leaves
}) })
-- mushroom tops -- red mushroom top
minetest.register_node("ethereal:mushroom", { minetest.register_node("ethereal:mushroom", {
description = S("Mushroom Cap"), description = S("Mushroom Cap"),
tiles = {"ethereal_mushroom_block.png"}, tiles = {"ethereal_mushroom_block.png"},
@ -393,7 +411,8 @@ minetest.register_craft({
burntime = 10 burntime = 10
}) })
-- brown mushroom tops -- brown mushroom top
minetest.register_node("ethereal:mushroom_brown", { minetest.register_node("ethereal:mushroom_brown", {
description = S("Brown Mushroom Cap"), description = S("Brown Mushroom Cap"),
tiles = {"ethereal_mushroom_block_brown.png"}, tiles = {"ethereal_mushroom_block_brown.png"},
@ -415,6 +434,7 @@ minetest.register_craft({
}) })
-- mushroom pore (spongelike material found inside giant shrooms) -- mushroom pore (spongelike material found inside giant shrooms)
minetest.register_node("ethereal:mushroom_pore", { minetest.register_node("ethereal:mushroom_pore", {
description = S("Mushroom Pore"), description = S("Mushroom Pore"),
tiles = {"ethereal_mushroom_pore.png"}, tiles = {"ethereal_mushroom_pore.png"},
@ -433,6 +453,7 @@ minetest.register_craft({
}) })
-- hedge block -- hedge block
minetest.register_node("ethereal:bush", { minetest.register_node("ethereal:bush", {
description = S("Bush"), description = S("Bush"),
tiles = {"ethereal_bush.png"}, tiles = {"ethereal_bush.png"},
@ -457,6 +478,7 @@ minetest.register_craft({
}) })
-- bush block #2 -- bush block #2
minetest.register_node("ethereal:bush2", { minetest.register_node("ethereal:bush2", {
drawtype = "allfaces_optional", drawtype = "allfaces_optional",
description = S("Bush #2"), description = S("Bush #2"),
@ -483,6 +505,7 @@ minetest.register_craft({
}) })
-- bush block #3 -- bush block #3
minetest.register_node("ethereal:bush3", { minetest.register_node("ethereal:bush3", {
drawtype = "allfaces_optional", drawtype = "allfaces_optional",
description = S("Bush #3"), description = S("Bush #3"),
@ -509,6 +532,7 @@ minetest.register_craft({
}) })
-- basandra bush stem, leaves -- basandra bush stem, leaves
minetest.register_node("ethereal:basandra_bush_stem", { minetest.register_node("ethereal:basandra_bush_stem", {
description = S("Basandra Bush Stem"), description = S("Basandra Bush Stem"),
drawtype = "plantlike", drawtype = "plantlike",
@ -523,8 +547,7 @@ minetest.register_node("ethereal:basandra_bush_stem", {
groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
selection_box = { selection_box = {
type = "fixed", type = "fixed", fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.5, 7 / 16},
fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.5, 7 / 16},
} }
}) })
@ -544,86 +567,38 @@ minetest.register_node("ethereal:basandra_bush_leaves", {
sounds = default.node_sound_leaves_defaults() sounds = default.node_sound_leaves_defaults()
}) })
-- compatibility check for new mt version with leafdecay function -- leafdecay helper function
if default.register_leafdecay then
default.register_leafdecay({ local function decay(tru, lea, rad)
trunks = {"default:tree"}, default.register_leafdecay({trunks = tru, leaves = lea, radius = rad})
leaves = {
"default:apple", "default:leaves",
"ethereal:orange", "ethereal:orange_leaves",
"ethereal:lemon", "ethereal:lemon_leaves",
"ethereal:vine"
},
radius = 3
})
default.register_leafdecay({
trunks = {"ethereal:willow_trunk"},
leaves = {"ethereal:willow_twig"},
radius = 3
})
default.register_leafdecay({
trunks = {"ethereal:redwood_trunk"},
leaves = {"ethereal:redwood_leaves"},
radius = 3
})
default.register_leafdecay({
trunks = {"ethereal:frost_tree"},
leaves = {"ethereal:frost_leaves"},
radius = 3
})
default.register_leafdecay({
trunks = {"ethereal:yellow_trunk"},
leaves = {"ethereal:yellowleaves", "ethereal:golden_apple"},
radius = 3
})
default.register_leafdecay({
trunks = {"ethereal:palm_trunk"},
leaves = {"ethereal:palmleaves", "ethereal:coconut"},
radius = 3
})
default.register_leafdecay({
trunks = {"ethereal:banana_trunk"},
leaves = {"ethereal:bananaleaves", "ethereal:banana", "ethereal:banana_bunch"},
radius = 3
})
default.register_leafdecay({
trunks = {"ethereal:birch_trunk"},
leaves = {"ethereal:birch_leaves"},
radius = 3
})
default.register_leafdecay({
trunks = {"ethereal:bamboo"},
leaves = {"ethereal:bamboo_leaves"},
radius = 3
})
default.register_leafdecay({
trunks = {"ethereal:sakura_trunk"},
leaves = {"ethereal:sakura_leaves", "ethereal:sakura_leaves2"},
radius = 3
})
default.register_leafdecay({
trunks = {"ethereal:olive_trunk"},
leaves = {"ethereal:olive_leaves", "ethereal:olive"},
radius = 3
})
default.register_leafdecay({
trunks = {"ethereal:mushroom_trunk"},
leaves = {
"ethereal:mushroom", "ethereal:mushroom_brown", "ethereal:mushroom_pore",
"ethereal:lightstring"
},
radius = 4
})
end end
-- add leafdecay registrations
decay({"default:tree"}, {"default:apple", "default:leaves", "ethereal:orange",
"ethereal:orange_leaves", "ethereal:lemon", "ethereal:lemon_leaves",
"ethereal:vine"}, 3)
decay({"ethereal:willow_trunk"}, {"ethereal:willow_twig"}, 3)
decay({"ethereal:redwood_trunk"}, {"ethereal:redwood_leaves"}, 3)
decay({"ethereal:frost_tree"}, {"ethereal:frost_leaves"}, 3)
decay({"ethereal:yellow_trunk"}, {"ethereal:yellowleaves", "ethereal:golden_apple"}, 3)
decay({"ethereal:palm_trunk"}, {"ethereal:palmleaves", "ethereal:coconut"}, 3)
decay({"ethereal:banana_trunk"}, {"ethereal:bananaleaves", "ethereal:banana",
"ethereal:banana_bunch"}, 3)
decay({"ethereal:birch_trunk"}, {"ethereal:birch_leaves"}, 3)
decay({"ethereal:bamboo"}, {"ethereal:bamboo_leaves"}, 3)
decay({"ethereal:sakura_trunk"}, {"ethereal:sakura_leaves", "ethereal:sakura_leaves2"}, 3)
decay({"ethereal:olive_trunk"}, {"ethereal:olive_leaves", "ethereal:olive"}, 3)
decay({"ethereal:mushroom_trunk"}, {"ethereal:mushroom", "ethereal:mushroom_brown",
"ethereal:mushroom_pore", "ethereal:lightstring"}, 4)

View File

@ -1,6 +1,10 @@
-- ethereal schematic path
local epath = minetest.get_modpath("ethereal") .. "/schematics/" local epath = minetest.get_modpath("ethereal") .. "/schematics/"
-- add schematics
lucky_block:add_schematics({ lucky_block:add_schematics({
{"pinetree", ethereal.pinetree, {x = 3, y = 0, z = 3}}, {"pinetree", ethereal.pinetree, {x = 3, y = 0, z = 3}},
{"palmtree", ethereal.palmtree, {x = 4, y = 0, z = 4}}, {"palmtree", ethereal.palmtree, {x = 4, y = 0, z = 4}},
@ -12,6 +16,8 @@ lucky_block:add_schematics({
{"mushroomtwo", ethereal.mushroomtwo, {x = 1, y = 0, z = 1}}, {"mushroomtwo", ethereal.mushroomtwo, {x = 1, y = 0, z = 1}},
}) })
-- add lucky blocks
lucky_block:add_blocks({ lucky_block:add_blocks({
{"sch", "basandrabush", 0, false}, {"sch", "basandrabush", 0, false},
{"dro", {"ethereal:basandra_wood"}, 5}, {"dro", {"ethereal:basandra_wood"}, 5},

View File

@ -2,4 +2,4 @@ name = ethereal
description = Adds many new biomes, items and features into your world. description = Adds many new biomes, items and features into your world.
depends = default, flowers depends = default, flowers
optional_depends = stairs, doors, farming, bakedclay, moreblocks, lucky_block, toolranks optional_depends = stairs, doors, farming, bakedclay, moreblocks, lucky_block, toolranks
min_minetest_version = 5.0 min_minetest_version = 5.1

View File

@ -1,8 +1,8 @@
local S = ethereal.translate local S = minetest.get_translator("ethereal")
-- wild onion -- wild onion
minetest.register_craftitem("ethereal:wild_onion_plant", { minetest.register_craftitem("ethereal:wild_onion_plant", {
description = S("Wild Onion"), description = S("Wild Onion"),
inventory_image = "ethereal_wild_onion.png", inventory_image = "ethereal_wild_onion.png",
@ -17,7 +17,8 @@ minetest.register_craftitem("ethereal:wild_onion_plant", {
ethereal.add_eatable("ethereal:wild_onion_plant", 2) ethereal.add_eatable("ethereal:wild_onion_plant", 2)
-- Define Onion growth stages -- Onion definition
local def = { local def = {
drawtype = "plantlike", drawtype = "plantlike",
tiles = {"ethereal_wild_onion_1.png"}, tiles = {"ethereal_wild_onion_1.png"},
@ -27,8 +28,7 @@ local def = {
buildable_to = true, buildable_to = true,
drop = "", drop = "",
selection_box = { selection_box = {
type = "fixed", type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}
}, },
groups = { groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
@ -37,19 +37,22 @@ local def = {
sounds = default.node_sound_leaves_defaults() sounds = default.node_sound_leaves_defaults()
} }
--stage 1 --stage 1
minetest.register_node("ethereal:onion_1", table.copy(def)) minetest.register_node("ethereal:onion_1", table.copy(def))
--stage 2 --stage 2
def.tiles = {"ethereal_wild_onion_2.png"} def.tiles = {"ethereal_wild_onion_2.png"}
minetest.register_node("ethereal:onion_2", table.copy(def)) minetest.register_node("ethereal:onion_2", table.copy(def))
--stage 3 --stage 3
def.tiles = {"ethereal_wild_onion_3.png"} def.tiles = {"ethereal_wild_onion_3.png"}
minetest.register_node("ethereal:onion_3", table.copy(def)) minetest.register_node("ethereal:onion_3", table.copy(def))
--stage 4 --stage 4
def.tiles = {"ethereal_wild_onion_4.png"} def.tiles = {"ethereal_wild_onion_4.png"}
def.drop = { def.drop = {
items = { items = {
@ -60,11 +63,11 @@ def.drop = {
minetest.register_node("ethereal:onion_4", table.copy(def)) minetest.register_node("ethereal:onion_4", table.copy(def))
--stage 5 --stage 5
def.tiles = {"ethereal_wild_onion_5.png"} def.tiles = {"ethereal_wild_onion_5.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = { def.selection_box = {
type = "fixed", type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, -2.5/16, 0.5}
fixed = {-0.5, -0.5, -0.5, 0.5, -2.5/16, 0.5}
} }
def.drop = { def.drop = {
items = { items = {
@ -74,8 +77,8 @@ def.drop = {
} }
minetest.register_node("ethereal:onion_5", table.copy(def)) minetest.register_node("ethereal:onion_5", table.copy(def))
-- register for use with farming redo growth routines
-- register for use with farming redo growth routines if present
if farming and farming.mod and farming.mod == "redo" then if farming and farming.mod and farming.mod == "redo" then
-- add to registered_plants -- add to registered_plants
@ -86,9 +89,7 @@ if farming and farming.mod and farming.mod == "redo" then
maxlight = farming.max_light, maxlight = farming.max_light,
steps = 5 steps = 5
} }
else else
minetest.register_abm({ minetest.register_abm({
label = "Ethereal grow onion", label = "Ethereal grow onion",
nodenames = { nodenames = {
@ -112,11 +113,9 @@ else
pos.y = pos.y + 1 pos.y = pos.y + 1
-- do we have enough light? -- do we have enough light?
local light = minetest.get_node_light(pos) local light = minetest.get_node_light(pos) or 0
if not light or light < 13 then if light < 13 then return end
return
end
-- grow to next stage -- grow to next stage
local num = node.name:split("_")[2] local num = node.name:split("_")[2]
@ -127,4 +126,3 @@ else
end end
}) })
end end

View File

@ -1,7 +1,7 @@
-- Baked Clay (mesa biome is between 1 and 71) -- stratum ore helper
local add_stratum = function(y_min, y_max, node) local function add_stratum(y_min, y_max, node)
minetest.register_ore({ minetest.register_ore({
ore_type = "stratum", ore_type = "stratum",
@ -14,6 +14,8 @@ local add_stratum = function(y_min, y_max, node)
}) })
end end
-- add baked clay layers (mesa biome is between 1 and 71)
add_stratum(5, 10, "bakedclay:red") add_stratum(5, 10, "bakedclay:red")
add_stratum(15, 20, "bakedclay:grey") add_stratum(15, 20, "bakedclay:grey")
add_stratum(25, 30, "bakedclay:red") add_stratum(25, 30, "bakedclay:red")
@ -21,8 +23,9 @@ add_stratum(35, 40, "bakedclay:grey")
add_stratum(45, 50, "bakedclay:red") add_stratum(45, 50, "bakedclay:red")
add_stratum(55, 60, "bakedclay:grey") add_stratum(55, 60, "bakedclay:grey")
-- scatter ore helper
local add_ore = function(a, b, c, d, e, f, g) local function add_ore(a, b, c, d, e, f, g)
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
@ -36,32 +39,39 @@ local add_ore = function(a, b, c, d, e, f, g)
}) })
end end
-- Coal -- Coal
add_ore("default:stone_with_coal", "default:desert_stone", 24*24*24, 27, 6, -31000, -16) add_ore("default:stone_with_coal", "default:desert_stone", 24*24*24, 27, 6, -31000, -16)
-- Iron -- Iron
add_ore("default:stone_with_iron", "default:desert_stone", 9*9*9, 5, 3, -63, -16) add_ore("default:stone_with_iron", "default:desert_stone", 9*9*9, 5, 3, -63, -16)
add_ore("default:stone_with_iron", "default:desert_stone", 24*24*24, 27, 6, -31000, -64) add_ore("default:stone_with_iron", "default:desert_stone", 24*24*24, 27, 6, -31000, -64)
--Mese --Mese
add_ore("default:stone_with_mese", "default:desert_stone", 14*14*14, 5, 3, -31000, -256) add_ore("default:stone_with_mese", "default:desert_stone", 14*14*14, 5, 3, -31000, -256)
-- Gold -- Gold
add_ore("default:stone_with_gold", "default:desert_stone", 15*15*15, 3, 2, -255, -64) add_ore("default:stone_with_gold", "default:desert_stone", 15*15*15, 3, 2, -255, -64)
add_ore("default:stone_with_gold", "default:desert_stone", 13*13*13, 5, 3, -31000, -256) add_ore("default:stone_with_gold", "default:desert_stone", 13*13*13, 5, 3, -31000, -256)
-- Diamond -- Diamond
add_ore("default:stone_with_diamond", "default:desert_stone", 17*17*17, 4, 3, -255, -128) add_ore("default:stone_with_diamond", "default:desert_stone", 17*17*17, 4, 3, -255, -128)
add_ore("default:stone_with_diamond", "default:desert_stone", 15*15*15, 4, 3, -31000, -256) add_ore("default:stone_with_diamond", "default:desert_stone", 15*15*15, 4, 3, -31000, -256)
-- Copper -- Copper
add_ore("default:stone_with_copper", "default:desert_stone", 9*9*9, 5, 3, -31000, -64) add_ore("default:stone_with_copper", "default:desert_stone", 9*9*9, 5, 3, -31000, -64)
-- Coral Sand -- Coral Sand
add_ore("ethereal:sandy", "default:sand", 10*10*10, 24, 4, -100, -10) add_ore("ethereal:sandy", "default:sand", 10*10*10, 24, 4, -100, -10)
-- Etherium -- Etherium
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
ore = "ethereal:etherium_ore", ore = "ethereal:etherium_ore",
@ -75,6 +85,7 @@ minetest.register_ore({
}) })
-- Etherium in floatlands -- Etherium in floatlands
minetest.register_ore({ minetest.register_ore({
ore_type = "scatter", ore_type = "scatter",
ore = "ethereal:stone_with_etherium_ore", ore = "ethereal:stone_with_etherium_ore",

View File

@ -1,7 +1,8 @@
local S = ethereal.translate local S = minetest.get_translator("ethereal")
-- Spore Grass -- Spore Grass
minetest.register_node("ethereal:spore_grass", { minetest.register_node("ethereal:spore_grass", {
description = S("Spore Grass"), description = S("Spore Grass"),
drawtype = "plantlike", drawtype = "plantlike",
@ -16,12 +17,12 @@ minetest.register_node("ethereal:spore_grass", {
groups = {snappy = 3, flora = 1, attached_node = 1}, groups = {snappy = 3, flora = 1, attached_node = 1},
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
selection_box = { selection_box = {
type = "fixed", type = "fixed", fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 4 / 16, 5 / 16}
fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 4 / 16, 5 / 16}
} }
}) })
-- Firethorn (poisonous when eaten raw, must be crushed and washed in flowing water 1st) -- Firethorn (poisonous when eaten raw, must be crushed and washed water 1st)
minetest.register_node("ethereal:firethorn", { minetest.register_node("ethereal:firethorn", {
description = S("Firethorn Shrub"), description = S("Firethorn Shrub"),
drawtype = "plantlike", drawtype = "plantlike",
@ -36,13 +37,12 @@ minetest.register_node("ethereal:firethorn", {
groups = {snappy = 3, flora = 1, attached_node = 1}, groups = {snappy = 3, flora = 1, attached_node = 1},
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
selection_box = { selection_box = {
type = "fixed", type = "fixed", fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 4 / 16, 5 / 16}
fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 4 / 16, 5 / 16}
} }
}) })
-- Fire Flower -- Fire Flower
minetest.register_node("ethereal:fire_flower", { minetest.register_node("ethereal:fire_flower", {
description = S("Fire Flower"), description = S("Fire Flower"),
drawtype = "plantlike", drawtype = "plantlike",
@ -58,16 +58,13 @@ minetest.register_node("ethereal:fire_flower", {
groups = {snappy = 1, oddly_breakable_by_hand = 3, igniter = 2}, groups = {snappy = 1, oddly_breakable_by_hand = 3, igniter = 2},
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
selection_box = { selection_box = {
type = "fixed", type = "fixed", fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 1 / 2, 5 / 16}
fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 1 / 2, 5 / 16}
}, },
on_punch = function(pos, node, puncher) on_punch = function(pos, node, puncher) -- hurts when punched
puncher:punch(puncher, 1.0, { puncher:punch(puncher, 1.0, {
full_punch_interval = 1.0, full_punch_interval = 1.0, damage_groups = {fleshy = 2}}, nil)
damage_groups = {fleshy = 2}
}, nil)
end end
}) })
@ -77,8 +74,8 @@ minetest.register_craft({
burntime = 20 burntime = 20
}) })
-- Fire Dust -- Fire Dust
minetest.register_craftitem("ethereal:fire_dust", { minetest.register_craftitem("ethereal:fire_dust", {
description = S("Fire Dust"), description = S("Fire Dust"),
inventory_image = "ethereal_fire_dust.png" inventory_image = "ethereal_fire_dust.png"
@ -95,8 +92,8 @@ minetest.register_craft({
burntime = 10 burntime = 10
}) })
-- vines -- vines
minetest.register_node("ethereal:vine", { minetest.register_node("ethereal:vine", {
description = S("Vine"), description = S("Vine"),
drawtype = "signlike", drawtype = "signlike",
@ -108,9 +105,7 @@ minetest.register_node("ethereal:vine", {
walkable = false, walkable = false,
climbable = true, climbable = true,
is_ground_content = false, is_ground_content = false,
selection_box = { selection_box = {type = "wallmounted"},
type = "wallmounted"
},
groups = {choppy = 3, oddly_breakable_by_hand = 1, flammable = 2}, groups = {choppy = 3, oddly_breakable_by_hand = 1, flammable = 2},
legacy_wallmounted = true, legacy_wallmounted = true,
sounds = default.node_sound_leaves_defaults() sounds = default.node_sound_leaves_defaults()
@ -125,8 +120,8 @@ minetest.register_craft({
} }
}) })
-- light strings (glowing vine) -- light strings (glowing vine)
minetest.register_node("ethereal:lightstring", { minetest.register_node("ethereal:lightstring", {
description = S("Light String Vine"), description = S("Light String Vine"),
drawtype = "signlike", drawtype = "signlike",
@ -139,9 +134,7 @@ minetest.register_node("ethereal:lightstring", {
walkable = false, walkable = false,
climbable = true, climbable = true,
is_ground_content = false, is_ground_content = false,
selection_box = { selection_box = {type = "wallmounted"},
type = "wallmounted"
},
groups = {choppy = 3, oddly_breakable_by_hand = 1, flammable = 2}, groups = {choppy = 3, oddly_breakable_by_hand = 1, flammable = 2},
legacy_wallmounted = true, legacy_wallmounted = true,
sounds = default.node_sound_leaves_defaults() sounds = default.node_sound_leaves_defaults()
@ -156,8 +149,8 @@ minetest.register_craft({
} }
}) })
-- Boston Fern
-- Fern (boston)
minetest.register_node("ethereal:fern", { minetest.register_node("ethereal:fern", {
description = S("Fern"), description = S("Fern"),
drawtype = "plantlike", drawtype = "plantlike",
@ -180,12 +173,12 @@ minetest.register_node("ethereal:fern", {
groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 2}, groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 2},
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
selection_box = { selection_box = {
type = "fixed", type = "fixed", fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 0.67, 5 / 16}
fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 0.67, 5 / 16}
} }
}) })
-- Boston Ferns sometimes drop edible Tubers (heals 1/2 heart when eaten) -- Boston Ferns sometimes drop edible Tubers
minetest.register_craftitem("ethereal:fern_tubers", { minetest.register_craftitem("ethereal:fern_tubers", {
description = S("Fern Tubers"), description = S("Fern Tubers"),
inventory_image = "ethereal_fern_tubers.png", inventory_image = "ethereal_fern_tubers.png",
@ -196,6 +189,7 @@ minetest.register_craftitem("ethereal:fern_tubers", {
ethereal.add_eatable("ethereal:fern_tubers", 1) ethereal.add_eatable("ethereal:fern_tubers", 1)
-- Red Shrub (not flammable) -- Red Shrub (not flammable)
minetest.register_node("ethereal:dry_shrub", { minetest.register_node("ethereal:dry_shrub", {
description = S("Fiery Dry Shrub"), description = S("Fiery Dry Shrub"),
drawtype = "plantlike", drawtype = "plantlike",
@ -210,13 +204,12 @@ minetest.register_node("ethereal:dry_shrub", {
groups = {snappy = 3, flora = 1, attached_node = 1}, groups = {snappy = 3, flora = 1, attached_node = 1},
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
selection_box = { selection_box = {
type = "fixed", type = "fixed", fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 4 / 16, 5 / 16}
fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 4 / 16, 5 / 16}
} }
}) })
-- Grey Shrub (not Flammable - too cold to burn) -- Grey Shrub (not Flammable - too cold to burn)
minetest.register_node("ethereal:snowygrass", { minetest.register_node("ethereal:snowygrass", {
description = S("Snowy Grass"), description = S("Snowy Grass"),
drawtype = "plantlike", drawtype = "plantlike",
@ -232,13 +225,12 @@ minetest.register_node("ethereal:snowygrass", {
groups = {snappy = 3, flora = 1, attached_node = 1}, groups = {snappy = 3, flora = 1, attached_node = 1},
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
selection_box = { selection_box = {
type = "fixed", type = "fixed", fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 5 / 16, 5 / 16}
fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 5 / 16, 5 / 16}
} }
}) })
-- Crystal Shrub (not Flammable - too cold to burn) -- Crystal Shrub (not Flammable - too cold to burn)
minetest.register_node("ethereal:crystalgrass", { minetest.register_node("ethereal:crystalgrass", {
description = S("Crystal Grass"), description = S("Crystal Grass"),
drawtype = "plantlike", drawtype = "plantlike",
@ -254,13 +246,12 @@ minetest.register_node("ethereal:crystalgrass", {
groups = {snappy = 3, flora = 1, attached_node = 1}, groups = {snappy = 3, flora = 1, attached_node = 1},
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
selection_box = { selection_box = {
type = "fixed", type = "fixed", fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 5 / 16, 5 / 16}
fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 5 / 16, 5 / 16}
} }
}) })
-- tall lilac
-- lilac
minetest.register_node("ethereal:lilac", { minetest.register_node("ethereal:lilac", {
description = S("Lilac"), description = S("Lilac"),
drawtype = "plantlike", drawtype = "plantlike",
@ -276,8 +267,7 @@ minetest.register_node("ethereal:lilac", {
groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 2}, groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 2},
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
selection_box = { selection_box = {
type = "fixed", type = "fixed", fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 0.67, 5 / 16}
fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 0.67, 5 / 16}
} }
}) })
@ -286,9 +276,9 @@ minetest.register_craft({
recipe = {{"ethereal:lilac"}} recipe = {{"ethereal:lilac"}}
}) })
-- moss helper function
-- Define Moss Types (Has grass textures on all sides) local function add_moss(typ, descr, texture, receipe_item)
local add_moss = function(typ, descr, texture, receipe_item)
minetest.register_node("ethereal:" .. typ .. "_moss", { minetest.register_node("ethereal:" .. typ .. "_moss", {
description = S(descr .. " Moss"), description = S(descr .. " Moss"),
@ -304,15 +294,17 @@ local add_moss = function(typ, descr, texture, receipe_item)
}) })
end end
-- add moss types (has grass texture on all sides)
add_moss("crystal", "Crystal", "ethereal_grass_crystal_top.png", "ethereal:frost_leaves") add_moss("crystal", "Crystal", "ethereal_grass_crystal_top.png", "ethereal:frost_leaves")
add_moss("mushroom", "Mushroom", "ethereal_grass_mushroom_top.png", "ethereal:spore_grass") add_moss("mushroom", "Mushroom", "ethereal_grass_mushroom_top.png", "ethereal:spore_grass")
add_moss("fiery", "Fiery", "ethereal_grass_fiery_top.png", "ethereal:dry_shrub") add_moss("fiery", "Fiery", "ethereal_grass_fiery_top.png", "ethereal:dry_shrub")
add_moss("gray", "Gray", "ethereal_grass_gray_top.png", "ethereal:snowygrass") add_moss("gray", "Gray", "ethereal_grass_gray_top.png", "ethereal:snowygrass")
add_moss("green", "Green", "default_grass.png", "default:jungleleaves") add_moss("green", "Green", "default_grass.png", "default:jungleleaves")
-- shroom helper function
-- Illuminated Cave Shrooms (Red, Green and Blue) local function add_shroom(name, desc, ad)
local add_shroom = function(name, desc, ad)
minetest.register_node("ethereal:illumishroom" .. ad, { minetest.register_node("ethereal:illumishroom" .. ad, {
description = S(desc .. " Illumishroom"), description = S(desc .. " Illumishroom"),
@ -327,12 +319,13 @@ local add_shroom = function(name, desc, ad)
groups = {dig_immediate = 3, attached_node = 1, flammable = 3}, groups = {dig_immediate = 3, attached_node = 1, flammable = 3},
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
selection_box = { selection_box = {
type = "fixed", type = "fixed", fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.47, 6 / 16}
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.47, 6 / 16}
} }
}) })
end end
-- add illuminated cave shrooms
add_shroom("red", "Red", "") add_shroom("red", "Red", "")
add_shroom("green", "Green", "2") add_shroom("green", "Green", "2")
add_shroom("cyan", "Cyan", "3") add_shroom("cyan", "Cyan", "3")

View File

@ -1,17 +1,19 @@
local S = ethereal.translate -- translator and protection check setting
-- Sapling protection check function local S = minetest.get_translator("ethereal")
local sapling_protection_check = minetest.settings:get_bool( local sapling_protection_check = minetest.settings:get_bool(
"ethereal.sapling_protection_check", false) "ethereal.sapling_protection_check", false)
-- sapling placement helper
local function prepare_on_place(itemstack, placer, pointed_thing, name, w, h) local function prepare_on_place(itemstack, placer, pointed_thing, name, w, h)
if sapling_protection_check then if sapling_protection_check then
-- check if grown tree area intersects any players protected area -- check if grown tree area intersects any players protected area
return default.sapling_on_place(itemstack, placer, pointed_thing, return default.sapling_on_place(itemstack, placer, pointed_thing,
name, {x = -w, y = 1, z = -w}, {x = w, y = h, z = w}, 4) name, {x = -w, y = 1, z = -w}, {x = w, y = h, z = w}, 4)
end end
-- Position of sapling -- Position of sapling
@ -21,8 +23,7 @@ local function prepare_on_place(itemstack, placer, pointed_thing, name, w, h)
-- Check if node clicked on has it's own on_rightclick function -- Check if node clicked on has it's own on_rightclick function
if pdef and pdef.on_rightclick if pdef and pdef.on_rightclick
and not (placer and placer:is_player() and not (placer and placer:is_player() and placer:get_player_control().sneak) then
and placer:get_player_control().sneak) then
return pdef.on_rightclick(pos, node, placer, itemstack, pointed_thing) return pdef.on_rightclick(pos, node, placer, itemstack, pointed_thing)
end end
@ -30,8 +31,8 @@ local function prepare_on_place(itemstack, placer, pointed_thing, name, w, h)
return minetest.item_place_node(itemstack, placer, pointed_thing) return minetest.item_place_node(itemstack, placer, pointed_thing)
end end
-- Basandra Bush Sapling -- Basandra Bush Sapling
minetest.register_node("ethereal:basandra_bush_sapling", { minetest.register_node("ethereal:basandra_bush_sapling", {
description = S("Basandra Bush Sapling"), description = S("Basandra Bush Sapling"),
drawtype = "plantlike", drawtype = "plantlike",
@ -42,21 +43,21 @@ minetest.register_node("ethereal:basandra_bush_sapling", {
sunlight_propagates = true, sunlight_propagates = true,
walkable = false, walkable = false,
selection_box = { selection_box = {
type = "fixed", type = "fixed", fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 2 / 16, 4 / 16}
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 2 / 16, 4 / 16}
}, },
groups = {snappy = 2, dig_immediate = 3, attached_node = 1, ethereal_sapling = 1, groups = {snappy = 2, dig_immediate = 3, attached_node = 1, ethereal_sapling = 1,
sapling = 1}, sapling = 1},
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
grown_height = 2, grown_height = 2,
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return prepare_on_place(itemstack, placer, pointed_thing, return prepare_on_place(itemstack, placer, pointed_thing,
"ethereal:basandra_bush_sapling", 1, 2) "ethereal:basandra_bush_sapling", 1, 2)
end end
}) })
-- Bamboo Sprout -- Bamboo Sprout
minetest.register_node("ethereal:bamboo_sprout", { minetest.register_node("ethereal:bamboo_sprout", {
description = S("Bamboo Sprout"), description = S("Bamboo Sprout"),
drawtype = "plantlike", drawtype = "plantlike",
@ -72,20 +73,20 @@ minetest.register_node("ethereal:bamboo_sprout", {
}, },
sounds = default.node_sound_defaults(), sounds = default.node_sound_defaults(),
selection_box = { selection_box = {
type = "fixed", type = "fixed", fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 0, 4 / 16}
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 0, 4 / 16}
}, },
on_use = minetest.item_eat(2), on_use = minetest.item_eat(2),
grown_height = 11, grown_height = 11,
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return prepare_on_place(itemstack, placer, pointed_thing, return prepare_on_place(itemstack, placer, pointed_thing,
"ethereal:bamboo_sprout", 1, 18) "ethereal:bamboo_sprout", 1, 18)
end end
}) })
-- register Sapling helper
-- Register Saplings local function register_sapling(name, desc, texture, width, height)
local register_sapling = function(name, desc, texture, width, height)
minetest.register_node(name .. "_sapling", { minetest.register_node(name .. "_sapling", {
description = S(desc .. " Tree Sapling"), description = S(desc .. " Tree Sapling"),
@ -98,8 +99,7 @@ local register_sapling = function(name, desc, texture, width, height)
is_ground_content = false, is_ground_content = false,
walkable = false, walkable = false,
selection_box = { selection_box = {
type = "fixed", type = "fixed", fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
}, },
groups = { groups = {
snappy = 2, dig_immediate = 3, flammable = 2, snappy = 2, dig_immediate = 3, flammable = 2,
@ -107,6 +107,7 @@ local register_sapling = function(name, desc, texture, width, height)
}, },
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
grown_height = height, grown_height = height,
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return prepare_on_place(itemstack, placer, pointed_thing, return prepare_on_place(itemstack, placer, pointed_thing,
name .. "_sapling", width, height) name .. "_sapling", width, height)
@ -114,13 +115,16 @@ local register_sapling = function(name, desc, texture, width, height)
}) })
end end
-- add saplings
register_sapling("ethereal:willow", "Willow", "ethereal_willow_sapling", 5, 14) register_sapling("ethereal:willow", "Willow", "ethereal_willow_sapling", 5, 14)
register_sapling("ethereal:yellow_tree", "Healing", "ethereal_yellow_tree_sapling", 4, 19) register_sapling("ethereal:yellow_tree", "Healing", "ethereal_yellow_tree_sapling", 4, 19)
register_sapling("ethereal:big_tree", "Big", "ethereal_big_tree_sapling", 4, 7) register_sapling("ethereal:big_tree", "Big", "ethereal_big_tree_sapling", 4, 7)
register_sapling("ethereal:banana_tree", "Banana", "ethereal_banana_tree_sapling", 3, 8) register_sapling("ethereal:banana_tree", "Banana", "ethereal_banana_tree_sapling", 3, 8)
register_sapling("ethereal:frost_tree", "Frost", "ethereal_frost_tree_sapling", 4, 19) register_sapling("ethereal:frost_tree", "Frost", "ethereal_frost_tree_sapling", 4, 19)
register_sapling("ethereal:mushroom", "Mushroom", "ethereal_mushroom_sapling", 4, 11) register_sapling("ethereal:mushroom", "Mushroom", "ethereal_mushroom_sapling", 4, 11)
register_sapling("ethereal:mushroom_brown", "Brown Mushroom", "ethereal_mushroom_brown_sapling", 1, 11) register_sapling("ethereal:mushroom_brown", "Brown Mushroom",
"ethereal_mushroom_brown_sapling", 1, 11)
register_sapling("ethereal:palm", "Palm", "moretrees_palm_sapling", 4, 9) register_sapling("ethereal:palm", "Palm", "moretrees_palm_sapling", 4, 9)
register_sapling("ethereal:giant_redwood", "Giant Redwood", register_sapling("ethereal:giant_redwood", "Giant Redwood",
"ethereal_giant_redwood_sapling", 7, 33) "ethereal_giant_redwood_sapling", 7, 33)
@ -131,26 +135,23 @@ register_sapling("ethereal:sakura", "Sakura", "ethereal_sakura_sapling", 4, 10)
register_sapling("ethereal:lemon_tree", "Lemon", "ethereal_lemon_tree_sapling", 2, 7) register_sapling("ethereal:lemon_tree", "Lemon", "ethereal_lemon_tree_sapling", 2, 7)
register_sapling("ethereal:olive_tree", "Olive", "ethereal_olive_tree_sapling", 3, 10) register_sapling("ethereal:olive_tree", "Olive", "ethereal_olive_tree_sapling", 3, 10)
-- add tree schematic
local add_tree = function (pos, ofx, ofy, ofz, schem, replace) local function add_tree(pos, ofx, ofy, ofz, schem, replace)
-- check for schematic if not schem then print("Schematic not found") ; return end
if not schem then
print (S("Schematic not found"))
return
end
-- remove sapling and place schematic
minetest.swap_node(pos, {name = "air"}) minetest.swap_node(pos, {name = "air"})
minetest.place_schematic({x = pos.x - ofx, y = pos.y - ofy, z = pos.z - ofz}, minetest.place_schematic({x = pos.x - ofx, y = pos.y - ofy, z = pos.z - ofz},
schem, 0, replace, false) schem, 0, replace, false)
end end
-- get mod path and schematic folder
local path = minetest.get_modpath("ethereal") .. "/schematics/" local path = minetest.get_modpath("ethereal") .. "/schematics/"
-- grow tree functions -- global tree grow functions
function ethereal.grow_basandra_bush(pos) function ethereal.grow_basandra_bush(pos)
add_tree(pos, 1, 0, 1, ethereal.basandrabush) add_tree(pos, 1, 0, 1, ethereal.basandrabush)
@ -234,129 +235,96 @@ function ethereal.grow_olive_tree(pos)
add_tree(pos, 3, 0, 3, ethereal.olivetree) add_tree(pos, 3, 0, 3, ethereal.olivetree)
end end
-- return True if sapling has enough height room to grow
-- check if sapling has enough height room to grow local function enough_height(pos, height)
local enough_height = function(pos, height)
local nod = minetest.line_of_sight( return minetest.line_of_sight(
{x = pos.x, y = pos.y + 1, z = pos.z}, {x = pos.x, y = pos.y + 1, z = pos.z},
{x = pos.x, y = pos.y + height, z = pos.z}) {x = pos.x, y = pos.y + height, z = pos.z})
if not nod then
return false -- obstructed
else
return true -- can grow
end
end end
-- global function run by Abm
ethereal.grow_sapling = function(pos, node) function ethereal.grow_sapling(pos, node)
local light_level = minetest.get_node_light(pos) or 0 if (minetest.get_node_light(pos) or 0) < 13 then return end
if light_level < 13 then
return
end
-- get node below sapling
local under = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z}).name local under = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z}).name
local def = minetest.registered_nodes[node.name] ; if not def then return end
if not minetest.registered_nodes[node.name] then local height = def.grown_height
return
end
local height = minetest.registered_nodes[node.name].grown_height
-- do we have enough height to grow sapling into tree? -- do we have enough height to grow sapling into tree?
if not height or not enough_height(pos, height) then if not height or not enough_height(pos, height) then return end
return
end
-- Check if Ethereal Sapling is growing on correct substrate -- check if Ethereal Sapling is growing on correct substrate
if node.name == "ethereal:basandra_bush_sapling" if node.name == "ethereal:basandra_bush_sapling"
and under == "ethereal:fiery_dirt" then and under == "ethereal:fiery_dirt" then ethereal.grow_basandra_bush(pos)
ethereal.grow_basandra_bush(pos)
elseif node.name == "ethereal:yellow_tree_sapling" elseif node.name == "ethereal:yellow_tree_sapling"
and minetest.get_item_group(under, "soil") > 0 then and minetest.get_item_group(under, "soil") > 0 then ethereal.grow_yellow_tree(pos)
ethereal.grow_yellow_tree(pos)
elseif node.name == "ethereal:big_tree_sapling" elseif node.name == "ethereal:big_tree_sapling"
and under == "default:dirt_with_grass" then and under == "default:dirt_with_grass" then ethereal.grow_big_tree(pos)
ethereal.grow_big_tree(pos)
elseif node.name == "ethereal:banana_tree_sapling" elseif node.name == "ethereal:banana_tree_sapling"
and under == "ethereal:grove_dirt" then and under == "ethereal:grove_dirt" then ethereal.grow_banana_tree(pos)
ethereal.grow_banana_tree(pos)
elseif node.name == "ethereal:frost_tree_sapling" elseif node.name == "ethereal:frost_tree_sapling"
and under == "ethereal:crystal_dirt" then and under == "ethereal:crystal_dirt" then ethereal.grow_frost_tree(pos)
ethereal.grow_frost_tree(pos)
elseif node.name == "ethereal:mushroom_sapling" elseif node.name == "ethereal:mushroom_sapling"
and under == "ethereal:mushroom_dirt" then and under == "ethereal:mushroom_dirt" then ethereal.grow_mushroom_tree(pos)
ethereal.grow_mushroom_tree(pos)
elseif node.name == "ethereal:mushroom_brown_sapling" elseif node.name == "ethereal:mushroom_brown_sapling"
and under == "ethereal:mushroom_dirt" then and under == "ethereal:mushroom_dirt" then ethereal.grow_mushroom_brown_tree(pos)
ethereal.grow_mushroom_brown_tree(pos)
elseif node.name == "ethereal:palm_sapling" elseif node.name == "ethereal:palm_sapling"
and under == "default:sand" then and under == "default:sand" then ethereal.grow_palm_tree(pos)
ethereal.grow_palm_tree(pos)
elseif node.name == "ethereal:willow_sapling" elseif node.name == "ethereal:willow_sapling"
and under == "ethereal:gray_dirt" then and under == "ethereal:gray_dirt" then ethereal.grow_willow_tree(pos)
ethereal.grow_willow_tree(pos)
elseif node.name == "ethereal:redwood_sapling" elseif node.name == "ethereal:redwood_sapling"
and under == "default:dirt_with_dry_grass" then and under == "default:dirt_with_dry_grass" then ethereal.grow_redwood_tree(pos)
ethereal.grow_redwood_tree(pos)
elseif node.name == "ethereal:giant_redwood_sapling" elseif node.name == "ethereal:giant_redwood_sapling"
and under == "default:dirt_with_dry_grass" then and under == "default:dirt_with_dry_grass" then ethereal.grow_giant_redwood_tree(pos)
ethereal.grow_giant_redwood_tree(pos)
elseif node.name == "ethereal:orange_tree_sapling" elseif node.name == "ethereal:orange_tree_sapling"
and under == "ethereal:prairie_dirt" then and under == "ethereal:prairie_dirt" then ethereal.grow_orange_tree(pos)
ethereal.grow_orange_tree(pos)
elseif node.name == "ethereal:bamboo_sprout" elseif node.name == "ethereal:bamboo_sprout"
and under == "ethereal:bamboo_dirt" then and under == "ethereal:bamboo_dirt" then ethereal.grow_bamboo_tree(pos)
ethereal.grow_bamboo_tree(pos)
elseif node.name == "ethereal:birch_sapling" elseif node.name == "ethereal:birch_sapling"
and under == "default:dirt_with_grass" then and under == "default:dirt_with_grass" then ethereal.grow_birch_tree(pos)
ethereal.grow_birch_tree(pos)
elseif node.name == "ethereal:sakura_sapling" elseif node.name == "ethereal:sakura_sapling"
and under == "ethereal:bamboo_dirt" then and under == "ethereal:bamboo_dirt" then ethereal.grow_sakura_tree(pos)
ethereal.grow_sakura_tree(pos)
elseif node.name == "ethereal:olive_tree_sapling" elseif node.name == "ethereal:olive_tree_sapling"
and under == "ethereal:grove_dirt" then and under == "ethereal:grove_dirt" then ethereal.grow_olive_tree(pos)
ethereal.grow_olive_tree(pos)
elseif node.name == "ethereal:lemon_tree_sapling" elseif node.name == "ethereal:lemon_tree_sapling"
and under == "ethereal:grove_dirt" then and under == "ethereal:grove_dirt" then ethereal.grow_lemon_tree(pos) end
ethereal.grow_lemon_tree(pos)
end
end end
-- Grow saplings -- grow saplings Abm
minetest.register_abm({ minetest.register_abm({
label = "Ethereal grow sapling", label = "Ethereal grow sapling",
nodenames = {"group:ethereal_sapling"}, nodenames = {"group:ethereal_sapling"},
interval = 10, interval = 10,
chance = 50, chance = 50,
catch_up = false, catch_up = false,
action = function(pos, node) action = ethereal.grow_sapling -- (pos, node)
ethereal.grow_sapling(pos, node)
end
}) })
-- 2x redwood saplings make 1x giant redwood sapling -- 2x redwood saplings make 1x giant redwood sapling
minetest.register_craft({ minetest.register_craft({
output = "ethereal:giant_redwood_sapling", output = "ethereal:giant_redwood_sapling",
recipe = {{"ethereal:redwood_sapling", "ethereal:redwood_sapling"}} recipe = {{"ethereal:redwood_sapling", "ethereal:redwood_sapling"}}
}) })

View File

@ -1,9 +1,11 @@
-- path to default and ethereal schematics
local path = minetest.get_modpath("ethereal") .. "/schematics/" local path = minetest.get_modpath("ethereal") .. "/schematics/"
local dpath = minetest.get_modpath("default") .. "/schematics/" local dpath = minetest.get_modpath("default") .. "/schematics/"
-- load schematic tables -- load schematic tables
dofile(path .. "orange_tree.lua") dofile(path .. "orange_tree.lua")
dofile(path .. "banana_tree.lua") dofile(path .. "banana_tree.lua")
dofile(path .. "bamboo_tree.lua") dofile(path .. "bamboo_tree.lua")
@ -29,12 +31,11 @@ dofile(path .. "lemon_tree.lua")
dofile(path .. "olive_tree.lua") dofile(path .. "olive_tree.lua")
dofile(path .. "basandra_bush.lua") dofile(path .. "basandra_bush.lua")
-- add chematic helper function
-- helper function local function add_schem(a, b, c, d, e, f, g, h, i, j, k)
local add_schem = function(a, b, c, d, e, f, g, h, i, j, k)
-- if not 1 then biome disabled, don't add if g ~= 1 then return end -- add if setting is 1
if g ~= 1 then return end
minetest.register_decoration({ minetest.register_decoration({
deco_type = "schematic", deco_type = "schematic",
@ -53,125 +54,149 @@ local add_schem = function(a, b, c, d, e, f, g, h, i, j, k)
}) })
end end
-- igloo -- igloo
add_schem("default:snowblock", 0.0005, {"glacier"}, 3, 50, add_schem("default:snowblock", 0.0005, {"glacier"}, 3, 50,
ethereal.igloo, ethereal.glacier, nil, "default:snowblock", 8, "random") ethereal.igloo, ethereal.glacier, nil, "default:snowblock", 8, "random")
-- sakura tree -- sakura tree
add_schem({"ethereal:bamboo_dirt"}, 0.001, {"sakura"}, 7, 100, add_schem({"ethereal:bamboo_dirt"}, 0.001, {"sakura"}, 7, 100,
ethereal.sakura_tree, ethereal.sakura, nil, ethereal.sakura_tree, ethereal.sakura, nil,
"ethereal:bamboo_dirt", 6) "ethereal:bamboo_dirt", 6)
-- redwood tree -- redwood tree
add_schem({"default:dirt_with_dry_grass"}, 0.0025, {"mesa"}, 1, 100, add_schem({"default:dirt_with_dry_grass"}, 0.0025, {"mesa"}, 1, 100,
ethereal.redwood_tree, ethereal.mesa, nil, ethereal.redwood_tree, ethereal.mesa, nil,
"default:dirt_with_dry_grass", 8) "default:dirt_with_dry_grass", 8)
-- banana tree -- banana tree
add_schem({"ethereal:grove_dirt"}, 0.015, {"grove"}, 1, 100, add_schem({"ethereal:grove_dirt"}, 0.015, {"grove"}, 1, 100,
ethereal.bananatree, ethereal.grove) ethereal.bananatree, ethereal.grove)
-- healing tree -- healing tree
add_schem({"default:dirt_with_snow"}, 0.01, {"taiga"}, 120, 140, add_schem({"default:dirt_with_snow"}, 0.01, {"taiga"}, 120, 140,
ethereal.yellowtree, ethereal.alpine, nil, "default:dirt_with_snow", 8) ethereal.yellowtree, ethereal.alpine, nil, "default:dirt_with_snow", 8)
-- crystal frost tree -- crystal frost tree
add_schem({"ethereal:crystal_dirt"}, 0.01, {"frost", "frost_floatland"}, 1, 1750, add_schem({"ethereal:crystal_dirt"}, 0.01, {"frost", "frost_floatland"}, 1, 1750,
ethereal.frosttrees, ethereal.frost, nil, ethereal.frosttrees, ethereal.frost, nil,
"ethereal:crystal_dirt", 8) "ethereal:crystal_dirt", 8)
-- giant mushroom -- giant mushroom
add_schem("ethereal:mushroom_dirt", 0.02, {"mushroom"}, 3, 25, add_schem("ethereal:mushroom_dirt", 0.02, {"mushroom"}, 3, 25,
ethereal.mushroomone, ethereal.mushroom, nil, ethereal.mushroomone, ethereal.mushroom, nil,
"ethereal:mushroom_dirt", 8) "ethereal:mushroom_dirt", 8)
-- giant brown mushroom -- giant brown mushroom
add_schem("ethereal:mushroom_dirt", 0.02, {"mushroom"}, 26, 50, add_schem("ethereal:mushroom_dirt", 0.02, {"mushroom"}, 26, 50,
ethereal.mushroomtwo, ethereal.mushroom, nil, nil, nil, "random") ethereal.mushroomtwo, ethereal.mushroom, nil, nil, nil, "random")
-- small lava crater -- small lava crater
add_schem("ethereal:fiery_dirt", 0.01, {"fiery"}, 1, 100, add_schem("ethereal:fiery_dirt", 0.01, {"fiery"}, 1, 100,
ethereal.volcanom, ethereal.fiery, nil, "ethereal:fiery_dirt", 8) ethereal.volcanom, ethereal.fiery, nil, "ethereal:fiery_dirt", 8)
-- large lava crater -- large lava crater
add_schem("ethereal:fiery_dirt", 0.003, {"fiery"}, 1, 100, add_schem("ethereal:fiery_dirt", 0.003, {"fiery"}, 1, 100,
ethereal.volcanol, ethereal.fiery, nil, "ethereal:fiery_dirt", 8, "random") ethereal.volcanol, ethereal.fiery, nil, "ethereal:fiery_dirt", 8, "random")
-- basandra bush -- basandra bush
add_schem("ethereal:fiery_dirt", 0.03, {"fiery"}, 1, 100, add_schem("ethereal:fiery_dirt", 0.03, {"fiery"}, 1, 100,
ethereal.basandrabush, ethereal.fiery) ethereal.basandrabush, ethereal.fiery)
-- default jungle tree -- default jungle tree
add_schem({"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"}, add_schem({"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"},
0.08, {"junglee"}, 1, 100, dpath .. "jungle_tree.mts", ethereal.junglee) 0.08, {"junglee"}, 1, 100, dpath .. "jungle_tree.mts", ethereal.junglee)
-- willow tree -- willow tree
add_schem({"ethereal:gray_dirt"}, 0.02, {"grayness"}, 1, 100, add_schem({"ethereal:gray_dirt"}, 0.02, {"grayness"}, 1, 100,
ethereal.willow, ethereal.grayness, nil, ethereal.willow, ethereal.grayness, nil, "ethereal:gray_dirt", 6)
"ethereal:gray_dirt", 6)
-- default large pine tree for lower elevation -- default large pine tree for lower elevation
add_schem({"ethereal:cold_dirt", "default:dirt_with_coniferous_litter"}, add_schem({"ethereal:cold_dirt", "default:dirt_with_coniferous_litter"},
0.025, {"coniferous_forest"}, 10, 40, dpath .. "pine_tree.mts", ethereal.snowy) 0.025, {"coniferous_forest"}, 10, 40, dpath .. "pine_tree.mts", ethereal.snowy)
-- small pine for higher elevation -- small pine for higher elevation
add_schem({"default:dirt_with_snow"}, 0.025, {"taiga"}, 40, 140, add_schem({"default:dirt_with_snow"}, 0.025, {"taiga"}, 40, 140,
ethereal.pinetree, ethereal.alpine) ethereal.pinetree, ethereal.alpine)
-- default apple tree -- default apple tree
add_schem({"default:dirt_with_grass"}, 0.025, {"jumble", "deciduous_forest"}, 1, 100, add_schem({"default:dirt_with_grass"}, 0.025, {"jumble", "deciduous_forest"}, 1, 100,
dpath .. "apple_tree.mts", ethereal.grassy) dpath .. "apple_tree.mts", ethereal.grassy)
-- big old tree -- big old tree
add_schem({"default:dirt_with_grass"}, 0.001, {"jumble"}, 1, 100, add_schem({"default:dirt_with_grass"}, 0.001, {"jumble"}, 1, 100,
ethereal.bigtree, ethereal.jumble, nil, ethereal.bigtree, ethereal.jumble, nil, "default:dirt_with_grass", 8)
"default:dirt_with_grass", 8)
-- default aspen tree -- default aspen tree
add_schem({"default:dirt_with_grass"}, 0.02, {"grassytwo"}, 1, 50, add_schem({"default:dirt_with_grass"}, 0.02, {"grassytwo"}, 1, 50,
dpath .. "aspen_tree.mts", ethereal.jumble) dpath .. "aspen_tree.mts", ethereal.jumble)
-- birch tree -- birch tree
add_schem({"default:dirt_with_grass"}, 0.02, {"grassytwo"}, 50, 100, add_schem({"default:dirt_with_grass"}, 0.02, {"grassytwo"}, 50, 100,
ethereal.birchtree, ethereal.grassytwo) ethereal.birchtree, ethereal.grassytwo)
-- orange tree -- orange tree
add_schem({"ethereal:prairie_dirt"}, 0.01, {"prairie"}, 1, 100, add_schem({"ethereal:prairie_dirt"}, 0.01, {"prairie"}, 1, 100,
ethereal.orangetree, ethereal.prairie) ethereal.orangetree, ethereal.prairie)
-- default acacia tree -- default acacia tree
add_schem({"default:dry_dirt_with_dry_grass", add_schem({"default:dry_dirt_with_dry_grass",
"default:dirt_with_dry_grass"}, 0.004, {"savanna"}, 1, 100, "default:dirt_with_dry_grass"}, 0.004, {"savanna"}, 1, 100,
dpath .. "acacia_tree.mts", ethereal.savanna) dpath .. "acacia_tree.mts", ethereal.savanna)
-- palm tree -- palm tree
add_schem("default:sand", 0.0025, {"desert_ocean", "plains_ocean", "sandclay", add_schem("default:sand", 0.0025, {"desert_ocean", "plains_ocean", "sandclay",
"sandstone_ocean", "mesa_ocean", "grove_ocean", "deciduous_forest_ocean"}, 1, 1, "sandstone_ocean", "mesa_ocean", "grove_ocean", "deciduous_forest_ocean"}, 1, 1,
ethereal.palmtree, 1) ethereal.palmtree, 1)
-- bamboo tree -- bamboo tree
add_schem({"ethereal:bamboo_dirt"}, 0.025, {"bamboo"}, 1, 100, add_schem({"ethereal:bamboo_dirt"}, 0.025, {"bamboo"}, 1, 100,
ethereal.bambootree, ethereal.bamboo) ethereal.bambootree, ethereal.bamboo)
-- bush -- bush
add_schem({"ethereal:bamboo_dirt"}, 0.08, {"bamboo"}, 1, 100, ethereal.bush, add_schem({"ethereal:bamboo_dirt"}, 0.08, {"bamboo"}, 1, 100, ethereal.bush,
ethereal.bamboo) ethereal.bamboo)
-- vine tree -- vine tree
add_schem({"default:dirt_with_grass"}, 0.02, {"swamp"}, 1, 100, add_schem({"default:dirt_with_grass"}, 0.02, {"swamp"}, 1, 100,
ethereal.vinetree, ethereal.swamp) ethereal.vinetree, ethereal.swamp)
-- lemon tree -- lemon tree
add_schem({"ethereal:grove_dirt"}, 0.002, {"mediterranean"}, 5, 50, add_schem({"ethereal:grove_dirt"}, 0.002, {"mediterranean"}, 5, 50,
ethereal.lemontree, ethereal.mediterranean) ethereal.lemontree, ethereal.mediterranean)
-- olive tree -- olive tree
add_schem({"ethereal:grove_dirt"}, 0.002, {"mediterranean"}, 5, 35, add_schem({"ethereal:grove_dirt"}, 0.002, {"mediterranean"}, 5, 35,
ethereal.olivetree, ethereal.mediterranean) ethereal.olivetree, ethereal.mediterranean)
-- default large cactus -- default large cactus
if ethereal.desert == 1 then if ethereal.desert == 1 then
minetest.register_decoration({ minetest.register_decoration({
@ -195,8 +220,8 @@ if ethereal.desert == 1 then
}) })
end end
-- default bush -- default bush
minetest.register_decoration({ minetest.register_decoration({
deco_type = "schematic", deco_type = "schematic",
place_on = {"default:dirt_with_grass", "default:dirt_with_snow"}, place_on = {"default:dirt_with_grass", "default:dirt_with_snow"},
@ -216,8 +241,8 @@ minetest.register_decoration({
flags = "place_center_x, place_center_z" flags = "place_center_x, place_center_z"
}) })
-- default acacia bush -- default acacia bush
minetest.register_decoration({ minetest.register_decoration({
deco_type = "schematic", deco_type = "schematic",
place_on = { place_on = {
@ -238,8 +263,8 @@ minetest.register_decoration({
flags = "place_center_x, place_center_z" flags = "place_center_x, place_center_z"
}) })
-- default pine bush -- default pine bush
if minetest.registered_nodes["default:pine_bush"] then if minetest.registered_nodes["default:pine_bush"] then
minetest.register_decoration({ minetest.register_decoration({
@ -263,8 +288,8 @@ if minetest.registered_nodes["default:pine_bush"] then
}) })
end end
-- default blueberry bush -- default blueberry bush
if minetest.registered_nodes["default:blueberry_bush_leaves"] then if minetest.registered_nodes["default:blueberry_bush_leaves"] then
minetest.register_decoration({ minetest.register_decoration({
@ -290,8 +315,8 @@ if minetest.registered_nodes["default:blueberry_bush_leaves"] then
}) })
end end
-- place waterlily in beach areas -- place waterlily in beach areas
minetest.register_decoration({ minetest.register_decoration({
deco_type = "schematic", deco_type = "schematic",
place_on = {"default:sand"}, place_on = {"default:sand"},
@ -312,8 +337,8 @@ minetest.register_decoration({
rotation = "random" rotation = "random"
}) })
-- coral reef -- coral reef
if ethereal.reefs == 1 then if ethereal.reefs == 1 then
-- override corals so crystal shovel can pick them up intact -- override corals so crystal shovel can pick them up intact
@ -341,12 +366,13 @@ if ethereal.reefs == 1 then
}) })
end end
-- tree logs -- tree logs
if ethereal.logs == 1 then if ethereal.logs == 1 then
if ethereal.grassy == 1 or ethereal.prairie == 1 then if ethereal.grassy == 1 or ethereal.prairie == 1 then
minetest.register_decoration({
minetest.register_decoration({
name = "default:apple_log", name = "default:apple_log",
deco_type = "schematic", deco_type = "schematic",
place_on = {"default:dirt_with_grass", "ethereal:prairie_dirt"}, place_on = {"default:dirt_with_grass", "ethereal:prairie_dirt"},
@ -365,6 +391,7 @@ minetest.register_decoration({
end end
if ethereal.junglee == 1 then if ethereal.junglee == 1 then
minetest.register_decoration({ minetest.register_decoration({
name = "default:jungle_log", name = "default:jungle_log",
deco_type = "schematic", deco_type = "schematic",
@ -384,6 +411,7 @@ if ethereal.junglee == 1 then
end end
if ethereal.snowy == 1 then if ethereal.snowy == 1 then
minetest.register_decoration({ minetest.register_decoration({
name = "default:pine_log", name = "default:pine_log",
deco_type = "schematic", deco_type = "schematic",
@ -403,6 +431,7 @@ if ethereal.snowy == 1 then
end end
if ethereal.savanna == 1 then if ethereal.savanna == 1 then
minetest.register_decoration({ minetest.register_decoration({
name = "default:acacia_log", name = "default:acacia_log",
deco_type = "schematic", deco_type = "schematic",
@ -429,6 +458,7 @@ if ethereal.savanna == 1 then
end end
if ethereal.plains == 1 then if ethereal.plains == 1 then
minetest.register_decoration({ minetest.register_decoration({
name = "ethereal:scorched_log", name = "ethereal:scorched_log",
deco_type = "schematic", deco_type = "schematic",
@ -456,6 +486,7 @@ if ethereal.plains == 1 then
end end
if ethereal.grove == 1 then if ethereal.grove == 1 then
minetest.register_decoration({ minetest.register_decoration({
name = "ethereal:banana_log", name = "ethereal:banana_log",
deco_type = "schematic", deco_type = "schematic",
@ -482,5 +513,4 @@ if ethereal.grove == 1 then
}) })
end end
end end -- end if ethereal.logs

View File

@ -1,8 +1,8 @@
local S = ethereal.translate local S = minetest.get_translator("ethereal")
-- Seaweed -- Seaweed
minetest.register_node("ethereal:seaweed", { minetest.register_node("ethereal:seaweed", {
description = S("Seaweed"), description = S("Seaweed"),
drawtype = "plantlike", drawtype = "plantlike",
@ -14,8 +14,7 @@ minetest.register_node("ethereal:seaweed", {
climbable = true, climbable = true,
drowning = 1, drowning = 1,
selection_box = { selection_box = {
type = "fixed", type = "fixed", fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
}, },
post_effect_color = {a = 64, r = 100, g = 100, b = 200}, post_effect_color = {a = 64, r = 100, g = 100, b = 200},
groups = {food_seaweed = 1, snappy = 3}, groups = {food_seaweed = 1, snappy = 3},
@ -33,9 +32,7 @@ minetest.register_node("ethereal:seaweed", {
if def_up.liquidtype == nil or def_up.liquidtype ~= "none" then if def_up.liquidtype == nil or def_up.liquidtype ~= "none" then
if minetest.is_protected(pos, pname) then if minetest.is_protected(pos, pname) then return end
return
end
if def_down.name ~= "default:sand" and def_down.name ~= "ethereal:sandy" then if def_down.name ~= "default:sand" and def_down.name ~= "ethereal:sandy" then
return return
@ -60,6 +57,8 @@ minetest.register_node("ethereal:seaweed", {
ethereal.add_eatable("ethereal:seaweed", 1) ethereal.add_eatable("ethereal:seaweed", 1)
-- seaweed rooted in sand
minetest.register_node("ethereal:seaweed_rooted", { minetest.register_node("ethereal:seaweed_rooted", {
description = S("Seaweed"), description = S("Seaweed"),
drop = "ethereal:seaweed", drop = "ethereal:seaweed",
@ -74,8 +73,7 @@ minetest.register_node("ethereal:seaweed_rooted", {
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, {-2/16, 0.5, -2/16, 2/16, 3.5, 2/16},
{-2/16, 0.5, -2/16, 2/16, 3.5, 2/16},
}, },
}, },
node_dig_prediction = "default:sand", node_dig_prediction = "default:sand",
@ -114,6 +112,7 @@ minetest.register_node("ethereal:seaweed_rooted", {
end end
}) })
-- update old style seaweed nodes to new
minetest.register_lbm({ minetest.register_lbm({
label = "[ethereal] Upgrade seaweed", label = "[ethereal] Upgrade seaweed",
@ -132,8 +131,7 @@ minetest.register_lbm({
local height = 0 local height = 0
while height < 14 while height < 14 and minetest.get_node(pos_up).name == "ethereal:seaweed" do
and minetest.get_node(pos_up).name == "ethereal:seaweed" do
minetest.remove_node(pos_up) minetest.remove_node(pos_up)
height = height + 1 height = height + 1
pos_up.y = pos_up.y + 1 pos_up.y = pos_up.y + 1
@ -147,34 +145,16 @@ minetest.register_lbm({
end end
}) })
-- seaweed to dark green dye
-- seaweed to d.green dye
minetest.register_craft( { minetest.register_craft( {
output = "dye:dark_green 3", output = "dye:dark_green 3",
recipe = {{"ethereal:seaweed"}} recipe = {{"ethereal:seaweed"}}
})
-- agar powder
minetest.register_craftitem("ethereal:agar_powder", {
description = S("Agar Powder"),
inventory_image = "ethereal_agar_powder.png",
groups = {food_gelatin = 1, flammable = 2}
})
minetest.register_craft({
output = "ethereal:agar_powder 3",
recipe = {
{"group:food_seaweed", "group:food_seaweed", "group:food_seaweed"},
{"bucket:bucket_water", "bucket:bucket_water", "default:torch"},
{"bucket:bucket_water", "bucket:bucket_water", "default:torch"}
},
replacements = {
{"bucket:bucket_water", "bucket:bucket_empty 4"}
}
}) })
-- Corals -- coral on_place helper function
local coral_nodes = {} local coral_nodes = {}
local function register_coral(name, description, texture) local function register_coral(name, description, texture)
@ -190,9 +170,7 @@ local function register_coral(name, description, texture)
if def_up.liquidtype == nil or def_up.liquidtype ~= "none" then if def_up.liquidtype == nil or def_up.liquidtype ~= "none" then
if minetest.is_protected(pos, pname) then if minetest.is_protected(pos, pname) then return end
return
end
if def_down.name ~= "default:sand"and def_down.name ~= "ethereal:sandy" then if def_down.name ~= "default:sand"and def_down.name ~= "ethereal:sandy" then
return return
@ -221,6 +199,7 @@ local function register_coral(name, description, texture)
return res return res
end end
-- decorative coral node
minetest.register_node("ethereal:" .. name, { minetest.register_node("ethereal:" .. name, {
description = description, description = description,
drawtype = "plantlike", drawtype = "plantlike",
@ -229,8 +208,7 @@ local function register_coral(name, description, texture)
wield_image = texture, wield_image = texture,
paramtype = "light", paramtype = "light",
selection_box = { selection_box = {
type = "fixed", type = "fixed", fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 1 / 4, 6 / 16}
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 1 / 4, 6 / 16}
}, },
light_source = 3, light_source = 3,
groups = {snappy = 3}, groups = {snappy = 3},
@ -238,6 +216,7 @@ local function register_coral(name, description, texture)
on_place = plantlike_on_place on_place = plantlike_on_place
}) })
-- coral node rooted in sand
minetest.register_node("ethereal:" .. name .. "_rooted", { minetest.register_node("ethereal:" .. name .. "_rooted", {
description = description, description = description,
drop = "ethereal:" .. name, drop = "ethereal:" .. name,
@ -248,8 +227,7 @@ local function register_coral(name, description, texture)
wield_image = texture, wield_image = texture,
paramtype = "light", paramtype = "light",
selection_box = { selection_box = {
type = "fixed", type = "fixed", fixed = {-6 / 16, 0.5, -6 / 16, 6 / 16, 1.25, 6 / 16}
fixed = {-6 / 16, 0.5, -6 / 16, 6 / 16, 1.25, 6 / 16}
}, },
light_source = 3, light_source = 3,
groups = {snappy = 3, not_in_creative_inventory = 1}, groups = {snappy = 3, not_in_creative_inventory = 1},
@ -260,6 +238,7 @@ local function register_coral(name, description, texture)
table.insert(coral_nodes, "ethereal:" .. name) table.insert(coral_nodes, "ethereal:" .. name)
end end
-- update old style coral to new
minetest.register_lbm({ minetest.register_lbm({
label = "[ethereal] Upgrade corals", label = "[ethereal] Upgrade corals",
@ -284,44 +263,32 @@ minetest.register_lbm({
end end
}) })
-- Blua Coral -- Blua Coral
register_coral("coral2", S("Blue Glow Coral"), "ethereal_coral_blue.png") register_coral("coral2", S("Blue Glow Coral"), "ethereal_coral_blue.png")
minetest.register_craft( { minetest.register_craft({output = "dye:cyan 3", recipe = {{"ethereal:coral2"}}})
output = "dye:cyan 3",
recipe = {{"ethereal:coral2"}}
})
-- Orange Coral -- Orange Coral
register_coral("coral3", S("Orange Glow Coral"), "ethereal_coral_orange.png") register_coral("coral3", S("Orange Glow Coral"), "ethereal_coral_orange.png")
minetest.register_craft( { minetest.register_craft({output = "dye:orange 3", recipe = {{"ethereal:coral3"}}})
output = "dye:orange 3",
recipe = {{"ethereal:coral3"}}
})
-- Pink Coral -- Pink Coral
register_coral("coral4", S("Pink Glow Coral"), "ethereal_coral_pink.png") register_coral("coral4", S("Pink Glow Coral"), "ethereal_coral_pink.png")
minetest.register_craft( { minetest.register_craft({output = "dye:pink 3", recipe = {{"ethereal:coral4"}}})
output = "dye:pink 3",
recipe = {{"ethereal:coral4"}}
})
-- Green Coral -- Green Coral
register_coral("coral5", S("Green Glow Coral"), "ethereal_coral_green.png") register_coral("coral5", S("Green Glow Coral"), "ethereal_coral_green.png")
minetest.register_craft( { minetest.register_craft({output = "dye:green 3", recipe = {{"ethereal:coral5"}}})
output = "dye:green 3",
recipe = {{"ethereal:coral5"}}
})
-- Undersea Sand (used for growing seaweed and corals) -- Undersea Sand (used for growing seaweed and corals)
minetest.register_node("ethereal:sandy", { minetest.register_node("ethereal:sandy", {
description = S("Sandy"), description = S("Sandy"),
tiles = {"default_sand.png"}, tiles = {"default_sand.png"},
@ -333,8 +300,8 @@ minetest.register_node("ethereal:sandy", {
sounds = default.node_sound_sand_defaults() sounds = default.node_sound_sand_defaults()
}) })
-- randomly generate coral or seaweed and have seaweed grow up to 14 high -- randomly generate coral or seaweed and have seaweed grow up to 14 high
if ethereal.sealife == 1 then if ethereal.sealife == 1 then
minetest.register_abm({ minetest.register_abm({
@ -353,9 +320,7 @@ if ethereal.sealife == 1 then
local p2 = node.param2 or 16 local p2 = node.param2 or 16
local height = math.max(1, math.floor(p2 / 16)) local height = math.max(1, math.floor(p2 / 16))
if height > 13 then if height > 13 then return end
return
end
height = height + 1 height = height + 1
@ -397,8 +362,7 @@ if ethereal.sealife == 1 then
}) })
end end
-- sponge nodes (place dry sponge to suck up all water surrounding it, cook to dry)
-- sponge nodes
minetest.register_node("ethereal:sponge_air", { minetest.register_node("ethereal:sponge_air", {
drawtype = "airlike", drawtype = "airlike",
@ -430,14 +394,12 @@ minetest.register_node("ethereal:sponge", {
local name = placer:get_player_name() local name = placer:get_player_name()
-- is area protected -- is area protected
if minetest.is_protected(pos, name) then if minetest.is_protected(pos, name) then return end
return
end
-- get water nodes within range -- get water nodes within range
local num = minetest.find_nodes_in_area( local num = minetest.find_nodes_in_area(
{x = pos.x - 3, y = pos.y - 3, z = pos.z - 3}, {x = pos.x - 3, y = pos.y - 3, z = pos.z - 3},
{x = pos.x + 3, y = pos.y + 3, z = pos.z + 3}, {"group:water"}) {x = pos.x + 3, y = pos.y + 3, z = pos.z + 3}, {"group:water"})
-- no water -- no water
if #num == 0 then return end if #num == 0 then return end
@ -456,6 +418,7 @@ minetest.register_node("ethereal:sponge", {
}) })
-- cook wet sponge into dry sponge -- cook wet sponge into dry sponge
minetest.register_craft({ minetest.register_craft({
type = "cooking", type = "cooking",
recipe = "ethereal:sponge_wet", recipe = "ethereal:sponge_wet",
@ -464,6 +427,7 @@ minetest.register_craft({
}) })
-- use leaf decay to remove sponge air nodes -- use leaf decay to remove sponge air nodes
default.register_leafdecay({ default.register_leafdecay({
trunks = {"ethereal:sponge_wet"}, trunks = {"ethereal:sponge_wet"},
leaves = {"ethereal:sponge_air"}, leaves = {"ethereal:sponge_air"},
@ -471,6 +435,7 @@ default.register_leafdecay({
}) })
-- dry sponges can be used as fuel -- dry sponges can be used as fuel
minetest.register_craft({ minetest.register_craft({
type = "fuel", type = "fuel",
recipe = "ethereal:sponge", recipe = "ethereal:sponge",

View File

@ -1,13 +1,13 @@
-- language support -- translation and mod check
local S = ethereal.translate
-- stair mods active local S = minetest.get_translator("ethereal")
local stairs_mod = minetest.get_modpath("stairs") local stairs_mod = minetest.get_modpath("stairs")
local stairs_redo = stairs_mod and stairs.mod and stairs.mod == "redo" local stairs_redo = stairs_mod and stairs.mod and stairs.mod == "redo"
local stairs_plus = minetest.global_exists("stairsplus") local stairs_plus = minetest.global_exists("stairsplus")
-- stair selection function -- register stair function (stair mod will be auto-selected)
local do_stair = function(description, name, node, groups, texture, sound) local do_stair = function(description, name, node, groups, texture, sound)
if stairs_redo then if stairs_redo then
@ -39,51 +39,39 @@ local do_stair = function(description, name, node, groups, texture, sound)
mod .. ":slab_" .. name) mod .. ":slab_" .. name)
else else
stairs.register_stair_and_slab(name, node, groups, texture, stairs.register_stair_and_slab(name, node, groups, texture,
S(description .. " Stair"), S(description .. " Slab"), sound, true) S(description .. " Stair"), S(description .. " Slab"), sound, true)
end end
end end
-- Register Stairs
-- Register Stairs (stair mod will be auto-selected)
do_stair( do_stair(
"Blue Marble", "Blue Marble", "blue_marble", "ethereal:blue_marble",
"blue_marble",
"ethereal:blue_marble",
{cracky = 1}, {cracky = 1},
{"ethereal_blue_marble.png"}, {"ethereal_blue_marble.png"},
default.node_sound_stone_defaults()) default.node_sound_stone_defaults())
do_stair( do_stair(
"Blue Marble Tile", "Blue Marble Tile", "blue_marble_tile", "ethereal:blue_marble_tile",
"blue_marble_tile",
"ethereal:blue_marble_tile",
{cracky = 1}, {cracky = 1},
{"ethereal_blue_marble_tile.png"}, {"ethereal_blue_marble_tile.png"},
default.node_sound_stone_defaults()) default.node_sound_stone_defaults())
do_stair( do_stair(
"Crystal Block", "Crystal Block", "crystal_block", "ethereal:crystal_block",
"crystal_block",
"ethereal:crystal_block",
{cracky = 1, level = 2, puts_out_fire = 1, cools_lava = 1}, {cracky = 1, level = 2, puts_out_fire = 1, cools_lava = 1},
{"ethereal_crystal_block.png"}, {"ethereal_crystal_block.png"},
default.node_sound_glass_defaults()) default.node_sound_glass_defaults())
do_stair( do_stair(
"Ice Brick", "Ice Brick", "icebrick", "ethereal:icebrick",
"icebrick",
"ethereal:icebrick",
{cracky = 3, puts_out_fire = 1, cools_lava = 1, slippery = 3}, {cracky = 3, puts_out_fire = 1, cools_lava = 1, slippery = 3},
{"ethereal_brick_ice.png"}, {"ethereal_brick_ice.png"},
default.node_sound_glass_defaults()) default.node_sound_glass_defaults())
do_stair( do_stair(
"Snow Brick", "Snow Brick", "snowbrick", "ethereal:snowbrick",
"snowbrick",
"ethereal:snowbrick",
{crumbly = 3, puts_out_fire = 1, cools_lava = 1}, {crumbly = 3, puts_out_fire = 1, cools_lava = 1},
{"ethereal_brick_snow.png"}, {"ethereal_brick_snow.png"},
default.node_sound_dirt_defaults({ default.node_sound_dirt_defaults({
@ -92,105 +80,79 @@ do_stair(
})) }))
do_stair( do_stair(
"Dried Dirt", "Dried Dirt", "dry_dirt", "ethereal:dry_dirt",
"dry_dirt",
"ethereal:dry_dirt",
{crumbly = 3}, {crumbly = 3},
{"ethereal_dry_dirt.png"}, {"ethereal_dry_dirt.png"},
default.node_sound_dirt_defaults()) default.node_sound_dirt_defaults())
do_stair( do_stair(
"Mushroom Trunk", "Mushroom Trunk", "mushroom_trunk", "ethereal:mushroom_trunk",
"mushroom_trunk",
"ethereal:mushroom_trunk",
{choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
{"ethereal_mushroom_trunk.png"}, {"ethereal_mushroom_trunk.png"},
default.node_sound_wood_defaults()) default.node_sound_wood_defaults())
do_stair( do_stair(
"Mushroom Top", "Mushroom Top", "mushroom", "ethereal:mushroom",
"mushroom",
"ethereal:mushroom",
{choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
{"ethereal_mushroom_block.png"}, {"ethereal_mushroom_block.png"},
default.node_sound_wood_defaults()) default.node_sound_wood_defaults())
do_stair( do_stair(
"Frost Wood", "Frost Wood", "frost_wood", "ethereal:frost_wood",
"frost_wood",
"ethereal:frost_wood",
{choppy = 2, oddly_breakable_by_hand = 1, put_out_fire = 1}, {choppy = 2, oddly_breakable_by_hand = 1, put_out_fire = 1},
{"ethereal_frost_wood.png"}, {"ethereal_frost_wood.png"},
default.node_sound_wood_defaults()) default.node_sound_wood_defaults())
do_stair( do_stair(
"Healing Wood", "Healing Wood", "yellow_wood", "ethereal:yellow_wood",
"yellow_wood",
"ethereal:yellow_wood",
{choppy = 2, oddly_breakable_by_hand = 1, put_out_fire = 1}, {choppy = 2, oddly_breakable_by_hand = 1, put_out_fire = 1},
{"ethereal_yellow_wood.png"}, {"ethereal_yellow_wood.png"},
default.node_sound_wood_defaults()) default.node_sound_wood_defaults())
do_stair( do_stair(
"Palm Wood", "Palm Wood", "palm_wood", "ethereal:palm_wood",
"palm_wood",
"ethereal:palm_wood",
{choppy = 2, oddly_breakable_by_hand = 1, flammable = 3}, {choppy = 2, oddly_breakable_by_hand = 1, flammable = 3},
{"moretrees_palm_wood.png"}, {"moretrees_palm_wood.png"},
default.node_sound_wood_defaults()) default.node_sound_wood_defaults())
do_stair( do_stair(
"Birch Wood", "Birch Wood", "birch_wood", "ethereal:birch_wood",
"birch_wood",
"ethereal:birch_wood",
{choppy = 2, oddly_breakable_by_hand = 1, flammable = 3}, {choppy = 2, oddly_breakable_by_hand = 1, flammable = 3},
{"moretrees_birch_wood.png"}, {"moretrees_birch_wood.png"},
default.node_sound_wood_defaults()) default.node_sound_wood_defaults())
do_stair( do_stair(
"Banana Wood", "Banana Wood", "banana_wood", "ethereal:banana_wood",
"banana_wood",
"ethereal:banana_wood",
{choppy = 2, oddly_breakable_by_hand = 1, flammable = 3}, {choppy = 2, oddly_breakable_by_hand = 1, flammable = 3},
{"ethereal_banana_wood.png"}, {"ethereal_banana_wood.png"},
default.node_sound_wood_defaults()) default.node_sound_wood_defaults())
do_stair( do_stair(
"Willow Wood", "Willow Wood", "willow_wood", "ethereal:willow_wood",
"willow_wood",
"ethereal:willow_wood",
{choppy = 2, oddly_breakable_by_hand = 1, flammable = 3}, {choppy = 2, oddly_breakable_by_hand = 1, flammable = 3},
{"ethereal_willow_wood.png"}, {"ethereal_willow_wood.png"},
default.node_sound_wood_defaults()) default.node_sound_wood_defaults())
do_stair( do_stair(
"Redwood", "Redwood", "redwood_wood", "ethereal:redwood_wood",
"redwood_wood",
"ethereal:redwood_wood",
{choppy = 2, oddly_breakable_by_hand = 1, flammable = 3}, {choppy = 2, oddly_breakable_by_hand = 1, flammable = 3},
{"ethereal_redwood_wood.png"}, {"ethereal_redwood_wood.png"},
default.node_sound_wood_defaults()) default.node_sound_wood_defaults())
do_stair( do_stair(
"Bamboo", "Bamboo", "bamboo_wood", "ethereal:bamboo_block",
"bamboo_wood",
"ethereal:bamboo_block",
{snappy = 3, choppy = 2, oddly_breakable_by_hand = 1, flammable = 3}, {snappy = 3, choppy = 2, oddly_breakable_by_hand = 1, flammable = 3},
{"ethereal_bamboo_floor.png"}, {"ethereal_bamboo_floor.png"},
default.node_sound_wood_defaults()) default.node_sound_wood_defaults())
do_stair( do_stair(
"Sakura Wood", "Sakura Wood", "sakura_wood", "ethereal:sakura_wood",
"sakura_wood",
"ethereal:sakura_wood",
{choppy = 2, oddly_breakable_by_hand = 1, flammable = 3}, {choppy = 2, oddly_breakable_by_hand = 1, flammable = 3},
{"ethereal_sakura_wood.png"}, {"ethereal_sakura_wood.png"},
default.node_sound_wood_defaults()) default.node_sound_wood_defaults())
do_stair( do_stair(
"Olive Wood", "Olive Wood", "olive_wood", "ethereal:olive_wood",
"olive_wood",
"ethereal:olive_wood",
{choppy = 2, oddly_breakable_by_hand = 1, flammable = 3}, {choppy = 2, oddly_breakable_by_hand = 1, flammable = 3},
{"ethereal_olive_wood.png"}, {"ethereal_olive_wood.png"},
default.node_sound_wood_defaults()) default.node_sound_wood_defaults())

View File

@ -1,8 +1,8 @@
local S = ethereal.translate local S = minetest.get_translator("ethereal")
-- Strawberry (can also be planted directly as seed)
-- Strawberry (can also be planted as seed)
minetest.register_craftitem("ethereal:strawberry", { minetest.register_craftitem("ethereal:strawberry", {
description = S("Strawberry"), description = S("Strawberry"),
inventory_image = "ethereal_strawberry.png", inventory_image = "ethereal_strawberry.png",
@ -17,7 +17,8 @@ minetest.register_craftitem("ethereal:strawberry", {
ethereal.add_eatable("ethereal:strawberry", 1) ethereal.add_eatable("ethereal:strawberry", 1)
-- Define Strawberry Bush growth stages -- Strawberry definition
local def = { local def = {
drawtype = "plantlike", drawtype = "plantlike",
tiles = {"ethereal_strawberry_1.png"}, tiles = {"ethereal_strawberry_1.png"},
@ -28,8 +29,7 @@ local def = {
buildable_to = true, buildable_to = true,
drop = "", drop = "",
selection_box = { selection_box = {
type = "fixed", type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}
}, },
groups = { groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1, snappy = 3, flammable = 2, plant = 1, attached_node = 1,
@ -39,25 +39,31 @@ local def = {
} }
--stage 1 --stage 1
minetest.register_node("ethereal:strawberry_1", table.copy(def)) minetest.register_node("ethereal:strawberry_1", table.copy(def))
-- stage 2 -- stage 2
def.tiles = {"ethereal_strawberry_2.png"} def.tiles = {"ethereal_strawberry_2.png"}
minetest.register_node("ethereal:strawberry_2", table.copy(def)) minetest.register_node("ethereal:strawberry_2", table.copy(def))
-- stage 3 -- stage 3
def.tiles = {"ethereal_strawberry_3.png"} def.tiles = {"ethereal_strawberry_3.png"}
minetest.register_node("ethereal:strawberry_3", table.copy(def)) minetest.register_node("ethereal:strawberry_3", table.copy(def))
-- stage 4 -- stage 4
def.tiles = {"ethereal_strawberry_4.png"} def.tiles = {"ethereal_strawberry_4.png"}
minetest.register_node("ethereal:strawberry_4", table.copy(def)) minetest.register_node("ethereal:strawberry_4", table.copy(def))
-- stage 5 -- stage 5
def.tiles = {"ethereal_strawberry_5.png"} def.tiles = {"ethereal_strawberry_5.png"}
minetest.register_node("ethereal:strawberry_5", table.copy(def)) minetest.register_node("ethereal:strawberry_5", table.copy(def))
-- stage 6 -- stage 6
def.tiles = {"ethereal_strawberry_6.png"} def.tiles = {"ethereal_strawberry_6.png"}
def.drop = { def.drop = {
items = { items = {
@ -68,6 +74,7 @@ def.drop = {
minetest.register_node("ethereal:strawberry_6", table.copy(def)) minetest.register_node("ethereal:strawberry_6", table.copy(def))
-- stage 7 -- stage 7
def.tiles = {"ethereal_strawberry_7.png"} def.tiles = {"ethereal_strawberry_7.png"}
def.drop = { def.drop = {
items = { items = {
@ -78,11 +85,11 @@ def.drop = {
minetest.register_node("ethereal:strawberry_7", table.copy(def)) minetest.register_node("ethereal:strawberry_7", table.copy(def))
-- stage 8 (final) -- stage 8 (final)
def.tiles = {"ethereal_strawberry_8.png"} def.tiles = {"ethereal_strawberry_8.png"}
def.groups.growing = nil def.groups.growing = nil
def.selection_box = { def.selection_box = {
type = "fixed", type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, -2.5/16, 0.5}
fixed = {-0.5, -0.5, -0.5, 0.5, -2.5/16, 0.5}
} }
def.drop = { def.drop = {
items = { items = {
@ -92,6 +99,7 @@ def.drop = {
} }
minetest.register_node("ethereal:strawberry_8", table.copy(def)) minetest.register_node("ethereal:strawberry_8", table.copy(def))
-- register Abm to grow strawberry (this file wont be loaded if farming redo active)
minetest.register_abm({ minetest.register_abm({
label = "Ethereal grow strawberry", label = "Ethereal grow strawberry",
@ -117,11 +125,9 @@ minetest.register_abm({
pos.y = pos.y + 1 pos.y = pos.y + 1
-- do we have enough light? -- do we have enough light?
local light = minetest.get_node_light(pos) local light = minetest.get_node_light(pos) or 0
if not light or light < 13 then if light < 13 then return end
return
end
-- grow to next stage -- grow to next stage
local num = node.name:split("_")[2] local num = node.name:split("_")[2]
@ -131,4 +137,3 @@ minetest.register_abm({
minetest.swap_node(pos, node) minetest.swap_node(pos, node)
end end
}) })

View File

@ -1,8 +1,8 @@
local S = ethereal.translate local S = minetest.get_translator("ethereal")
-- Ice Brick -- Ice Brick
minetest.register_node("ethereal:icebrick", { minetest.register_node("ethereal:icebrick", {
description = S("Ice Brick"), description = S("Ice Brick"),
tiles = {"ethereal_brick_ice.png"}, tiles = {"ethereal_brick_ice.png"},
@ -20,8 +20,8 @@ minetest.register_craft({
} }
}) })
-- Snow Brick -- Snow Brick
minetest.register_node("ethereal:snowbrick", { minetest.register_node("ethereal:snowbrick", {
description = S("Snow Brick"), description = S("Snow Brick"),
tiles = {"ethereal_brick_snow.png"}, tiles = {"ethereal_brick_snow.png"},
@ -43,8 +43,8 @@ minetest.register_craft({
} }
}) })
-- If Crystal Spike or Snow near Water, change Water to Ice
-- If Crystal Spike, Snow near Water, change Water to Ice
minetest.register_abm({ minetest.register_abm({
label = "Ethereal freeze water", label = "Ethereal freeze water",
nodenames = { nodenames = {
@ -59,7 +59,7 @@ minetest.register_abm({
action = function(pos, node) action = function(pos, node)
local near = minetest.find_node_near(pos, 1, local near = minetest.find_node_near(pos, 1,
{"default:water_source", "default:river_water_source"}) {"default:water_source", "default:river_water_source"})
if near then if near then
minetest.swap_node(near, {name = "default:ice"}) minetest.swap_node(near, {name = "default:ice"})
@ -67,8 +67,8 @@ minetest.register_abm({
end end
}) })
-- If Heat Source near Ice or Snow then melt. -- If Heat Source near Ice or Snow then melt.
minetest.register_abm({ minetest.register_abm({
label = "Ethereal melt snow/ice", label = "Ethereal melt snow/ice",
nodenames = { nodenames = {
@ -109,8 +109,8 @@ minetest.register_abm({
end end
}) })
-- If Water Source near Dry Dirt, change to normal Dirt -- If Water Source near Dry Dirt, change to normal Dirt
minetest.register_abm({ minetest.register_abm({
label = "Ethereal wet dry dirt", label = "Ethereal wet dry dirt",
nodenames = { nodenames = {
@ -135,8 +135,8 @@ minetest.register_abm({
end end
}) })
-- when enabled, drop torches that are touching water -- when enabled, drop torches that are touching water
if ethereal.torchdrop == true and not minetest.get_modpath("real_torch") then if ethereal.torchdrop == true and not minetest.get_modpath("real_torch") then
minetest.register_abm({ minetest.register_abm({
@ -150,21 +150,21 @@ if ethereal.torchdrop == true and not minetest.get_modpath("real_torch") then
action = function(pos, node) action = function(pos, node)
local num = #minetest.find_nodes_in_area( local num = #minetest.find_nodes_in_area(
{x = pos.x - 1, y = pos.y, z = pos.z}, {x = pos.x - 1, y = pos.y, z = pos.z},
{x = pos.x + 1, y = pos.y, z = pos.z}, {"group:water"}) {x = pos.x + 1, y = pos.y, z = pos.z}, {"group:water"})
if num == 0 then if num == 0 then
num = num + #minetest.find_nodes_in_area( num = num + #minetest.find_nodes_in_area(
{x = pos.x, y = pos.y, z = pos.z - 1}, {x = pos.x, y = pos.y, z = pos.z - 1},
{x = pos.x, y = pos.y, z = pos.z + 1}, {"group:water"}) {x = pos.x, y = pos.y, z = pos.z + 1}, {"group:water"})
end end
if num == 0 then if num == 0 then
num = num + #minetest.find_nodes_in_area( num = num + #minetest.find_nodes_in_area(
{x = pos.x, y = pos.y + 1, z = pos.z}, {x = pos.x, y = pos.y + 1, z = pos.z},
{x = pos.x, y = pos.y + 1, z = pos.z}, {"group:water"}) {x = pos.x, y = pos.y + 1, z = pos.z}, {"group:water"})
end end
if num > 0 then if num > 0 then

View File

@ -1,7 +1,7 @@
local S = ethereal.translate local S = minetest.get_translator("ethereal")
-- helper function -- register wood and placement helper
local function add_wood(name, def) local function add_wood(name, def)
@ -146,7 +146,6 @@ minetest.register_craft({
recipe = {{"ethereal:frost_tree"}} recipe = {{"ethereal:frost_tree"}}
}) })
-- healing -- healing
minetest.register_node("ethereal:yellow_trunk", { minetest.register_node("ethereal:yellow_trunk", {
@ -314,12 +313,10 @@ minetest.register_node("ethereal:bamboo", {
sunlight_propagates = true, sunlight_propagates = true,
walkable = true, walkable = true,
selection_box = { selection_box = {
type = "fixed", type = "fixed", fixed = {-0.15, -0.5, -0.15, 0.15, 0.5, 0.15}
fixed = {-0.15, -0.5, -0.15, 0.15, 0.5, 0.15}
}, },
collision_box = { collision_box = {
type = "fixed", type = "fixed", fixed = {-0.15, -0.5, -0.15, 0.15, 0.5, 0.15}
fixed = {-0.15, -0.5, -0.15, 0.15, 0.5, 0.15}
}, },
groups = {choppy = 3, oddly_breakable_by_hand = 1, flammable = 2}, groups = {choppy = 3, oddly_breakable_by_hand = 1, flammable = 2},
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
@ -363,4 +360,3 @@ minetest.register_craft({
output = "ethereal:olive_wood 4", output = "ethereal:olive_wood 4",
recipe = {{"ethereal:olive_trunk"}} recipe = {{"ethereal:olive_trunk"}}
}) })