summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root@linux-forks.de>2018-11-14 12:45:10 +0100
committerroot <root@linux-forks.de>2018-11-14 12:45:10 +0100
commit070c5dd08e9652cd540542b860d5a5cce1f8c7d4 (patch)
tree55b8404d46f195a38bb34a470290a9cacd4b75bd
parent31fe2ff374e72fb8ea44d50cd82d6fc8b9be5463 (diff)
parentb29634b3632aebe6c21d035884ed454cfd7ce77a (diff)
Merge branch 'master' of https://notabug.org/TenPlus1/etherealHEADmaster
-rw-r--r--README.md1
-rw-r--r--extra.lua31
-rw-r--r--food.lua8
-rw-r--r--lucky_block.lua4
-rw-r--r--mapgen.lua6
-rw-r--r--plantlife.lua18
-rw-r--r--sapling.lua60
-rw-r--r--stairs.lua6
-rw-r--r--strawberry.lua2
-rw-r--r--wood.lua2
10 files changed, 86 insertions, 52 deletions
diff --git a/README.md b/README.md
index 6d0a07a..25e1a2c 100644
--- a/README.md
+++ b/README.md
@@ -17,6 +17,7 @@ Ethereal Mapgen mod for Minetest (works on all except v6)
- Tweaked mapgen decorations
- Added more lucky blocks
- Added igloo to glacier biome
+ - 2x2 bamboo = bamboo floor, 3x3 bamboo or 2x bamboo floor = bamboo block, blocks can be made into sticks, bamboo stairs need blocks to craft
### 1.24
diff --git a/extra.lua b/extra.lua
index d54a881..51a6c71 100644
--- a/extra.lua
+++ b/extra.lua
@@ -26,6 +26,31 @@ minetest.register_node("ethereal:bamboo_floor", {
minetest.register_craft({
output = "ethereal:bamboo_floor 2",
recipe = {
+ {"ethereal:bamboo", "ethereal:bamboo"},
+ {"ethereal:bamboo", "ethereal:bamboo"},
+ }
+})
+
+minetest.register_craft({
+ output = "ethereal:bamboo_block",
+ recipe = {
+ {"ethereal:bamboo_floor"},
+ {"ethereal:bamboo_floor"},
+ }
+})
+
+-- Bamboo Block
+minetest.register_node("ethereal:bamboo_block", {
+ description = S("Bamboo Block"),
+ tiles = { "bamboo_floor.png" },
+ paramtype = "light",
+ groups = {snappy = 3, choppy = 3 , flammable = 2, wood = 1},
+ sounds = default.node_sound_wood_defaults(),
+})
+
+minetest.register_craft({
+ output = "ethereal:bamboo_block",
+ recipe = {
{"ethereal:bamboo", "ethereal:bamboo", "ethereal:bamboo"},
{"ethereal:bamboo", "ethereal:bamboo", "ethereal:bamboo"},
{"ethereal:bamboo", "ethereal:bamboo", "ethereal:bamboo"},
@@ -207,9 +232,9 @@ minetest.register_node("ethereal:paper_wall", {
minetest.register_craft({
output = "ethereal:paper_wall",
recipe = {
- {"default:stick", "default:paper", "default:stick"},
- {"default:stick", "default:paper", "default:stick"},
- {"default:stick", "default:paper", "default:stick"},
+ {"group:stick", "default:paper", "group:stick"},
+ {"group:stick", "default:paper", "group:stick"},
+ {"group:stick", "default:paper", "group:stick"},
}
})
diff --git a/food.lua b/food.lua
index 156e97f..390f2cd 100644
--- a/food.lua
+++ b/food.lua
@@ -144,7 +144,13 @@ minetest.register_node("ethereal:golden_apple", {
leafdecay = 3,leafdecay_drop = 1
},
drop = "ethereal:golden_apple",
- on_use = minetest.item_eat(20),
+-- on_use = minetest.item_eat(20),
+ on_use = function(itemstack, user, pointed_thing)
+ if user then
+ user:set_hp(20)
+ return minetest.do_item_eat(2, nil, itemstack, user, pointed_thing)
+ end
+ end,
sounds = default.node_sound_leaves_defaults(),
after_place_node = function(pos, placer, itemstack)
if placer:is_player() then
diff --git a/lucky_block.lua b/lucky_block.lua
index 3017b5b..604c8a9 100644
--- a/lucky_block.lua
+++ b/lucky_block.lua
@@ -6,8 +6,8 @@ if minetest.get_modpath("lucky_block") then
local epath = minetest.get_modpath("ethereal") .. "/schematics/"
lucky_block:add_schematics({
- {"pinetree", epath .. "pinetree.mts", {x = 3, y = 0, z = 3}},
- {"palmtree", epath .. "palmtree.mts", {x = 4, y = 0, z = 4}},
+ {"pinetree", ethereal.pinetree, {x = 3, y = 0, z = 3}},
+ {"palmtree", ethereal.palmtree, {x = 4, y = 0, z = 4}},
{"bananatree", ethereal.bananatree, {x = 3, y = 0, z = 3}},
{"orangetree", ethereal.orangetree, {x = 1, y = 0, z = 1}},
{"birchtree", ethereal.birchtree, {x = 2, y = 0, z = 2}},
diff --git a/mapgen.lua b/mapgen.lua
index 6968aa7..269d8a1 100644
--- a/mapgen.lua
+++ b/mapgen.lua
@@ -736,6 +736,8 @@ for _, row in pairs(list) do
end
+local random = math.random
+
-- Generate Illumishroom in caves next to coal
minetest.register_on_generated(function(minp, maxp)
@@ -749,9 +751,9 @@ minetest.register_on_generated(function(minp, maxp)
for n = 1, #coal do
- bpos = {x = coal[n].x, y = coal[n].y + 1, z = coal[n].z }
+ if random(1, 2) == 1 then
- if math.random(1, 2) == 1 then
+ bpos = {x = coal[n].x, y = coal[n].y + 1, z = coal[n].z }
if bpos.y > -3000 and bpos.y < -2000 then
minetest.swap_node(bpos, {name = "ethereal:illumishroom3"})
diff --git a/plantlife.lua b/plantlife.lua
index 2c677ce..ad60fb1 100644
--- a/plantlife.lua
+++ b/plantlife.lua
@@ -233,7 +233,7 @@ minetest.register_node("ethereal:crystalgrass", {
})
-- Define Moss Types (Has grass textures on all sides)
-function ethereal.add_moss(typ, descr, texture, receipe_item)
+local add_moss = function(typ, descr, texture, receipe_item)
minetest.register_node("ethereal:" .. typ .. "_moss", {
description = S(descr .. " Moss"),
@@ -250,11 +250,11 @@ function ethereal.add_moss(typ, descr, texture, receipe_item)
})
end
-ethereal.add_moss( "crystal", "Crystal", "ethereal_grass_crystal_top.png", "ethereal:frost_leaves")
-ethereal.add_moss( "mushroom", "Mushroom", "ethereal_grass_mushroom_top.png", "ethereal:mushroom")
-ethereal.add_moss( "fiery", "Fiery", "ethereal_grass_fiery_top.png", "ethereal:dry_shrub")
-ethereal.add_moss( "gray", "Gray", "ethereal_grass_gray_top.png", "ethereal:snowygrass")
-ethereal.add_moss( "green", "Green", "default_grass.png", "default:jungleleaves")
+add_moss( "crystal", "Crystal", "ethereal_grass_crystal_top.png", "ethereal:frost_leaves")
+add_moss( "mushroom", "Mushroom", "ethereal_grass_mushroom_top.png", "ethereal:mushroom")
+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( "green", "Green", "default_grass.png", "default:jungleleaves")
-- Illuminated Cave Shrooms (Red, Green and Blue)
minetest.register_node("ethereal:illumishroom", {
@@ -267,7 +267,7 @@ minetest.register_node("ethereal:illumishroom", {
light_source = 5,
sunlight_propagates = true,
walkable = false,
- groups = {dig_immediate = 3, attached_node = 1,flammable = 3},
+ groups = {dig_immediate = 3, attached_node = 1, flammable = 3},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
@@ -285,7 +285,7 @@ minetest.register_node("ethereal:illumishroom2", {
light_source = 5,
sunlight_propagates = true,
walkable = false,
- groups = {dig_immediate = 3, attached_node = 1,flammable = 3},
+ groups = {dig_immediate = 3, attached_node = 1, flammable = 3},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
@@ -303,7 +303,7 @@ minetest.register_node("ethereal:illumishroom3", {
light_source = 5,
sunlight_propagates = true,
walkable = false,
- groups = {dig_immediate = 3, attached_node = 1,flammable = 3},
+ groups = {dig_immediate = 3, attached_node = 1, flammable = 3},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
diff --git a/sapling.lua b/sapling.lua
index 1ed8d4b..58fb9fb 100644
--- a/sapling.lua
+++ b/sapling.lua
@@ -25,7 +25,7 @@ minetest.register_node("ethereal:bamboo_sprout", {
})
-- Register Saplings
-ethereal.register_sapling = function(name, desc, texture, height)
+local register_sapling = function(name, desc, texture, height)
minetest.register_node(name .. "_sapling", {
description = S(desc .. " Tree Sapling"),
@@ -50,18 +50,18 @@ ethereal.register_sapling = function(name, desc, texture, height)
})
end
-ethereal.register_sapling("ethereal:willow", "Willow", "willow_sapling", 14)
-ethereal.register_sapling("ethereal:yellow_tree", "Healing", "yellow_tree_sapling", 19)
-ethereal.register_sapling("ethereal:big_tree", "Big", "ethereal_big_tree_sapling", 7)
-ethereal.register_sapling("ethereal:banana_tree", "Banana", "banana_tree_sapling", 8)
-ethereal.register_sapling("ethereal:frost_tree", "Frost", "ethereal_frost_tree_sapling", 19)
-ethereal.register_sapling("ethereal:mushroom", "Mushroom", "ethereal_mushroom_sapling", 11)
-ethereal.register_sapling("ethereal:palm", "Palm", "moretrees_palm_sapling", 9)
-ethereal.register_sapling("ethereal:redwood", "Redwood", "redwood_sapling", 31)
-ethereal.register_sapling("ethereal:orange_tree", "Orange", "orange_tree_sapling", 6)
-ethereal.register_sapling("ethereal:birch", "Birch", "moretrees_birch_sapling", 7)
-
-ethereal.add_tree = function (pos, ofx, ofy, ofz, schem)
+register_sapling("ethereal:willow", "Willow", "willow_sapling", 14)
+register_sapling("ethereal:yellow_tree", "Healing", "yellow_tree_sapling", 19)
+register_sapling("ethereal:big_tree", "Big", "ethereal_big_tree_sapling", 7)
+register_sapling("ethereal:banana_tree", "Banana", "banana_tree_sapling", 8)
+register_sapling("ethereal:frost_tree", "Frost", "ethereal_frost_tree_sapling", 19)
+register_sapling("ethereal:mushroom", "Mushroom", "ethereal_mushroom_sapling", 11)
+register_sapling("ethereal:palm", "Palm", "moretrees_palm_sapling", 9)
+register_sapling("ethereal:redwood", "Redwood", "redwood_sapling", 31)
+register_sapling("ethereal:orange_tree", "Orange", "orange_tree_sapling", 6)
+register_sapling("ethereal:birch", "Birch", "moretrees_birch_sapling", 7)
+
+local add_tree = function (pos, ofx, ofy, ofz, schem)
-- check for schematic
if not schem then
print (S("Schematic not found"))
@@ -74,55 +74,55 @@ ethereal.add_tree = function (pos, ofx, ofy, ofz, schem)
schem, 0, nil, false)
end
-local path = minetest.get_modpath("ethereal").."/schematics/"
+local path = minetest.get_modpath("ethereal") .. "/schematics/"
-- grow tree functions
function ethereal.grow_yellow_tree(pos)
- ethereal.add_tree(pos, 4, 0, 4, ethereal.yellowtree)
+ add_tree(pos, 4, 0, 4, ethereal.yellowtree)
end
function ethereal.grow_big_tree(pos)
- ethereal.add_tree(pos, 4, 0, 4, ethereal.bigtree)
+ add_tree(pos, 4, 0, 4, ethereal.bigtree)
end
function ethereal.grow_banana_tree(pos)
- ethereal.add_tree(pos, 3, 0, 3, ethereal.bananatree)
+ add_tree(pos, 3, 0, 3, ethereal.bananatree)
end
function ethereal.grow_frost_tree(pos)
- ethereal.add_tree(pos, 4, 0, 4, ethereal.frosttrees)
+ add_tree(pos, 4, 0, 4, ethereal.frosttrees)
end
function ethereal.grow_mushroom_tree(pos)
- ethereal.add_tree(pos, 4, 0, 4, ethereal.mushroomone)
+ add_tree(pos, 4, 0, 4, ethereal.mushroomone)
end
function ethereal.grow_palm_tree(pos)
- ethereal.add_tree(pos, 4, 0, 4, ethereal.palmtree)
+ add_tree(pos, 4, 0, 4, ethereal.palmtree)
end
function ethereal.grow_willow_tree(pos)
- ethereal.add_tree(pos, 5, 0, 5, ethereal.willow)
+ add_tree(pos, 5, 0, 5, ethereal.willow)
end
function ethereal.grow_redwood_tree(pos)
- ethereal.add_tree(pos, 7, 0, 7, ethereal.redwood_tree)
+ add_tree(pos, 7, 0, 7, ethereal.redwood_tree)
end
function ethereal.grow_orange_tree(pos)
- ethereal.add_tree(pos, 1, 0, 1, ethereal.orangetree)
+ add_tree(pos, 1, 0, 1, ethereal.orangetree)
end
function ethereal.grow_bamboo_tree(pos)
- ethereal.add_tree(pos, 1, 0, 1, ethereal.bambootree)
+ add_tree(pos, 1, 0, 1, ethereal.bambootree)
end
function ethereal.grow_birch_tree(pos)
- ethereal.add_tree(pos, 2, 0, 2, ethereal.birchtree)
+ add_tree(pos, 2, 0, 2, ethereal.birchtree)
end
-- 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(
{x = pos.x, y = pos.y + 1, z = pos.z},
@@ -135,7 +135,7 @@ local function enough_height(pos, height)
end
end
-ethereal.grow_sapling = function (pos, node)
+local grow_sapling = function(pos, node)
local under = minetest.get_node({
x = pos.x,
@@ -211,12 +211,12 @@ minetest.register_abm({
catch_up = false,
action = function(pos, node)
- local light_level = minetest.get_node_light(pos)
+ local light_level = minetest.get_node_light(pos) or 0
- if not light_level or light_level < 13 then
+ if light_level < 13 then
return
end
- ethereal.grow_sapling(pos, node)
+ grow_sapling(pos, node)
end,
})
diff --git a/stairs.lua b/stairs.lua
index 94de7b7..0117abc 100644
--- a/stairs.lua
+++ b/stairs.lua
@@ -98,7 +98,7 @@ stairs.register_all("redwood_wood", "ethereal:redwood_wood",
S("Redwood Slab"),
default.node_sound_wood_defaults())
-stairs.register_all("bamboo_wood", "ethereal:bamboo_floor",
+stairs.register_all("bamboo_wood", "ethereal:bamboo_block",
{snappy = 3, choppy = 2, oddly_breakable_by_hand = 1, flammable = 3},
{"bamboo_floor.png"},
S("Bamboo stair"),
@@ -202,7 +202,7 @@ stairsplus:register_all("ethereal", "redwood_wood", "ethereal:redwood_wood", {
sounds = default.node_sound_wood_defaults(),
})
-stairsplus:register_all("ethereal", "bamboo_wood", "ethereal:bamboo_floor", {
+stairsplus:register_all("ethereal", "bamboo_wood", "ethereal:bamboo_block", {
description = S("Bamboo"),
tiles = {"bamboo_floor.png"},
groups = {snappy = 3, choppy = 2, oddly_breakable_by_hand = 1, flammable = 3},
@@ -307,7 +307,7 @@ stairs.register_stair_and_slab("redwood_wood", "ethereal:redwood_wood",
S("Redwood Slab"),
default.node_sound_wood_defaults())
-stairs.register_stair_and_slab("bamboo_wood", "ethereal:bamboo_floor",
+stairs.register_stair_and_slab("bamboo_wood", "ethereal:bamboo_block",
{snappy = 3, choppy = 2, oddly_breakable_by_hand = 1, flammable = 3},
{"bamboo_floor.png"},
S("Bamboo stair"),
diff --git a/strawberry.lua b/strawberry.lua
index 8098ca3..3fe3fa7 100644
--- a/strawberry.lua
+++ b/strawberry.lua
@@ -28,7 +28,7 @@ local crop_def = {
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}
},
groups = {
- snappy = 3, flammable =2, plant = 1, attached_node = 1,
+ snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
diff --git a/wood.lua b/wood.lua
index 3e63846..63d729a 100644
--- a/wood.lua
+++ b/wood.lua
@@ -248,7 +248,7 @@ minetest.register_node("ethereal:bamboo", {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
},
- groups = {choppy = 3, oddly_breakable_by_hand = 1, flammable = 2, tree = 1},
+ groups = {choppy = 3, oddly_breakable_by_hand = 1, flammable = 2},--tree = 1
sounds = default.node_sound_leaves_defaults(),
after_dig_node = function(pos, node, metadata, digger)
default.dig_up(pos, node, digger)