diff options
author | root <root@mirzakhani.gpcf.eu> | 2018-05-08 11:27:26 +0200 |
---|---|---|
committer | root <root@mirzakhani.gpcf.eu> | 2018-05-08 11:27:26 +0200 |
commit | ad50b4f6518422dd6c47a3e04d92cc487f17e486 (patch) | |
tree | 2ab4c2d93940f0cfacebc7226b6bab7a91e28a45 | |
parent | f0f0d5bbd292ac3bbf0c9dd373bd4e4776827e34 (diff) | |
parent | d9de5c5d9081ba998edd02afed61c21cdafefaac (diff) |
Merge branch 'master' of https://github.com/tenplus1/ethereal
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | bonemeal.lua | 313 | ||||
-rw-r--r-- | init.lua | 7 | ||||
-rw-r--r-- | mapgen.lua | 17 | ||||
-rw-r--r-- | textures/bone.png | bin | 148 -> 0 bytes | |||
-rw-r--r-- | textures/bonemeal.png | bin | 186 -> 0 bytes | |||
-rw-r--r-- | textures/bonemeal_particle.png | bin | 116 -> 0 bytes |
7 files changed, 20 insertions, 318 deletions
@@ -14,6 +14,7 @@ Ethereal Mapgen mod for Minetest (works on all except v6) - Updating code to newer functions, requires Minetest 0.4.16 and above - Added food groups to be more compatible with other food mods + - Bonemeal removed (use Bonemeal mod to replace https://forum.minetest.net/viewtopic.php?f=9&t=16446 ) ### 1.23 diff --git a/bonemeal.lua b/bonemeal.lua deleted file mode 100644 index 404aa7b..0000000 --- a/bonemeal.lua +++ /dev/null @@ -1,313 +0,0 @@ -
-local S = ethereal.intllib
-
--- bone item
-minetest.register_craftitem("ethereal:bone", {
- description = S("Bone"),
- inventory_image = "bone.png",
-})
-
--- bonemeal recipes
-minetest.register_craft({
- type = "shapeless",
- output = 'ethereal:bonemeal 2',
- recipe = {'ethereal:bone'},
-})
-
-minetest.register_craft({
- type = "shapeless",
- output = 'ethereal:bonemeal 4',
- recipe = {'bones:bones'},
-})
-
-minetest.register_craft( {
- type = "shapeless",
- output = "dye:white 2",
- recipe = {"ethereal:bonemeal"},
-})
-
--- have animalmaterials bone craft into bonemeal if found
-if minetest.get_modpath('animalmaterials') then
-
- minetest.register_craft({
- type = "shapeless",
- output = 'ethereal:bonemeal 2',
- recipe = {'animalmaterials:bone'},
- })
-end
-
--- add bones to dirt
-minetest.override_item("default:dirt", {
- drop = {
- max_items = 1,
- items = {
- {
- items = {'ethereal:bone', 'default:dirt'},
- rarity = 30,
- },
- {
- items = {'default:dirt'},
- }
- }
- },
-})
-
-local plants = {
- "flowers:dandelion_white",
- "flowers:dandelion_yellow",
- "flowers:geranium",
- "flowers:rose",
- "flowers:tulip",
- "flowers:viola",
-}
-
-
-local crops = {
- {"farming:cotton_", 8},
- {"farming:wheat_", 8},
- {"farming:tomato_", 8},
- {"farming:corn_", 8},
- {"farming:melon_", 8},
- {"farming:pumpkin_", 8},
- {"farming:beanpole_", 5},
- {"farming:blueberry_", 4},
- {"farming:raspberry_", 4},
- {"farming:carrot_", 8},
- {"farming:cocoa_", 4},
- {"farming:coffee_", 5},
- {"farming:cucumber_", 4},
- {"farming:potato_", 4},
- {"farming:grapes_", 8},
- {"farming:rhubarb_", 3},
- {"ethereal:strawberry_", 8},
- {"ethereal:onion_", 5},
- {"farming:barley_", 7},
- {"farming:hemp_", 8},
- {"farming:chili_", 8},
- {"farming:garlic_", 5},
- {"farming:onion_", 5},
- {"farming:pepper_", 5},
- {"farming:pineapple_", 8},
- {"farming:pea_", 5},
-}
-
--- check if sapling has enough height room to grow
-local function enough_height(pos, height)
-
- local nod = minetest.line_of_sight(
- {x = pos.x, y = pos.y + 1, 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
-
--- growing routine
-local function growth(pointed_thing)
-
- local pos = pointed_thing.under
- local node = minetest.get_node(pos)
-
- if node.name == "ignore" then
- return
- end
-
- minetest.add_particlespawner({
- amount = 4,
- time = 0.15,
- minpos = pos,
- maxpos = pos,
- minvel = {x = -1, y = 2, z = -1},
- maxvel = {x = 1, y = 4, z = 1},
- minacc = {x = -1, y = -1, z = -1},
- maxacc = {x = 1, y = 1, z = 1},
- minexptime = 1,
- maxexptime = 1,
- minsize = 1,
- maxsize = 3,
- texture = "bonemeal_particle.png",
- })
-
- -- 50/50 chance of growing a sapling
- if minetest.get_item_group(node.name, "sapling") > 0
- or minetest.get_item_group(node.name, "ethereal_sapling") > 0 then
-
- if math.random(1, 2) == 1 then
- return
- end
-
- local under = minetest.get_node({
- x = pos.x,
- y = pos.y - 1,
- z = pos.z
- })
-
- local height = minetest.registered_nodes[node.name].grown_height
-
- -- do we have enough height to grow sapling into tree?
- if height and not enough_height(pos, height) then
- return
- end
-
- -- specific check for palm tree's, so they grow on sand
- if node.name == "ethereal:palm_sapling"
- and under.name == "default:sand" then
- ethereal.grow_palm_tree(pos)
- return
- end
-
- -- check for soil under sapling
- if minetest.get_item_group(under.name, "soil") == 0 then
- return
- end
-
- -- grow ethereal tree
- if node.name == "ethereal:palm_sapling" then
- ethereal.grow_palm_tree(pos)
-
- elseif node.name == "ethereal:yellow_tree_sapling" then
- ethereal.grow_yellow_tree(pos)
-
- elseif node.name == "ethereal:big_tree_sapling" then
- ethereal.grow_big_tree(pos)
-
- elseif node.name == "ethereal:banana_tree_sapling" then
- ethereal.grow_banana_tree(pos)
-
- elseif node.name == "ethereal:frost_tree_sapling" then
- ethereal.grow_frost_tree(pos)
-
- elseif node.name == "ethereal:mushroom_sapling" then
- ethereal.grow_mushroom_tree(pos)
-
- elseif node.name == "ethereal:willow_sapling" then
- ethereal.grow_willow_tree(pos)
-
- elseif node.name == "ethereal:redwood_sapling" then
- ethereal.grow_redwood_tree(pos)
-
- elseif node.name == "ethereal:orange_tree_sapling" then
- ethereal.grow_orange_tree(pos)
-
- elseif node.name == "ethereal:bamboo_sprout" then
- ethereal.grow_bamboo_tree(pos)
-
- elseif node.name == "ethereal:birch_sapling" then
- ethereal.grow_birch_tree(pos)
-
- -- grow default tree
- elseif node.name == "default:sapling"
- and enough_height(pos, 7) then
- default.grow_new_apple_tree(pos)
-
- elseif node.name == "default:junglesapling"
- and enough_height(pos, 15) then
- default.grow_new_jungle_tree(pos)
-
- elseif node.name == "default:pine_sapling"
- and enough_height(pos, 11) then
-
- if minetest.find_node_near(pos, 1,
- {"default:snow", "default:snowblock", "default:dirt_with_snow"}) then
-
- default.grow_new_snowy_pine_tree(pos)
- else
- default.grow_new_pine_tree(pos)
- end
-
- elseif node.name == "default:acacia_sapling"
- and enough_height(pos, 7) then
- default.grow_new_acacia_tree(pos)
-
- elseif node.name == "default:aspen_sapling"
- and enough_height(pos, 11) then
- default.grow_new_aspen_tree(pos)
-
- elseif node.name == "default:bush_sapling" then
- default.grow_bush(pos)
- elseif node.name == "default:acacia_bush_sapling" then
- default.grow_acacia_bush(pos)
- end
-
- return
- end
-
- local stage = ""
-
- -- grow registered crops
- for n = 1, #crops do
-
- if string.find(node.name, crops[n][1]) then
-
- stage = tonumber( node.name:split("_")[2] )
- stage = math.min(stage + math.random(1, 4), crops[n][2])
-
- minetest.set_node(pos, {name = crops[n][1] .. stage})
-
- return
-
- end
-
- end
-
- -- grow grass and flowers
- if minetest.get_item_group(node.name, "soil") > 0 then
-
- local dirt = minetest.find_nodes_in_area_under_air(
- {x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
- {x = pos.x + 2, y = pos.y + 1, z = pos.z + 2},
- {"group:soil"})
-
- for _,n in pairs(dirt) do
-
- local pos2 = n
-
- pos2.y = pos2.y + 1
-
- if math.random(0, 5) > 3 then
-
- minetest.swap_node(pos2,
- {name = plants[math.random(1, #plants)]})
- else
-
- if node.name == "default:dirt_with_dry_grass" then
- minetest.swap_node(pos2,
- {name = "default:dry_grass_" .. math.random(1, 5)})
- else
- minetest.swap_node(pos2,
- {name = "default:grass_" .. math.random(1, 5)})
- end
-
- end
- end
- end
-end
-
--- bonemeal item
-minetest.register_craftitem("ethereal:bonemeal", {
- description = S("Bone Meal"),
- inventory_image = "bonemeal.png",
-
- on_use = function(itemstack, user, pointed_thing)
-
- if pointed_thing.type == "node" then
-
- -- Check if node protected
- if minetest.is_protected(pointed_thing.under, user:get_player_name()) then
- return
- end
-
- if not ethereal.check_creative(user:get_player_name()) then
-
- itemstack:take_item()
- end
-
- growth(pointed_thing)
-
- return itemstack
- end
- end,
-})
@@ -99,12 +99,13 @@ dofile(path .. "/compatibility.lua") dofile(path .. "/stairs.lua")
dofile(path .. "/lucky_block.lua")
--- Use bonemeal mod instead of ethereal's own if found
+-- Set bonemeal aliases
if minetest.get_modpath("bonemeal") then
minetest.register_alias("ethereal:bone", "bonemeal:bone")
minetest.register_alias("ethereal:bonemeal", "bonemeal:bonemeal")
-else
- dofile(path .. "/bonemeal.lua")
+else -- or return to where it came from
+ minetest.register_alias("ethereal:bone", "default:dirt")
+ minetest.register_alias("ethereal:bonemeal", "default:dirt")
end
if minetest.get_modpath("xanadu") then
@@ -538,13 +538,15 @@ add_node({"ethereal:green_dirt"}, 0.05, {"grassytwo"}, 1, 100, {"farming:carrot_ "farming:raspberry_4", "farming:rhubarb_3", "farming:blueberry_4"}, nil, nil, nil, ethereal.grassytwo)
add_node({"ethereal:green_dirt"}, 0.05, {"grassy"}, 1, 100, {"farming:carrot_7", "farming:cucumber_4",
"farming:potato_3", "farming:tomato_7", "farming:corn_8", "farming:coffee_5",
- "farming:raspberry_4", "farming:rhubarb_3", "farming:blueberry_4"}, nil, nil, nil, ethereal.grassy)
+ "farming:raspberry_4", "farming:rhubarb_3", "farming:blueberry_4",
+ "farming:beetroot_5"}, nil, nil, nil, ethereal.grassy)
add_node({"ethereal:green_dirt"}, 0.05, {"jumble"}, 1, 100, {"farming:carrot_7", "farming:cucumber_4",
"farming:potato_3", "farming:tomato_7", "farming:corn_8", "farming:coffee_5",
"farming:raspberry_4", "farming:rhubarb_3", "farming:blueberry_4"}, nil, nil, nil, ethereal.jumble)
add_node({"ethereal:prairie_dirt"}, 0.05, {"prairie"}, 1, 100, {"farming:carrot_7", "farming:cucumber_4",
"farming:potato_3", "farming:tomato_7", "farming:corn_8", "farming:coffee_5",
- "farming:raspberry_4", "farming:rhubarb_3", "farming:blueberry_4", "farming:pea_5"}, nil, nil, nil, ethereal.prairie)
+ "farming:raspberry_4", "farming:rhubarb_3", "farming:blueberry_4",
+ "farming:pea_5", "farming:beetroot_5"}, nil, nil, nil, ethereal.prairie)
-- melon and pumpkin
add_node({"ethereal:jungle_dirt", "default:dirt_with_rainforest_litter"}, 0.015, {"junglee"}, 1, 1, {"farming:melon_8", "farming:pumpkin_8"}, nil, "default:water_source", 1, ethereal.junglee)
@@ -801,3 +803,14 @@ minetest.register_decoration({ })
end
+
+if ethereal.desert and minetest.get_modpath("wine") then
+minetest.register_decoration({
+ deco_type = "simple",
+ place_on = {"default:desert_sand"},
+ sidelen = 16,
+ fill_ratio = 0.001,
+ biomes = {"desert"},
+ decoration = {"wine:blue_agave"},
+})
+end
diff --git a/textures/bone.png b/textures/bone.png Binary files differdeleted file mode 100644 index d86e7be..0000000 --- a/textures/bone.png +++ /dev/null diff --git a/textures/bonemeal.png b/textures/bonemeal.png Binary files differdeleted file mode 100644 index f141263..0000000 --- a/textures/bonemeal.png +++ /dev/null diff --git a/textures/bonemeal_particle.png b/textures/bonemeal_particle.png Binary files differdeleted file mode 100644 index 71ef90f..0000000 --- a/textures/bonemeal_particle.png +++ /dev/null |