diff --git a/mods/ctf/ctf_map/maps b/mods/ctf/ctf_map/maps index 9e25819..99bac96 160000 --- a/mods/ctf/ctf_map/maps +++ b/mods/ctf/ctf_map/maps @@ -1 +1 @@ -Subproject commit 9e2581925aed31e5572507a0aba8120c18f41fa0 +Subproject commit 99bac967d656014ee44201936e4c1884a21f3ada diff --git a/mods/mtg/default/README.txt b/mods/mtg/default/README.txt index 8af65a9..f40ac54 100644 --- a/mods/mtg/default/README.txt +++ b/mods/mtg/default/README.txt @@ -4,14 +4,20 @@ See license.txt for license information. Authors of source code ---------------------- -Originally by celeron55, Perttu Ahola (LGPL 2.1) -Various Minetest developers and contributors (LGPL 2.1) +Originally by celeron55, Perttu Ahola (LGPLv2.1+) +Various Minetest developers and contributors (LGPLv2.1+) -Authors of media (textures, models and sounds) ----------------------------------------------- +The torch code was derived by sofar from the 'torches' mod by +BlockMen (LGPLv2.1+) + +Authors of media (textures, sounds, models and schematics) +---------------------------------------------------------- Everything not listed in here: celeron55, Perttu Ahola (CC BY-SA 3.0) + +Textures +-------- Cisoun's texture pack (CC BY-SA 3.0): default_jungletree.png default_lava.png @@ -23,25 +29,15 @@ Cisoun's texture pack (CC BY-SA 3.0): default_tree_top.png default_water.png -Cisoun's conifers mod (CC BY-SA 3.0): - default_pine_needles.png - -Originating from G4JC's Almost MC Texture Pack (CC BY-SA 3.0): - default_torch.png - default_torch_on_ceiling.png - default_torch_on_floor.png - -VanessaE's animated torches (CC BY-SA 3.0): - default_torch_animated.png - default_torch_on_ceiling_animated.png - default_torch_on_floor_animated.png - default_torch_on_floor.png - RealBadAngel's animated water (CC BY-SA 3.0): default_water_source_animated.png default_water_flowing_animated.png VanessaE (CC BY-SA 3.0): + default_torch_animated.png + default_torch_on_ceiling_animated.png + default_torch_on_floor_animated.png + default_torch_on_floor.png default_desert_sand.png default_desert_stone.png default_sand.png @@ -52,13 +48,6 @@ Calinou (CC BY-SA 3.0): default_brick.png default_papyrus.png default_mineral_copper.png - default_glass_detail.png - -MirceaKitsune (CC BY-SA 3.0): - character.x - -Jordach (CC BY-SA 3.0): - character.png PilzAdam (CC BY-SA 3.0): default_jungleleaves.png @@ -75,6 +64,7 @@ InfinityProject (CC BY-SA 3.0): Splizard (CC BY-SA 3.0): default_pine_sapling.png + default_pine_needles.png Zeg9 (CC BY-SA 3.0): default_coal_block.png @@ -88,11 +78,13 @@ paramat (CC BY-SA 3.0): default_acacia_leaves_simple.png default_acacia_sapling.png default_acacia_bush_sapling.png + default_pine_bush_sapling.png default_acacia_tree.png default_acacia_tree_top.png default_acacia_wood.png default_acacia_bush_stem.png default_bush_stem.png + default_pine_bush_stem.png default_junglewood.png default_jungletree_top.png default_sandstone_brick.png @@ -119,9 +111,23 @@ paramat (CC BY-SA 3.0): default_silver_sandstone.png -- Derived from a texture by GreenXenith (CC-BY-SA 3.0) default_silver_sandstone_brick.png -- Derived from a texture by GreenXenith (CC-BY-SA 3.0) default_silver_sandstone_block.png -- Derived from a texture by GreenXenith (CC-BY-SA 3.0) + default_bookshelf_slot.png -- Derived from a texture by Gambit (CC-BY-SA 3.0) + default_marram_grass_*.png -- Derived from textures by TumeniNodes (CC-BY-SA 3.0) + default_emergent_jungle_sapling.png + default_permafrost.png -- Derived from a texture by Neuromancer (CC BY-SA 3.0) + default_stones.png -- Derived from a texture by sofar (CC0 1.0) + default_moss.png + default_moss_side.png + default_fence_rail_acacia_wood + default_fence_rail_aspen_wood -- Derived from a texture by sofar (CC BY-SA 3.0) + default_fence_rail_junglewood + default_fence_rail_pine_wood + default_fence_rail_wood -- Derived from a texture by BlockMen (CC BY-SA 3.0) -brunob.santos (CC BY-SA 4.0): - default_desert_cobble.png +TumeniNodes (CC BY-SA 3.0): + default_desert_cobble.png -- Derived from a texture by brunob.santos (CC BY-SA 3.0) + default_coniferous_litter.png + default_coniferous_litter_side.png BlockMen (CC BY-SA 3.0): default_aspen_leaves.png -- Derived from Sofar's texture @@ -131,7 +137,6 @@ BlockMen (CC BY-SA 3.0): default_gold_ingot.png default_tool_steelsword.png default_diamond.png - default_book.png default_tool_*.png default_lava_source_animated.png default_lava_flowing_animated.png @@ -145,26 +150,19 @@ BlockMen (CC BY-SA 3.0): bubble.png gui_*.png -Wuzzy (CC BY-SA 3.0): - default_bookshelf_slot.png (based on default_book.png) - sofar (CC BY-SA 3.0): - default_book_written.png, based on default_book.png default_aspen_sapling default_aspen_tree default_aspen_tree_top, derived from default_pine_tree_top (by paramat) default_aspen_wood, derived from default_pine_wood (by paramat) default_chest_inside -sofar (WTFPL): +sofar (CC0 1.0): default_gravel.png -- Derived from Gambit's PixelBOX texture pack light gravel -Neuromancer (CC BY-SA 2.0): +Neuromancer (CC BY-SA 3.0): default_cobble.png, based on texture by Brane praefect default_mossycobble.png, based on texture by Brane praefect - -Neuromancer (CC BY-SA 3.0): - default_dirt.png default_furnace_*.png Gambit (CC BY-SA 3.0): @@ -186,11 +184,12 @@ Gambit (CC BY-SA 3.0): default_snowball.png default_key.png default_key_skeleton.png + default_book.png asl97 (CC BY-SA 3.0): default_ice.png -KevDoy (CC BY-SA 3.0) +KevDoy (CC BY-SA 3.0): heart.png Pithydon (CC BY-SA 3.0) @@ -198,11 +197,10 @@ Pithydon (CC BY-SA 3.0) default_coral_orange.png default_coral_skeleton.png -Ferk (CC0 1.0) +Ferk (CC0 1.0): default_item_smoke.png - default_item_smoke.ogg, based on sound by http://opengameart.org/users/bart -npx (CC BY-SA 3.0) +npx (CC BY-SA 3.0): default_rainforest_litter.png default_rainforest_litter_side.png @@ -221,15 +219,42 @@ kilbith (CC BY-SA 3.0): default_tin_ingot.png default_tin_lump.png +tobyplowy (CC BY-SA 3.0): + default_kelp.png + +CloudyProton (CC BY-SA 3.0): + default_book_written.png, based on default_book.png by Gambit + +Mossmanikin (CC BY-SA 3.0): + default_fern_*.png + +random-geek (CC BY-SA 3.0): + default_blueberries.png + default_blueberry_overlay.png + default_blueberry_bush_leaves.png, derived from default_bush_leaves (by paramat) + default_blueberry_bush_sapling.png + default_dirt.png -- Derived from a texture by Neuromancer (CC BY-SA 3.0) + +Krock (CC0 1.0): + default_glass.png + default_glass_detail.png + +Topywo (CC BY-SA 3.0) + default_coral_cyan.png + default_coral_green.png + default_coral_pink.png + +Extex101 (CC BY-SA 3.0) + default_large_cactus_seedling.png + + +Sounds +------ Glass breaking sounds (CC BY 3.0): 1: http://www.freesound.org/people/cmusounddesign/sounds/71947/ 2: http://www.freesound.org/people/Tomlija/sounds/97669/ 3: http://www.freesound.org/people/lsprice/sounds/88808/ -sonictechtonic (CC BY 3.0): -https://www.freesound.org/people/sonictechtonic/sounds/241872/ - player_damage.ogg - Mito551 (sounds) (CC BY-SA 3.0): default_dig_choppy.ogg default_dig_cracky.ogg @@ -252,8 +277,6 @@ Mito551 (sounds) (CC BY-SA 3.0): default_place_node.3.ogg default_place_node_hard.1.ogg default_place_node_hard.2.ogg - default_snow_footstep.1.ogg - default_snow_footstep.2.ogg default_hard_footstep.1.ogg default_hard_footstep.2.ogg default_hard_footstep.3.ogg @@ -278,14 +301,14 @@ Metal sounds: Tool breaking sounds added by sofar: CC-BY-3.0 default_tool_breaks.* - http://www.freesound.org/people/HerbertBoland/sounds/33206/ -AGFX (CC BY 3.0) +AGFX (CC BY 3.0): https://www.freesound.org/people/AGFX/packs/1253/ default_water_footstep.1.ogg default_water_footstep.2.ogg default_water_footstep.3.ogg (default_water_footstep.4.ogg is silent) -blukotek (CC0 1.0) +blukotek (CC0 1.0): https://www.freesound.org/people/blukotek/sounds/251660/ default_dig_snappy.ogg @@ -298,3 +321,59 @@ Chests sounds added by sofar, derived of several files mixed together: - http://www.freesound.org/people/bulbastre/sounds/126887/ CC-BY-3.0 - http://www.freesound.org/people/Yoyodaman234/sounds/183541/ CC0 +Ryding (CC0 1.0): +http://freesound.org/people/Ryding/sounds/94337/ + default_snow_footstep.*.ogg + +Ferk (CC0 1.0): + default_item_smoke.ogg, based on a sound by http://opengameart.org/users/bart + + +Models +------ +sofar (CC BY-SA 3.0): + chest_open.obj + torch_ceiling.obj + torch_floor.obj + torch_wall.obj + + +Schematics +---------- +paramat (CC BY-SA 3.0): + acacia_bush.mts + acacia_tree.mts + acacia_tree_from_sapling.mts + apple_tree.mts + apple_tree_from_sapling.mts + aspen_tree.mts + aspen_tree_from_sapling.mts + bush.mts + emergent_jungle_tree.mts + emergent_jungle_tree_from_sapling.mts + jungle_tree.mts + jungle_tree_from_sapling.mts + large_cactus.mts + papyrus.mts + pine_tree.mts + pine_tree_from_sapling.mts + snowy_pine_tree_from_sapling.mts + small_pine_tree.mts + small_pine_tree_from_sapling.mts + snowy_small_pine_tree_from_sapling.mts + +Shara RedCat (CC BY-SA 3.0): + acacia_log.mts + apple_log.mts + aspen_log.mts + jungle_log.mts + pine_log.mts + +sofar (CC BY-SA 3.0): + corals.mts + +TumeniNodes (CC BY-SA 3.0): + pine_bush.mts + +random-geek (CC BY-SA 3.0): + blueberry_bush.mts diff --git a/mods/mtg/default/crafting.lua b/mods/mtg/default/crafting.lua index 6e8ff41..e42bb77 100644 --- a/mods/mtg/default/crafting.lua +++ b/mods/mtg/default/crafting.lua @@ -1,5 +1,16 @@ -- mods/default/crafting.lua + +-- +-- Crafting (tool repair) +-- + +minetest.register_craft({ + type = "toolrepair", + additional_wear = -0.02, +}) + + -- -- Cooking recipes -- @@ -10,6 +21,12 @@ minetest.register_craft({ recipe = "group:sand", }) +minetest.register_craft({ + type = "cooking", + output = "default:obsidian_glass", + recipe = "default:obsidian_shard", +}) + minetest.register_craft({ type = "cooking", output = "default:stone", @@ -46,17 +63,38 @@ minetest.register_craft({ recipe = "default:tin_lump", }) +minetest.register_craft({ + type = "cooking", + output = "default:gold_ingot", + recipe = "default:gold_lump", +}) + minetest.register_craft({ type = "cooking", output = "default:clay_brick", recipe = "default:clay_lump", }) +minetest.register_craft({ + type = 'cooking', + output = 'default:gold_ingot', + recipe = 'default:skeleton_key', + cooktime = 5, +}) + +minetest.register_craft({ + type = 'cooking', + output = 'default:gold_ingot', + recipe = 'default:key', + cooktime = 5, +}) + + -- -- Fuels -- --- Support use of group:tree +-- Support use of group:tree, includes default:tree which has the same burn time minetest.register_craft({ type = "fuel", recipe = "group:tree", @@ -79,12 +117,6 @@ minetest.register_craft({ burntime = 26, }) -minetest.register_craft({ - type = "fuel", - recipe = "default:tree", - burntime = 30, -}) - minetest.register_craft({ type = "fuel", recipe = "default:acacia_tree", @@ -98,7 +130,7 @@ minetest.register_craft({ }) --- Support use of group:wood +-- Support use of group:wood, includes default:wood which has the same burn time minetest.register_craft({ type = "fuel", recipe = "group:wood", @@ -117,12 +149,6 @@ minetest.register_craft({ burntime = 6, }) -minetest.register_craft({ - type = "fuel", - recipe = "default:wood", - burntime = 7, -}) - minetest.register_craft({ type = "fuel", recipe = "default:acacia_wood", @@ -136,53 +162,59 @@ minetest.register_craft({ }) --- Support use of group:sapling +-- Support use of group:sapling, includes default:sapling which has the same burn time minetest.register_craft({ type = "fuel", recipe = "group:sapling", - burntime = 10, + burntime = 5, }) minetest.register_craft({ type = "fuel", recipe = "default:bush_sapling", - burntime = 6, + burntime = 3, }) minetest.register_craft({ type = "fuel", recipe = "default:acacia_bush_sapling", - burntime = 7, + burntime = 4, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:pine_bush_sapling", + burntime = 2, }) minetest.register_craft({ type = "fuel", recipe = "default:aspen_sapling", - burntime = 8, + burntime = 4, }) minetest.register_craft({ type = "fuel", recipe = "default:pine_sapling", - burntime = 9, -}) - -minetest.register_craft({ - type = "fuel", - recipe = "default:sapling", - burntime = 10, + burntime = 5, }) minetest.register_craft({ type = "fuel", recipe = "default:acacia_sapling", - burntime = 11, + burntime = 6, }) minetest.register_craft({ type = "fuel", recipe = "default:junglesapling", - burntime = 12, + burntime = 6, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:emergent_jungle_sapling", + burntime = 7, }) @@ -217,6 +249,37 @@ minetest.register_craft({ }) +minetest.register_craft({ + type = "fuel", + recipe = "default:fence_rail_aspen_wood", + burntime = 3, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:fence_rail_pine_wood", + burntime = 4, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:fence_rail_wood", + burntime = 5, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:fence_rail_acacia_wood", + burntime = 6, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:fence_rail_junglewood", + burntime = 7, +}) + + minetest.register_craft({ type = "fuel", recipe = "default:bush_stem", @@ -229,16 +292,22 @@ minetest.register_craft({ burntime = 8, }) +minetest.register_craft({ + type = "fuel", + recipe = "default:pine_bush_stem", + burntime = 6, +}) + minetest.register_craft({ type = "fuel", recipe = "default:junglegrass", - burntime = 2, + burntime = 3, }) minetest.register_craft({ type = "fuel", recipe = "group:leaves", - burntime = 1, + burntime = 4, }) minetest.register_craft({ @@ -247,10 +316,16 @@ minetest.register_craft({ burntime = 15, }) +minetest.register_craft({ + type = "fuel", + recipe = "default:large_cactus_seedling", + burntime = 5, +}) + minetest.register_craft({ type = "fuel", recipe = "default:papyrus", - burntime = 1, + burntime = 3, }) minetest.register_craft({ @@ -262,7 +337,7 @@ minetest.register_craft({ minetest.register_craft({ type = "fuel", recipe = "default:ladder_wood", - burntime = 2, + burntime = 7, }) minetest.register_craft({ @@ -295,12 +370,6 @@ minetest.register_craft({ burntime = 30, }) -minetest.register_craft({ - type = "fuel", - recipe = "default:apple", - burntime = 3, -}) - minetest.register_craft({ type = "fuel", recipe = "default:coal_lump", @@ -325,6 +394,36 @@ minetest.register_craft({ burntime = 2, }) +minetest.register_craft({ + type = "fuel", + recipe = "default:fern_1", + burntime = 2, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:marram_grass_1", + burntime = 2, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:paper", + burntime = 1, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:book", + burntime = 3, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:book_written", + burntime = 3, +}) + minetest.register_craft({ type = "fuel", recipe = "default:dry_shrub", diff --git a/mods/mtg/default/craftitems.lua b/mods/mtg/default/craftitems.lua index c8e5b85..ed25655 100644 --- a/mods/mtg/default/craftitems.lua +++ b/mods/mtg/default/craftitems.lua @@ -32,6 +32,11 @@ minetest.register_craftitem("default:mese_crystal", { inventory_image = "default_mese_crystal.png", }) +minetest.register_craftitem("default:gold_lump", { + description = "Gold Lump", + inventory_image = "default_gold_lump.png", +}) + minetest.register_craftitem("default:diamond", { description = "Diamond", inventory_image = "default_diamond.png", @@ -62,6 +67,11 @@ minetest.register_craftitem("default:bronze_ingot", { inventory_image = "default_bronze_ingot.png", }) +minetest.register_craftitem("default:gold_ingot", { + description = "Gold Ingot", + inventory_image = "default_gold_ingot.png" +}) + minetest.register_craftitem("default:mese_crystal_fragment", { description = "Mese Crystal Fragment", inventory_image = "default_mese_crystal_fragment.png", @@ -71,3 +81,13 @@ minetest.register_craftitem("default:clay_brick", { description = "Clay Brick", inventory_image = "default_clay_brick.png", }) + +minetest.register_craftitem("default:obsidian_shard", { + description = "Obsidian Shard", + inventory_image = "default_obsidian_shard.png", +}) + +minetest.register_craftitem("default:flint", { + description = "Flint", + inventory_image = "default_flint.png" +}) diff --git a/mods/mtg/default/depends.txt b/mods/mtg/default/depends.txt new file mode 100644 index 0000000..e1c3818 --- /dev/null +++ b/mods/mtg/default/depends.txt @@ -0,0 +1 @@ +player_api? diff --git a/mods/mtg/default/functions.lua b/mods/mtg/default/functions.lua index 28a20a3..6aef656 100644 --- a/mods/mtg/default/functions.lua +++ b/mods/mtg/default/functions.lua @@ -1,5 +1,3 @@ --- mods/default/functions.lua - -- -- Sounds -- @@ -117,30 +115,38 @@ function default.node_sound_water_defaults(table) return table end +function default.node_sound_snow_defaults(table) + table = table or {} + table.footstep = table.footstep or + {name = "default_snow_footstep", gain = 0.2} + table.dig = table.dig or + {name = "default_snow_footstep", gain = 0.3} + table.dug = table.dug or + {name = "default_snow_footstep", gain = 0.3} + table.place = table.place or + {name = "default_place_node", gain = 1.0} + default.node_sound_defaults(table) + return table +end + + -- -- Lavacooling -- default.cool_lava = function(pos, node) - minetest.set_node(pos, {name = "default:stone"}) + if node.name == "default:lava_source" then + minetest.set_node(pos, {name = "default:obsidian"}) + else -- Lava flowing + minetest.set_node(pos, {name = "default:stone"}) + end minetest.sound_play("default_cool_lava", {pos = pos, max_hear_distance = 16, gain = 0.25}) end -if minetest.settings:get_bool("enable_lavacooling") ~= false then - minetest.register_abm({ - label = "Lava cooling", - nodenames = {"default:lava_source", "default:lava_flowing"}, - neighbors = {"group:cools_lava", "group:water"}, - interval = 1, - chance = 2, - catch_up = false, - action = default.cool_lava, - }) -end -- --- optimized helper to put all items in an inventory into a drops list +-- Optimized helper to put all items in an inventory into a drops list -- function default.get_inventory_drops(pos, inventory, drops) @@ -155,11 +161,12 @@ function default.get_inventory_drops(pos, inventory, drops) end end + -- -- Papyrus and cactus growing -- --- wrapping the functions in abm action is necessary to make overriding them possible +-- Wrapping the functions in ABM action is necessary to make overriding them possible function default.grow_cactus(pos, node) if node.param2 >= 4 then @@ -213,7 +220,7 @@ function default.grow_papyrus(pos, node) end -- --- dig upwards +-- Dig upwards -- function default.dig_up(pos, node, digger) @@ -259,7 +266,7 @@ function default.register_fence(name, def) connect_right = {{1/8,3/16,-1/16,1/2,5/16,1/16}, {1/8,-5/16,-1/16,1/2,-3/16,1/16}}, }, - connects_to = {"group:fence", "group:wood", "group:tree"}, + connects_to = {"group:fence", "group:wood", "group:tree", "group:wall"}, inventory_image = fence_texture, wield_image = fence_texture, tiles = {def.texture}, @@ -268,7 +275,72 @@ function default.register_fence(name, def) groups = {}, } for k, v in pairs(default_fields) do - if not def[k] then + if def[k] == nil then + def[k] = v + end + end + + -- Always add to the fence group, even if no group provided + def.groups.fence = 1 + + def.texture = nil + def.material = nil + + minetest.register_node(name, def) +end + + +-- +-- Fence rail registration helper +-- + +function default.register_fence_rail(name, def) + minetest.register_craft({ + output = name .. " 16", + recipe = { + { def.material, def.material }, + { "", ""}, + { def.material, def.material }, + } + }) + + local fence_rail_texture = "default_fence_rail_overlay.png^" .. def.texture .. + "^default_fence_rail_overlay.png^[makealpha:255,126,126" + -- Allow almost everything to be overridden + local default_fields = { + paramtype = "light", + drawtype = "nodebox", + node_box = { + type = "connected", + fixed = { + {-1/16, 3/16, -1/16, 1/16, 5/16, 1/16}, + {-1/16, -3/16, -1/16, 1/16, -5/16, 1/16} + }, + -- connect_top = + -- connect_bottom = + connect_front = { + {-1/16, 3/16, -1/2, 1/16, 5/16, -1/16}, + {-1/16, -5/16, -1/2, 1/16, -3/16, -1/16}}, + connect_left = { + {-1/2, 3/16, -1/16, -1/16, 5/16, 1/16}, + {-1/2, -5/16, -1/16, -1/16, -3/16, 1/16}}, + connect_back = { + {-1/16, 3/16, 1/16, 1/16, 5/16, 1/2}, + {-1/16, -5/16, 1/16, 1/16, -3/16, 1/2}}, + connect_right = { + {1/16, 3/16, -1/16, 1/2, 5/16, 1/16}, + {1/16, -5/16, -1/16, 1/2, -3/16, 1/16}}, + }, + connects_to = {"group:fence", "group:wall"}, + inventory_image = fence_rail_texture, + wield_image = fence_rail_texture, + tiles = {def.texture}, + sunlight_propagates = true, + is_ground_content = false, + groups = {}, + } + for k, v in pairs(default_fields) do + if def[k] == nil then def[k] = v end end @@ -290,7 +362,7 @@ end -- Prevent decay of placed leaves default.after_place_leaves = function(pos, placer, itemstack, pointed_thing) - if placer and not placer:get_player_control().sneak then + if placer and placer:is_player() and not placer:get_player_control().sneak then local node = minetest.get_node(pos) node.param2 = 1 minetest.set_node(pos, node) @@ -358,52 +430,7 @@ function default.register_leafdecay(def) end -- --- Convert dirt to something that fits the environment --- --- SNIP - --- --- Checks if specified volume intersects a protected volume --- - -function default.intersects_protection(minp, maxp, player_name, interval) - -- 'interval' is the largest allowed interval for the 3D lattice of checks - - -- Compute the optimal float step 'd' for each axis so that all corners and - -- borders are checked. 'd' will be smaller or equal to 'interval'. - -- Subtracting 1e-4 ensures that the max co-ordinate will be reached by the - -- for loop (which might otherwise not be the case due to rounding errors). - local d = {} - for _, c in pairs({"x", "y", "z"}) do - if maxp[c] > minp[c] then - d[c] = (maxp[c] - minp[c]) / math.ceil((maxp[c] - minp[c]) / interval) - 1e-4 - elseif maxp[c] == minp[c] then - d[c] = 1 -- Any value larger than 0 to avoid division by zero - else -- maxp[c] < minp[c], print error and treat as protection intersected - minetest.log("error", "maxp < minp in 'default.intersects_protection()'") - return true - end - end - - for zf = minp.z, maxp.z, d.z do - local z = math.floor(zf + 0.5) - for yf = minp.y, maxp.y, d.y do - local y = math.floor(yf + 0.5) - for xf = minp.x, maxp.x, d.x do - local x = math.floor(xf + 0.5) - if minetest.is_protected({x = x, y = y, z = z}, player_name) then - return true - end - end - end - end - - return false -end - - --- --- NOTICE: This method is not an official part of the API yet! +-- NOTICE: This method is not an official part of the API yet. -- This method may change in future. -- @@ -423,7 +450,7 @@ function default.can_interact_with_node(player, pos) return true end - -- is player wielding the right key? + -- Is player wielding the right key? local item = player:get_wielded_item() if item:get_name() == "default:key" then local key_meta = item:get_meta() diff --git a/mods/mtg/default/init.lua b/mods/mtg/default/init.lua index 3cf467e..03467b8 100644 --- a/mods/mtg/default/init.lua +++ b/mods/mtg/default/init.lua @@ -9,9 +9,12 @@ default = {} default.LIGHT_MAX = 14 -- GUI related stuff -default.gui_bg = "bgcolor[#080808BB;true]" -default.gui_bg_img = "background[5,5;1,1;gui_formbg.png;true]" -default.gui_slots = "listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]" +minetest.register_on_joinplayer(function(player) + player:set_formspec_prepend([[ + bgcolor[#080808BB;true] + background[5,5;1,1;gui_formbg.png;true] + listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF] ]]) +end) function default.get_hotbar_bg(x,y) local out = "" @@ -22,9 +25,6 @@ function default.get_hotbar_bg(x,y) end default.gui_survival_form = "size[8,8.5]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. "list[current_player;main;0,4.25;8,1;]".. "list[current_player;main;0,5.5;8,3;8]".. "list[current_player;craft;1.75,0.5;3,3;]".. @@ -46,6 +46,5 @@ dofile(default_path.."/item_entity.lua") dofile(default_path.."/craftitems.lua") dofile(default_path.."/crafting.lua") dofile(default_path.."/mapgen.lua") -dofile(default_path.."/player.lua") dofile(default_path.."/aliases.lua") dofile(default_path.."/legacy.lua") diff --git a/mods/mtg/default/item_entity.lua b/mods/mtg/default/item_entity.lua index c34e60e..2a61f08 100644 --- a/mods/mtg/default/item_entity.lua +++ b/mods/mtg/default/item_entity.lua @@ -16,7 +16,7 @@ local item = { burn_up = function(self) -- disappear in a smoke puff self.object:remove() - local p = self.object:getpos() + local p = self.object:get_pos() minetest.sound_play("default_item_smoke", { pos = p, max_hear_distance = 8, @@ -48,7 +48,7 @@ local item = { if self.ignite_timer > 10 then self.ignite_timer = 0 - local node = minetest.get_node_or_nil(self.object:getpos()) + local node = minetest.get_node_or_nil(self.object:get_pos()) if not node then return end diff --git a/mods/mtg/default/legacy.lua b/mods/mtg/default/legacy.lua index a648a78..dee4ee3 100644 --- a/mods/mtg/default/legacy.lua +++ b/mods/mtg/default/legacy.lua @@ -7,12 +7,12 @@ function default.register_falling_node(nodename, texture) minetest.log("error", debug.traceback()) minetest.log('error', "WARNING: default.register_falling_node is deprecated") if minetest.registered_nodes[nodename] then - -- minetest.registered_nodes[nodename].groups.falling_node = 1 + minetest.registered_nodes[nodename].groups.falling_node = 1 end end function default.spawn_falling_node(p, nodename) - -- spawn_falling_node(p, nodename) + spawn_falling_node(p, nodename) end -- Liquids @@ -23,3 +23,24 @@ LIGHT_MAX = default.LIGHT_MAX -- Formspecs default.gui_suvival_form = default.gui_survival_form +default.gui_bg = "" +default.gui_bg_img = "" +default.gui_slots = "" + +-- Players +if minetest.get_modpath("player_api") then + default.registered_player_models = player_api.registered_models + default.player_register_model = player_api.register_model + default.player_attached = player_api.player_attached + default.player_get_animation = player_api.get_animation + default.player_set_model = player_api.set_model + default.player_set_textures = player_api.set_textures + default.player_set_animation = player_api.set_animation +end + +-- Check for a volume intersecting protection +function default.intersects_protection(minp, maxp, player_name, interval) + minetest.log("warning", "default.intersects_protection() is " .. + "deprecated, use minetest.is_area_protected() instead.") + minetest.is_area_protected(minp, maxp, player_name, interval) +end diff --git a/mods/mtg/default/license.txt b/mods/mtg/default/license.txt index 72af728..fecb1eb 100644 --- a/mods/mtg/default/license.txt +++ b/mods/mtg/default/license.txt @@ -2,8 +2,8 @@ License of source code ---------------------- GNU Lesser General Public License, version 2.1 -Copyright (C) 2011-2016 celeron55, Perttu Ahola -Copyright (C) 2011-2016 Various Minetest developers and contributors +Copyright (C) 2011-2018 celeron55, Perttu Ahola +Copyright (C) 2011-2018 Various Minetest developers and contributors This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; @@ -19,7 +19,8 @@ Licenses of media (textures, models and sounds) ----------------------------------------------- Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) -Copyright (C) 2010-2016: +Copyright (C) 2010-2018: + celeron55, Perttu Ahola Cisoun G4JC @@ -44,6 +45,12 @@ Copyright (C) 2010-2016: GreenXenith kaeza kilbith + tobyplowy + CloudyProton + TumeniNodes + Mossmanikin + random-geek + Extex101 You are free to: Share — copy and redistribute the material in any medium or format. @@ -75,74 +82,8 @@ http://creativecommons.org/licenses/by-sa/3.0/ ----------------------- -Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) -Copyright (C) 2014-2016 brunob.santos - -You are free to: -Share — copy and redistribute the material in any medium or format. -Adapt — remix, transform, and build upon the material for any purpose, even commercially. -The licensor cannot revoke these freedoms as long as you follow the license terms. - -Under the following terms: - -Attribution — You must give appropriate credit, provide a link to the license, and -indicate if changes were made. You may do so in any reasonable manner, but not in any way -that suggests the licensor endorses you or your use. - -ShareAlike — If you remix, transform, or build upon the material, you must distribute -your contributions under the same license as the original. - -No additional restrictions — You may not apply legal terms or technological measures that -legally restrict others from doing anything the license permits. - -Notices: - -You do not have to comply with the license for elements of the material in the public -domain or where your use is permitted by an applicable exception or limitation. -No warranties are given. The license may not give you all of the permissions necessary -for your intended use. For example, other rights such as publicity, privacy, or moral -rights may limit how you use the material. - -For more details: -http://creativecommons.org/licenses/by-sa/4.0/ - ------------------------ - -Attribution-ShareAlike 2.0 Generic (CC BY-SA 2.0) -Copyright (C) 2014-2016 Neuromancer - - -You are free to: -Share — copy and redistribute the material in any medium or format. -Adapt — remix, transform, and build upon the material for any purpose, even commercially. -The licensor cannot revoke these freedoms as long as you follow the license terms. - -Under the following terms: - -Attribution — You must give appropriate credit, provide a link to the license, and -indicate if changes were made. You may do so in any reasonable manner, but not in any way -that suggests the licensor endorses you or your use. - -ShareAlike — If you remix, transform, or build upon the material, you must distribute -your contributions under the same license as the original. - -No additional restrictions — You may not apply legal terms or technological measures that -legally restrict others from doing anything the license permits. - -Notices: - -You do not have to comply with the license for elements of the material in the public -domain or where your use is permitted by an applicable exception or limitation. -No warranties are given. The license may not give you all of the permissions necessary -for your intended use. For example, other rights such as publicity, privacy, or moral -rights may limit how you use the material. - -For more details: -http://creativecommons.org/licenses/by-sa/2.0/ - ------------------------ - Attribution 3.0 Unported (CC BY 3.0) + Copyright (C) 2009 cmusounddesign Copyright (C) 2010 Tomlija Copyright (C) 2010 lsprice @@ -175,3 +116,41 @@ rights may limit how you use the material. For more details: http://creativecommons.org/licenses/by/3.0/ + +----------------------- + +CC0 1.0 Universal (CC0 1.0) Public Domain Dedication + +Iwan Gabovitch +Ottomaani138 +Ogrebane +blukotek +Sevin7 +Yoyodaman234 +Ryding + +No Copyright + +The person who associated a work with this deed has dedicated the work to the +public domain by waiving all of his or her rights to the work worldwide under +copyright law, including all related and neighboring rights, to the extent +allowed by law. + +You can copy, modify, distribute and perform the work, even for commercial +purposes, all without asking permission. See Other Information below. + +Other Information: + +In no way are the patent or trademark rights of any person affected by CC0, nor +are the rights that other persons may have in the work or in how the work is +used, such as publicity or privacy rights. + +Unless expressly stated otherwise, the person who associated a work with this +deed makes no warranties about the work, and disclaims liability for all uses +of the work, to the fullest extent permitted by applicable law. + +When using or citing the work, you should not imply endorsement by the author +or the affirmer. + +For more details: +https://creativecommons.org/publicdomain/zero/1.0/ diff --git a/mods/mtg/default/mapgen.lua b/mods/mtg/default/mapgen.lua old mode 100755 new mode 100644 index 9fb4038..6e0a4d8 --- a/mods/mtg/default/mapgen.lua +++ b/mods/mtg/default/mapgen.lua @@ -1,5 +1,5 @@ -- --- Aliases for map generator outputs +-- Aliases for map generators -- minetest.register_alias("mapgen_stone", "default:stone") @@ -8,7 +8,7 @@ minetest.register_alias("mapgen_dirt_with_grass", "default:dirt_with_grass") minetest.register_alias("mapgen_sand", "default:sand") minetest.register_alias("mapgen_water_source", "default:water_source") minetest.register_alias("mapgen_river_water_source", "default:river_water_source") -minetest.register_alias("mapgen_lava_source", "air") +minetest.register_alias("mapgen_lava_source", "default:lava_source") minetest.register_alias("mapgen_gravel", "default:gravel") minetest.register_alias("mapgen_desert_stone", "default:desert_stone") minetest.register_alias("mapgen_desert_sand", "default:desert_sand") @@ -25,29 +25,33 @@ minetest.register_alias("mapgen_leaves", "default:leaves") minetest.register_alias("mapgen_apple", "default:apple") minetest.register_alias("mapgen_jungletree", "default:jungletree") minetest.register_alias("mapgen_jungleleaves", "default:jungleleaves") -minetest.register_alias("mapgen_junglegrass", "air") +minetest.register_alias("mapgen_junglegrass", "default:junglegrass") minetest.register_alias("mapgen_pine_tree", "default:pine_tree") minetest.register_alias("mapgen_pine_needles", "default:pine_needles") -- Dungeons minetest.register_alias("mapgen_cobble", "default:cobble") -minetest.register_alias("mapgen_stair_cobble", "air") -minetest.register_alias("mapgen_mossycobble", "default:cobble") +minetest.register_alias("mapgen_stair_cobble", "stairs:stair_cobble") +minetest.register_alias("mapgen_mossycobble", "default:mossycobble") +minetest.register_alias("mapgen_stair_desert_stone", "stairs:stair_desert_stone") minetest.register_alias("mapgen_sandstonebrick", "default:sandstonebrick") -minetest.register_alias("mapgen_stair_sandstonebrick", "air") +minetest.register_alias("mapgen_stair_sandstone_block", "stairs:stair_sandstone_block") -- -- Register ores -- --- All mapgens except singlenode --- Blob ore first to avoid other ores inside blobs +-- Mgv6 -function default.register_ores() +function default.register_mgv6_ores() + + -- Blob ore + -- These first to avoid other ores in blobs -- Clay + -- This first to avoid clay in sand blobs minetest.register_ore({ ore_type = "blob", @@ -55,8 +59,8 @@ function default.register_ores() wherein = {"default:sand"}, clust_scarcity = 16 * 16 * 16, clust_size = 5, - y_min = -15, y_max = 0, + y_min = -15, noise_threshold = 0.0, noise_params = { offset = 0.5, @@ -73,12 +77,11 @@ function default.register_ores() minetest.register_ore({ ore_type = "blob", ore = "default:sand", - wherein = {"default:stone", "default:sandstone", - "default:desert_stone"}, + wherein = {"default:stone", "default:desert_stone"}, clust_scarcity = 16 * 16 * 16, clust_size = 5, + y_max = 0, y_min = -31, - y_max = 4, noise_threshold = 0.0, noise_params = { offset = 0.5, @@ -95,11 +98,11 @@ function default.register_ores() minetest.register_ore({ ore_type = "blob", ore = "default:dirt", - wherein = {"default:stone", "default:sandstone"}, + wherein = {"default:stone"}, clust_scarcity = 16 * 16 * 16, clust_size = 5, - y_min = -31, y_max = 31000, + y_min = -31, noise_threshold = 0.0, noise_params = { offset = 0.5, @@ -119,8 +122,8 @@ function default.register_ores() wherein = {"default:stone"}, clust_scarcity = 16 * 16 * 16, clust_size = 5, - y_min = -31000, y_max = 31000, + y_min = -31000, noise_threshold = 0.0, noise_params = { offset = 0.5, @@ -132,8 +135,21 @@ function default.register_ores() }, }) + -- Scatter ores + -- Coal + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_coal", + wherein = "default:stone", + clust_scarcity = 8 * 8 * 8, + clust_num_ores = 9, + clust_size = 3, + y_max = 31000, + y_min = 1025, + }) + minetest.register_ore({ ore_type = "scatter", ore = "default:stone_with_coal", @@ -141,8 +157,8 @@ function default.register_ores() clust_scarcity = 8 * 8 * 8, clust_num_ores = 8, clust_size = 3, - y_min = -31000, y_max = 64, + y_min = -31000, }) minetest.register_ore({ @@ -152,32 +168,21 @@ function default.register_ores() clust_scarcity = 24 * 24 * 24, clust_num_ores = 27, clust_size = 6, - y_min = -31000, y_max = 0, + y_min = -31000, }) -- Iron - minetest.register_ore({ - ore_type = "scatter", - ore = "default:stone_with_iron", - wherein = "default:stone", - clust_scarcity = 12 * 12 * 12, - clust_num_ores = 3, - clust_size = 2, - y_min = -15, - y_max = 2, - }) - minetest.register_ore({ ore_type = "scatter", ore = "default:stone_with_iron", wherein = "default:stone", clust_scarcity = 9 * 9 * 9, - clust_num_ores = 5, + clust_num_ores = 12, clust_size = 3, - y_min = -63, - y_max = -16, + y_max = 31000, + y_min = 1025, }) minetest.register_ore({ @@ -187,8 +192,8 @@ function default.register_ores() clust_scarcity = 7 * 7 * 7, clust_num_ores = 5, clust_size = 3, + y_max = 0, y_min = -31000, - y_max = -64, }) minetest.register_ore({ @@ -198,95 +203,23 @@ function default.register_ores() clust_scarcity = 24 * 24 * 24, clust_num_ores = 27, clust_size = 6, - y_min = -31000, y_max = -64, - }) - - --Mese - - minetest.register_ore({ - ore_type = "scatter", - ore = "default:stone_with_mese", - wherein = "default:stone", - clust_scarcity = 18 * 18 * 18, - clust_num_ores = 3, - clust_size = 2, - y_min = -255, - y_max = -64, - }) - - minetest.register_ore({ - ore_type = "scatter", - ore = "default:stone_with_mese", - wherein = "default:stone", - clust_scarcity = 14 * 14 * 14, - clust_num_ores = 5, - clust_size = 3, y_min = -31000, - y_max = -256, - }) - - minetest.register_ore({ - ore_type = "scatter", - ore = "default:mese", - wherein = "default:stone", - clust_scarcity = 36 * 36 * 36, - clust_num_ores = 3, - clust_size = 2, - y_min = -31000, - y_max = -1024, - }) - - -- Gold - - minetest.register_ore({ - ore_type = "scatter", - ore = "default:stone_with_gold", - wherein = "default:stone", - clust_scarcity = 15 * 15 * 15, - clust_num_ores = 3, - clust_size = 2, - y_min = -255, - y_max = -64, - }) - - minetest.register_ore({ - ore_type = "scatter", - ore = "default:stone_with_gold", - wherein = "default:stone", - clust_scarcity = 13 * 13 * 13, - clust_num_ores = 5, - clust_size = 3, - y_min = -31000, - y_max = -256, - }) - - -- Diamond - - minetest.register_ore({ - ore_type = "scatter", - ore = "default:stone_with_diamond", - wherein = "default:stone", - clust_scarcity = 17 * 17 * 17, - clust_num_ores = 4, - clust_size = 3, - y_min = -255, - y_max = -128, - }) - - minetest.register_ore({ - ore_type = "scatter", - ore = "default:stone_with_diamond", - wherein = "default:stone", - clust_scarcity = 15 * 15 * 15, - clust_num_ores = 4, - clust_size = 3, - y_min = -31000, - y_max = -256, }) -- Copper + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_copper", + wherein = "default:stone", + clust_scarcity = 9 * 9 * 9, + clust_num_ores = 5, + clust_size = 3, + y_max = 31000, + y_min = 1025, + }) + minetest.register_ore({ ore_type = "scatter", ore = "default:stone_with_copper", @@ -294,8 +227,8 @@ function default.register_ores() clust_scarcity = 12 * 12 * 12, clust_num_ores = 4, clust_size = 3, - y_min = -63, y_max = -16, + y_min = -63, }) minetest.register_ore({ @@ -305,112 +238,1155 @@ function default.register_ores() clust_scarcity = 9 * 9 * 9, clust_num_ores = 5, clust_size = 3, - y_min = -31000, y_max = -64, + y_min = -31000, + }) + + -- Tin + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_tin", + wherein = "default:stone", + clust_scarcity = 10 * 10 * 10, + clust_num_ores = 5, + clust_size = 3, + y_max = 31000, + y_min = 1025, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_tin", + wherein = "default:stone", + clust_scarcity = 13 * 13 * 13, + clust_num_ores = 4, + clust_size = 3, + y_max = -32, + y_min = -127, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_tin", + wherein = "default:stone", + clust_scarcity = 10 * 10 * 10, + clust_num_ores = 5, + clust_size = 3, + y_max = -128, + y_min = -31000, + }) + + -- Gold + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_gold", + wherein = "default:stone", + clust_scarcity = 13 * 13 * 13, + clust_num_ores = 5, + clust_size = 3, + y_max = 31000, + y_min = 1025, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_gold", + wherein = "default:stone", + clust_scarcity = 15 * 15 * 15, + clust_num_ores = 3, + clust_size = 2, + y_max = -64, + y_min = -255, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_gold", + wherein = "default:stone", + clust_scarcity = 13 * 13 * 13, + clust_num_ores = 5, + clust_size = 3, + y_max = -256, + y_min = -31000, + }) + + -- Mese crystal + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_mese", + wherein = "default:stone", + clust_scarcity = 14 * 14 * 14, + clust_num_ores = 5, + clust_size = 3, + y_max = 31000, + y_min = 1025, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_mese", + wherein = "default:stone", + clust_scarcity = 18 * 18 * 18, + clust_num_ores = 3, + clust_size = 2, + y_max = -64, + y_min = -255, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_mese", + wherein = "default:stone", + clust_scarcity = 14 * 14 * 14, + clust_num_ores = 5, + clust_size = 3, + y_max = -256, + y_min = -31000, + }) + + -- Diamond + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_diamond", + wherein = "default:stone", + clust_scarcity = 15 * 15 * 15, + clust_num_ores = 4, + clust_size = 3, + y_max = 31000, + y_min = 1025, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_diamond", + wherein = "default:stone", + clust_scarcity = 17 * 17 * 17, + clust_num_ores = 4, + clust_size = 3, + y_max = -128, + y_min = -255, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_diamond", + wherein = "default:stone", + clust_scarcity = 15 * 15 * 15, + clust_num_ores = 4, + clust_size = 3, + y_max = -256, + y_min = -31000, + }) + + -- Mese block + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:mese", + wherein = "default:stone", + clust_scarcity = 36 * 36 * 36, + clust_num_ores = 3, + clust_size = 2, + y_max = 31000, + y_min = 1025, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:mese", + wherein = "default:stone", + clust_scarcity = 36 * 36 * 36, + clust_num_ores = 3, + clust_size = 2, + y_max = -1024, + y_min = -31000, }) end -local WATER_H = tonumber(minetest.settings:get("water_level")) + +-- All mapgens except mgv6 + +function default.register_ores() + + -- Stratum ores. + -- These obviously first. + + -- Silver sandstone + + minetest.register_ore({ + ore_type = "stratum", + ore = "default:silver_sandstone", + wherein = {"default:stone"}, + clust_scarcity = 1, + y_max = 46, + y_min = 10, + noise_params = { + offset = 28, + scale = 16, + spread = {x = 128, y = 128, z = 128}, + seed = 90122, + octaves = 1, + }, + stratum_thickness = 4, + biomes = {"cold_desert"}, + }) + + minetest.register_ore({ + ore_type = "stratum", + ore = "default:silver_sandstone", + wherein = {"default:stone"}, + clust_scarcity = 1, + y_max = 42, + y_min = 6, + noise_params = { + offset = 24, + scale = 16, + spread = {x = 128, y = 128, z = 128}, + seed = 90122, + octaves = 1, + }, + stratum_thickness = 2, + biomes = {"cold_desert"}, + }) + + -- Desert sandstone + + minetest.register_ore({ + ore_type = "stratum", + ore = "default:desert_sandstone", + wherein = {"default:desert_stone"}, + clust_scarcity = 1, + y_max = 46, + y_min = 10, + noise_params = { + offset = 28, + scale = 16, + spread = {x = 128, y = 128, z = 128}, + seed = 90122, + octaves = 1, + }, + stratum_thickness = 4, + biomes = {"desert"}, + }) + + minetest.register_ore({ + ore_type = "stratum", + ore = "default:desert_sandstone", + wherein = {"default:desert_stone"}, + clust_scarcity = 1, + y_max = 42, + y_min = 6, + noise_params = { + offset = 24, + scale = 16, + spread = {x = 128, y = 128, z = 128}, + seed = 90122, + octaves = 1, + }, + stratum_thickness = 2, + biomes = {"desert"}, + }) + + -- Sandstone + + minetest.register_ore({ + ore_type = "stratum", + ore = "default:sandstone", + wherein = {"default:desert_stone"}, + clust_scarcity = 1, + y_max = 39, + y_min = 3, + noise_params = { + offset = 21, + scale = 16, + spread = {x = 128, y = 128, z = 128}, + seed = 90122, + octaves = 1, + }, + stratum_thickness = 2, + biomes = {"desert"}, + }) + + -- Blob ore. + -- These before scatter ores to avoid other ores in blobs. + + -- Clay + + minetest.register_ore({ + ore_type = "blob", + ore = "default:clay", + wherein = {"default:sand"}, + clust_scarcity = 16 * 16 * 16, + clust_size = 5, + y_max = 0, + y_min = -15, + noise_threshold = 0.0, + noise_params = { + offset = 0.5, + scale = 0.2, + spread = {x = 5, y = 5, z = 5}, + seed = -316, + octaves = 1, + persist = 0.0 + }, + }) + + -- Silver sand + + minetest.register_ore({ + ore_type = "blob", + ore = "default:silver_sand", + wherein = {"default:stone"}, + clust_scarcity = 16 * 16 * 16, + clust_size = 5, + y_max = 31000, + y_min = -31000, + noise_threshold = 0.0, + noise_params = { + offset = 0.5, + scale = 0.2, + spread = {x = 5, y = 5, z = 5}, + seed = 2316, + octaves = 1, + persist = 0.0 + }, + biomes = {"icesheet_ocean", "tundra", "tundra_beach", "tundra_ocean", + "taiga", "taiga_ocean", "snowy_grassland", "snowy_grassland_ocean", + "grassland", "grassland_dunes", "grassland_ocean", "coniferous_forest", + "coniferous_forest_dunes", "coniferous_forest_ocean", "deciduous_forest", + "deciduous_forest_shore", "deciduous_forest_ocean", "cold_desert", + "cold_desert_ocean", "savanna", "savanna_shore", "savanna_ocean", + "rainforest", "rainforest_swamp", "rainforest_ocean", "underground", + "floatland_coniferous_forest", "floatland_coniferous_forest_ocean"} + }) + + -- Dirt + + minetest.register_ore({ + ore_type = "blob", + ore = "default:dirt", + wherein = {"default:stone"}, + clust_scarcity = 16 * 16 * 16, + clust_size = 5, + y_max = 31000, + y_min = -31, + noise_threshold = 0.0, + noise_params = { + offset = 0.5, + scale = 0.2, + spread = {x = 5, y = 5, z = 5}, + seed = 17676, + octaves = 1, + persist = 0.0 + }, + biomes = {"taiga", "snowy_grassland", "grassland", "coniferous_forest", + "deciduous_forest", "deciduous_forest_shore", "savanna", "savanna_shore", + "rainforest", "rainforest_swamp", "floatland_coniferous_forest"} + }) + + -- Gravel + + minetest.register_ore({ + ore_type = "blob", + ore = "default:gravel", + wherein = {"default:stone"}, + clust_scarcity = 16 * 16 * 16, + clust_size = 5, + y_max = 31000, + y_min = -31000, + noise_threshold = 0.0, + noise_params = { + offset = 0.5, + scale = 0.2, + spread = {x = 5, y = 5, z = 5}, + seed = 766, + octaves = 1, + persist = 0.0 + }, + biomes = {"icesheet_ocean", "tundra", "tundra_beach", "tundra_ocean", + "taiga", "taiga_ocean", "snowy_grassland", "snowy_grassland_ocean", + "grassland", "grassland_dunes", "grassland_ocean", "coniferous_forest", + "coniferous_forest_dunes", "coniferous_forest_ocean", "deciduous_forest", + "deciduous_forest_shore", "deciduous_forest_ocean", "cold_desert", + "cold_desert_ocean", "savanna", "savanna_shore", "savanna_ocean", + "rainforest", "rainforest_swamp", "rainforest_ocean", "underground", + "floatland_coniferous_forest", "floatland_coniferous_forest_ocean"} + }) + + -- Scatter ores + + -- Coal + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_coal", + wherein = "default:stone", + clust_scarcity = 8 * 8 * 8, + clust_num_ores = 9, + clust_size = 3, + y_max = 31000, + y_min = 1025, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_coal", + wherein = "default:stone", + clust_scarcity = 8 * 8 * 8, + clust_num_ores = 8, + clust_size = 3, + y_max = 64, + y_min = -127, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_coal", + wherein = "default:stone", + clust_scarcity = 12 * 12 * 12, + clust_num_ores = 30, + clust_size = 5, + y_max = -128, + y_min = -31000, + }) + + -- Tin + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_tin", + wherein = "default:stone", + clust_scarcity = 10 * 10 * 10, + clust_num_ores = 5, + clust_size = 3, + y_max = 31000, + y_min = 1025, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_tin", + wherein = "default:stone", + clust_scarcity = 13 * 13 * 13, + clust_num_ores = 4, + clust_size = 3, + y_max = -64, + y_min = -127, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_tin", + wherein = "default:stone", + clust_scarcity = 10 * 10 * 10, + clust_num_ores = 5, + clust_size = 3, + y_max = -128, + y_min = -31000, + }) + + -- Copper + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_copper", + wherein = "default:stone", + clust_scarcity = 9 * 9 * 9, + clust_num_ores = 5, + clust_size = 3, + y_max = 31000, + y_min = 1025, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_copper", + wherein = "default:stone", + clust_scarcity = 12 * 12 * 12, + clust_num_ores = 4, + clust_size = 3, + y_max = -64, + y_min = -127, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_copper", + wherein = "default:stone", + clust_scarcity = 9 * 9 * 9, + clust_num_ores = 5, + clust_size = 3, + y_max = -128, + y_min = -31000, + }) + + -- Iron + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_iron", + wherein = "default:stone", + clust_scarcity = 9 * 9 * 9, + clust_num_ores = 12, + clust_size = 3, + y_max = 31000, + y_min = 1025, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_iron", + wherein = "default:stone", + clust_scarcity = 7 * 7 * 7, + clust_num_ores = 5, + clust_size = 3, + y_max = -128, + y_min = -255, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_iron", + wherein = "default:stone", + clust_scarcity = 12 * 12 * 12, + clust_num_ores = 29, + clust_size = 5, + y_max = -256, + y_min = -31000, + }) + + -- Gold + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_gold", + wherein = "default:stone", + clust_scarcity = 13 * 13 * 13, + clust_num_ores = 5, + clust_size = 3, + y_max = 31000, + y_min = 1025, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_gold", + wherein = "default:stone", + clust_scarcity = 15 * 15 * 15, + clust_num_ores = 3, + clust_size = 2, + y_max = -256, + y_min = -511, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_gold", + wherein = "default:stone", + clust_scarcity = 13 * 13 * 13, + clust_num_ores = 5, + clust_size = 3, + y_max = -512, + y_min = -31000, + }) + + -- Mese crystal + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_mese", + wherein = "default:stone", + clust_scarcity = 14 * 14 * 14, + clust_num_ores = 5, + clust_size = 3, + y_max = 31000, + y_min = 1025, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_mese", + wherein = "default:stone", + clust_scarcity = 18 * 18 * 18, + clust_num_ores = 3, + clust_size = 2, + y_max = -512, + y_min = -1023, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_mese", + wherein = "default:stone", + clust_scarcity = 14 * 14 * 14, + clust_num_ores = 5, + clust_size = 3, + y_max = -1024, + y_min = -31000, + }) + + -- Diamond + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_diamond", + wherein = "default:stone", + clust_scarcity = 15 * 15 * 15, + clust_num_ores = 4, + clust_size = 3, + y_max = 31000, + y_min = 1025, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_diamond", + wherein = "default:stone", + clust_scarcity = 17 * 17 * 17, + clust_num_ores = 4, + clust_size = 3, + y_max = -1024, + y_min = -2047, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_diamond", + wherein = "default:stone", + clust_scarcity = 15 * 15 * 15, + clust_num_ores = 4, + clust_size = 3, + y_max = -2048, + y_min = -31000, + }) + + -- Mese block + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:mese", + wherein = "default:stone", + clust_scarcity = 36 * 36 * 36, + clust_num_ores = 3, + clust_size = 2, + y_max = 31000, + y_min = 1025, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:mese", + wherein = "default:stone", + clust_scarcity = 36 * 36 * 36, + clust_num_ores = 3, + clust_size = 2, + y_max = -2048, + y_min = -4095, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:mese", + wherein = "default:stone", + clust_scarcity = 28 * 28 * 28, + clust_num_ores = 5, + clust_size = 3, + y_max = -4096, + y_min = -31000, + }) +end -- -- Register biomes -- --- All mapgens except mgv6 and singlenode +-- All mapgens except mgv6 -function default.register_biomes() - minetest.clear_registered_biomes() +function default.register_biomes(upper_limit) - -- Temperate + -- Icesheet minetest.register_biome({ - name = "stone_grassland", - --node_dust = "", - node_top = "default:dirt_with_grass", + name = "icesheet", + node_dust = "default:snowblock", + node_top = "default:snowblock", + depth_top = 1, + node_filler = "default:snowblock", + depth_filler = 3, + node_stone = "default:cave_ice", + node_water_top = "default:ice", + depth_water_top = 10, + node_river_water = "default:ice", + node_riverbed = "default:gravel", + depth_riverbed = 2, + y_max = upper_limit, + y_min = -8, + heat_point = 0, + humidity_point = 73, + }) + + minetest.register_biome({ + name = "icesheet_ocean", + node_dust = "default:snowblock", + node_top = "default:sand", + depth_top = 1, + node_filler = "default:sand", + depth_filler = 3, + node_water_top = "default:ice", + depth_water_top = 10, + y_max = -9, + y_min = -112, + heat_point = 0, + humidity_point = 73, + }) + + -- Tundra + + minetest.register_biome({ + name = "tundra_highland", + node_dust = "default:snow", + node_riverbed = "default:gravel", + depth_riverbed = 2, + y_max = upper_limit, + y_min = 47, + heat_point = 0, + humidity_point = 40, + }) + + minetest.register_biome({ + name = "tundra", + node_top = "default:permafrost_with_stones", + depth_top = 1, + node_filler = "default:permafrost", + depth_filler = 1, + node_riverbed = "default:gravel", + depth_riverbed = 2, + vertical_blend = 4, + y_max = 46, + y_min = 2, + heat_point = 0, + humidity_point = 40, + }) + + minetest.register_biome({ + name = "tundra_beach", + node_top = "default:gravel", + depth_top = 1, + node_filler = "default:gravel", + depth_filler = 2, + node_riverbed = "default:gravel", + depth_riverbed = 2, + vertical_blend = 1, + y_max = 1, + y_min = -3, + heat_point = 0, + humidity_point = 40, + }) + + minetest.register_biome({ + name = "tundra_ocean", + node_top = "default:sand", + depth_top = 1, + node_filler = "default:sand", + depth_filler = 3, + node_riverbed = "default:gravel", + depth_riverbed = 2, + vertical_blend = 1, + y_max = -4, + y_min = -112, + heat_point = 0, + humidity_point = 40, + }) + + -- Taiga + + minetest.register_biome({ + name = "taiga", + node_dust = "default:snow", + node_top = "default:dirt_with_snow", + depth_top = 1, + node_filler = "default:dirt", + depth_filler = 3, + node_riverbed = "default:sand", + depth_riverbed = 2, + y_max = upper_limit, + y_min = 4, + heat_point = 25, + humidity_point = 70, + }) + + minetest.register_biome({ + name = "taiga_ocean", + node_dust = "default:snow", + node_top = "default:sand", + depth_top = 1, + node_filler = "default:sand", + depth_filler = 3, + node_riverbed = "default:sand", + depth_riverbed = 2, + vertical_blend = 1, + y_max = 3, + y_min = -112, + heat_point = 25, + humidity_point = 70, + }) + + -- Snowy grassland + + minetest.register_biome({ + name = "snowy_grassland", + node_dust = "default:snow", + node_top = "default:dirt_with_snow", depth_top = 1, node_filler = "default:dirt", depth_filler = 1, - --node_stone = "", - --node_water_top = "", - --depth_water_top = , - --node_water = "", - --node_river_water = "", - y_min = 50, - y_max = 31000, - heat_point = 40, + node_riverbed = "default:sand", + depth_riverbed = 2, + y_max = upper_limit, + y_min = 4, + heat_point = 20, humidity_point = 35, }) minetest.register_biome({ - name = "coniferous_forest", - --node_dust = "", + name = "snowy_grassland_ocean", + node_dust = "default:snow", + node_top = "default:sand", + depth_top = 1, + node_filler = "default:sand", + depth_filler = 3, + node_riverbed = "default:sand", + depth_riverbed = 2, + vertical_blend = 1, + y_max = 3, + y_min = -112, + heat_point = 20, + humidity_point = 35, + }) + + -- Grassland + + minetest.register_biome({ + name = "grassland", node_top = "default:dirt_with_grass", depth_top = 1, node_filler = "default:dirt", + depth_filler = 1, + node_riverbed = "default:sand", + depth_riverbed = 2, + y_max = upper_limit, + y_min = 6, + heat_point = 50, + humidity_point = 35, + }) + + minetest.register_biome({ + name = "grassland_dunes", + node_top = "default:sand", + depth_top = 1, + node_filler = "default:sand", + depth_filler = 2, + node_riverbed = "default:sand", + depth_riverbed = 2, + vertical_blend = 1, + y_max = 5, + y_min = 4, + heat_point = 50, + humidity_point = 35, + }) + + minetest.register_biome({ + name = "grassland_ocean", + node_top = "default:sand", + depth_top = 1, + node_filler = "default:sand", depth_filler = 3, - --node_stone = "", - --node_water_top = "", - --depth_water_top = , - --node_water = "", - --node_river_water = "", - y_min = WATER_H + 1, - y_max = 55, - heat_point = 40, - humidity_point = 65, + node_riverbed = "default:sand", + depth_riverbed = 2, + y_max = 3, + y_min = -112, + heat_point = 50, + humidity_point = 35, + }) + + -- Coniferous forest + + minetest.register_biome({ + name = "coniferous_forest", + node_top = "default:dirt_with_coniferous_litter", + depth_top = 1, + node_filler = "default:dirt", + depth_filler = 3, + node_riverbed = "default:sand", + depth_riverbed = 2, + y_max = upper_limit, + y_min = 6, + heat_point = 45, + humidity_point = 70, + }) + + minetest.register_biome({ + name = "coniferous_forest_dunes", + node_top = "default:sand", + depth_top = 1, + node_filler = "default:sand", + depth_filler = 3, + node_riverbed = "default:sand", + depth_riverbed = 2, + vertical_blend = 1, + y_max = 5, + y_min = 4, + heat_point = 45, + humidity_point = 70, }) minetest.register_biome({ name = "coniferous_forest_ocean", - --node_dust = "", node_top = "default:sand", depth_top = 1, node_filler = "default:sand", depth_filler = 3, - --node_stone = "", - --node_water_top = "", - --depth_water_top = , - --node_water = "", - --node_river_water = "", + node_riverbed = "default:sand", + depth_riverbed = 2, + y_max = 3, y_min = -112, - y_max = WATER_H + 1, - heat_point = 40, - humidity_point = 65, + heat_point = 45, + humidity_point = 70, }) + -- Deciduous forest + minetest.register_biome({ name = "deciduous_forest", - --node_dust = "", node_top = "default:dirt_with_grass", depth_top = 1, node_filler = "default:dirt", depth_filler = 3, - --node_stone = "", - --node_water_top = "", - --depth_water_top = , - --node_water = "", - --node_river_water = "", - y_min = WATER_H + 1, - y_max = 55, + node_riverbed = "default:sand", + depth_riverbed = 2, + y_max = upper_limit, + y_min = 1, heat_point = 60, - humidity_point = 65, + humidity_point = 68, + }) + + minetest.register_biome({ + name = "deciduous_forest_shore", + node_top = "default:dirt", + depth_top = 1, + node_filler = "default:dirt", + depth_filler = 3, + node_riverbed = "default:sand", + depth_riverbed = 2, + y_max = 0, + y_min = -1, + heat_point = 60, + humidity_point = 68, }) minetest.register_biome({ name = "deciduous_forest_ocean", - --node_dust = "", node_top = "default:sand", depth_top = 1, node_filler = "default:sand", depth_filler = 3, - --node_stone = "", - --node_water_top = "", - --depth_water_top = , - --node_water = "", - --node_river_water = "", + node_riverbed = "default:sand", + depth_riverbed = 2, + vertical_blend = 1, + y_max = -2, y_min = -112, - y_max = WATER_H, heat_point = 60, + humidity_point = 68, + }) + + -- Desert + + minetest.register_biome({ + name = "desert", + node_top = "default:desert_sand", + depth_top = 1, + node_filler = "default:desert_sand", + depth_filler = 1, + node_stone = "default:desert_stone", + node_riverbed = "default:sand", + depth_riverbed = 2, + y_max = upper_limit, + y_min = 4, + heat_point = 92, + humidity_point = 16, + }) + + minetest.register_biome({ + name = "desert_ocean", + node_top = "default:sand", + depth_top = 1, + node_filler = "default:sand", + depth_filler = 3, + node_stone = "default:desert_stone", + node_riverbed = "default:sand", + depth_riverbed = 2, + vertical_blend = 1, + y_max = 3, + y_min = -112, + heat_point = 92, + humidity_point = 16, + }) + + -- Sandstone desert + + minetest.register_biome({ + name = "sandstone_desert", + node_top = "default:sand", + depth_top = 1, + node_filler = "default:sand", + depth_filler = 1, + node_stone = "default:sandstone", + node_riverbed = "default:sand", + depth_riverbed = 2, + y_max = upper_limit, + y_min = 4, + heat_point = 60, + humidity_point = 0, + }) + + minetest.register_biome({ + name = "sandstone_desert_ocean", + node_top = "default:sand", + depth_top = 1, + node_filler = "default:sand", + depth_filler = 3, + node_stone = "default:sandstone", + node_riverbed = "default:sand", + depth_riverbed = 2, + y_max = 3, + y_min = -112, + heat_point = 60, + humidity_point = 0, + }) + + -- Cold desert + + minetest.register_biome({ + name = "cold_desert", + node_top = "default:silver_sand", + depth_top = 1, + node_filler = "default:silver_sand", + depth_filler = 1, + node_riverbed = "default:sand", + depth_riverbed = 2, + y_max = upper_limit, + y_min = 4, + heat_point = 40, + humidity_point = 0, + }) + + minetest.register_biome({ + name = "cold_desert_ocean", + node_top = "default:sand", + depth_top = 1, + node_filler = "default:sand", + depth_filler = 3, + node_riverbed = "default:sand", + depth_riverbed = 2, + vertical_blend = 1, + y_max = 3, + y_min = -112, + heat_point = 40, + humidity_point = 0, + }) + + -- Savanna + + minetest.register_biome({ + name = "savanna", + node_top = "default:dirt_with_dry_grass", + depth_top = 1, + node_filler = "default:dirt", + depth_filler = 1, + node_riverbed = "default:sand", + depth_riverbed = 2, + y_max = upper_limit, + y_min = 1, + heat_point = 89, + humidity_point = 42, + }) + + minetest.register_biome({ + name = "savanna_shore", + node_top = "default:dirt", + depth_top = 1, + node_filler = "default:dirt", + depth_filler = 3, + node_riverbed = "default:sand", + depth_riverbed = 2, + y_max = 0, + y_min = -1, + heat_point = 89, + humidity_point = 42, + }) + + minetest.register_biome({ + name = "savanna_ocean", + node_top = "default:sand", + depth_top = 1, + node_filler = "default:sand", + depth_filler = 3, + node_riverbed = "default:sand", + depth_riverbed = 2, + vertical_blend = 1, + y_max = -2, + y_min = -112, + heat_point = 89, + humidity_point = 42, + }) + + -- Rainforest + + minetest.register_biome({ + name = "rainforest", + node_top = "default:dirt_with_rainforest_litter", + depth_top = 1, + node_filler = "default:dirt", + depth_filler = 3, + node_riverbed = "default:sand", + depth_riverbed = 2, + y_max = upper_limit, + y_min = 1, + heat_point = 86, + humidity_point = 65, + }) + + minetest.register_biome({ + name = "rainforest_swamp", + node_top = "default:dirt", + depth_top = 1, + node_filler = "default:dirt", + depth_filler = 3, + node_riverbed = "default:sand", + depth_riverbed = 2, + y_max = 0, + y_min = -1, + heat_point = 86, + humidity_point = 65, + }) + + minetest.register_biome({ + name = "rainforest_ocean", + node_top = "default:sand", + depth_top = 1, + node_filler = "default:sand", + depth_filler = 3, + node_riverbed = "default:sand", + depth_riverbed = 2, + vertical_blend = 1, + y_max = -2, + y_min = -112, + heat_point = 86, humidity_point = 65, }) @@ -418,18 +1394,52 @@ function default.register_biomes() minetest.register_biome({ name = "underground", - --node_dust = "", - --node_top = "", - --depth_top = , - --node_filler = "", - --depth_filler = , - --node_stone = "", - --node_water_top = "", - --depth_water_top = , - --node_water = "", - --node_river_water = "", - y_min = -31000, y_max = -113, + y_min = -31000, + heat_point = 50, + humidity_point = 50, + }) +end + + +-- Biomes for floatlands + +-- TODO Temporary simple biomes to be replaced by special floatland biomes later. + +function default.register_floatland_biomes(floatland_level, shadow_limit) + + minetest.register_biome({ + name = "floatland_grassland", + node_top = "default:dirt_with_grass", + depth_top = 1, + node_filler = "default:dirt", + depth_filler = 1, + y_max = 31000, + y_min = floatland_level + 2, + heat_point = 50, + humidity_point = 25, + }) + + minetest.register_biome({ + name = "floatland_coniferous_forest", + node_top = "default:dirt_with_coniferous_litter", + depth_top = 1, + node_filler = "default:dirt", + depth_filler = 3, + y_max = 31000, + y_min = floatland_level + 2, + heat_point = 50, + humidity_point = 75, + }) + + minetest.register_biome({ + name = "floatland_ocean", + node_top = "default:sand", + depth_top = 1, + node_filler = "default:sand", + depth_filler = 3, + y_max = floatland_level + 1, + y_min = shadow_limit, heat_point = 50, humidity_point = 50, }) @@ -443,387 +1453,69 @@ end -- Mgv6 function default.register_mgv6_decorations() - minetest.clear_registered_decorations() - - -- Papyrus - - minetest.register_decoration({ - deco_type = "simple", - place_on = {"default:dirt_with_grass"}, - sidelen = 16, - noise_params = { - offset = -0.3, - scale = 0.7, - spread = {x = 100, y = 100, z = 100}, - seed = 354, - octaves = 3, - persist = 0.7 - }, - y_min = 1, - y_max = 1, - decoration = "default:papyrus", - height = 2, - height_max = 4, - spawn_by = "default:water_source", - num_spawn_by = 1, - }) - - -- Cacti - - minetest.register_decoration({ - deco_type = "simple", - place_on = {"default:desert_sand"}, - sidelen = 16, - noise_params = { - offset = -0.012, - scale = 0.024, - spread = {x = 100, y = 100, z = 100}, - seed = 230, - octaves = 3, - persist = 0.6 - }, - y_min = 1, - y_max = 30, - decoration = "default:cactus", - height = 3, - height_max = 4, - }) end --- All mapgens except mgv6 and singlenode + +-- All mapgens except mgv6 local function register_grass_decoration(offset, scale, length) - minetest.register_decoration({ - deco_type = "simple", - place_on = {"default:dirt_with_grass", "default:sand"}, - sidelen = 16, - noise_params = { - offset = offset, - scale = scale, - spread = {x = 200, y = 200, z = 200}, - seed = 329, - octaves = 3, - persist = 0.6 - }, - biomes = {"stone_grassland", "sandstone_grassland", - "deciduous_forest", "coniferous_forest", - "stone_grassland_dunes", "sandstone_grassland_dunes", - "coniferous_forest_dunes"}, - y_min = 1, - y_max = 31000, - decoration = "default:grass_"..length, - }) -end -local MAX_JTREE_H = 62 -local MAX_TREE_H = MAX_JTREE_H - 10 -local MAX_GRASS_H = 63 +end local function register_dry_grass_decoration(offset, scale, length) - minetest.register_decoration({ - deco_type = "simple", - place_on = {"default:dirt_with_dry_grass"}, - sidelen = 16, - noise_params = { - offset = offset, - scale = scale, - spread = {x = 200, y = 200, z = 200}, - seed = 329, - octaves = 3, - persist = 0.6 - }, - biomes = {"savanna"}, - y_min = 1, - y_max = MAX_GRASS_H, - decoration = "default:dry_grass_"..length, - }) + end +local function register_fern_decoration(seed, length) + +end + + function default.register_decorations() - minetest.clear_registered_decorations() - -- Apple tree and log - local s = 15 - - minetest.register_decoration({ - deco_type = "schematic", - place_on = {"default:dirt_with_grass"}, - sidelen = 16, - noise_params = { - offset = 0.04, - scale = 0.02, - spread = {x = s, y = s, z = s}, - seed = 2, - octaves = 3, - persist = 0.66 - }, - biomes = {"deciduous_forest"}, - y_min = 1, - y_max = MAX_TREE_H, - schematic = minetest.get_modpath("default").."/schematics/apple_tree.mts", - flags = "place_center_x, place_center_z", - }) - - -- Jungle tree and log - - minetest.register_decoration({ - deco_type = "schematic", - place_on = {"default:dirt_with_grass", "default:dirt"}, - sidelen = 40, - fill_ratio = 0.025, - biomes = {"rainforest", "rainforest_swamp"}, - y_min = MAX_TREE_H, - y_max = MAX_JTREE_H, - schematic = minetest.get_modpath("default").."/schematics/jungle_tree.mts", - flags = "place_center_x, place_center_z", - rotation = "random", - }) - - -- Taiga and temperate coniferous forest pine tree and log - - minetest.register_decoration({ - deco_type = "schematic", - place_on = {"default:dirt_with_snow", "default:dirt_with_grass"}, - sidelen = 16, - noise_params = { - offset = 0.04, - scale = 0.02, - spread = {x = 250, y = 250, z = 250}, - seed = 2, - octaves = 3, - persist = 0.66 - }, - biomes = {"taiga", "coniferous_forest"}, - y_min = 2, - y_max = MAX_TREE_H, - schematic = minetest.get_modpath("default").."/schematics/pine_tree.mts", - flags = "place_center_x, place_center_z", - }) - - -- Acacia tree and log - - minetest.register_decoration({ - deco_type = "schematic", - place_on = {"default:dirt_with_dry_grass"}, - sidelen = 16, - noise_params = { - offset = 0, - scale = 0.002, - spread = {x = 250, y = 250, z = 250}, - seed = 2, - octaves = 3, - persist = 0.66 - }, - biomes = {"savanna"}, - y_min = 1, - y_max = MAX_TREE_H, - schematic = minetest.get_modpath("default").."/schematics/acacia_tree.mts", - flags = "place_center_x, place_center_z", - rotation = "random", - }) - - minetest.register_decoration({ - deco_type = "schematic", - place_on = {"default:dirt_with_dry_grass"}, - sidelen = 16, - noise_params = { - offset = 0, - scale = 0.001, - spread = {x = 250, y = 250, z = 250}, - seed = 2, - octaves = 3, - persist = 0.66 - }, - biomes = {"savanna"}, - y_min = 1, - y_max = MAX_TREE_H, - schematic = { - size = { x = 3, y = 2, z = 1}, - data = { - { name = "air", prob = 0 }, - { name = "air", prob = 0 }, - { name = "air", prob = 0 }, - { name = "default:acacia_tree", param2 = 12, prob = 191 }, - { name = "default:acacia_tree", param2 = 12 }, - { name = "default:acacia_tree", param2 = 12, prob = 127 }, - }, - }, - flags = "place_center_x", - rotation = "random", - }) - - -- Aspen tree and log - - minetest.register_decoration({ - deco_type = "schematic", - place_on = {"default:dirt_with_grass"}, - sidelen = 16, - noise_params = { - offset = 0.0, - scale = -0.03, - spread = {x = 250, y = 250, z = 250}, - seed = 2, - octaves = 3, - persist = 0.66 - }, - biomes = {"deciduous_forest"}, - y_min = 1, - y_max = MAX_TREE_H, - schematic = minetest.get_modpath("default").."/schematics/aspen_tree.mts", - flags = "place_center_x, place_center_z", - rotation = "random", - }) - - -- Large cactus - - minetest.register_decoration({ - deco_type = "schematic", - place_on = {"default:desert_sand"}, - sidelen = 16, - noise_params = { - offset = -0.0003, - scale = 0.0009, - spread = {x = 200, y = 200, z = 200}, - seed = 230, - octaves = 3, - persist = 0.6 - }, - biomes = {"desert"}, - y_min = 5, - y_max = MAX_TREE_H, - schematic = minetest.get_modpath("default").."/schematics/large_cactus.mts", - flags = "place_center_x", - rotation = "random", - }) - - -- Cactus - - minetest.register_decoration({ - deco_type = "simple", - place_on = {"default:desert_sand"}, - sidelen = 16, - noise_params = { - offset = -0.0003, - scale = 0.0009, - spread = {x = 200, y = 200, z = 200}, - seed = 230, - octaves = 3, - persist = 0.6 - }, - biomes = {"desert"}, - y_min = 5, - y_max = MAX_TREE_H, - decoration = "default:cactus", - height = 2, - height_max = 5, - }) - - -- Papyrus - - minetest.register_decoration({ - deco_type = "schematic", - place_on = {"default:dirt"}, - sidelen = 16, - noise_params = { - offset = -0.3, - scale = 0.7, - spread = {x = 200, y = 200, z = 200}, - seed = 354, - octaves = 3, - persist = 0.7 - }, - biomes = {"savanna_swamp"}, - y_min = 0, - y_max = 0, - schematic = minetest.get_modpath("default").."/schematics/papyrus.mts", - }) - - -- Grasses - - register_grass_decoration(-0.03, 0.09, 5) - register_grass_decoration(-0.015, 0.075, 4) - register_grass_decoration(0, 0.06, 3) - register_grass_decoration(0.015, 0.045, 2) - register_grass_decoration(0.03, 0.03, 1) - - -- Dry grasses - - register_dry_grass_decoration(0.01, 0.05, 5) - register_dry_grass_decoration(0.03, 0.03, 4) - register_dry_grass_decoration(0.05, 0.01, 3) - register_dry_grass_decoration(0.07, -0.01, 2) - register_dry_grass_decoration(0.09, -0.03, 1) end -- --- Generate nyan cats +-- Detect mapgen, flags and parameters to select functions -- --- All mapgens except singlenode +-- Get setting or default +local mgv7_spflags = minetest.get_mapgen_setting("mgv7_spflags") or + "mountains, ridges, nofloatlands, caverns" +local captures_float = string.match(mgv7_spflags, "floatlands") +local captures_nofloat = string.match(mgv7_spflags, "nofloatlands") -function default.make_nyancat(pos, facedir, length) - local tailvec = {x = 0, y = 0, z = 0} - if facedir == 0 then - tailvec.z = 1 - elseif facedir == 1 then - tailvec.x = 1 - elseif facedir == 2 then - tailvec.z = -1 - elseif facedir == 3 then - tailvec.x = -1 - else - facedir = 0 - tailvec.z = 1 - end - local p = {x = pos.x, y = pos.y, z = pos.z} - minetest.set_node(p, {name = "default:nyancat", param2 = facedir}) - for i = 1, length do - p.x = p.x + tailvec.x - p.z = p.z + tailvec.z - minetest.set_node(p, {name = "default:nyancat_rainbow", param2 = facedir}) - end -end +-- Get setting or default +-- Make global for mods to use to register floatland biomes +default.mgv7_floatland_level = + minetest.get_mapgen_setting("mgv7_floatland_level") or 1280 +default.mgv7_shadow_limit = + minetest.get_mapgen_setting("mgv7_shadow_limit") or 1024 -function default.generate_nyancats(minp, maxp, seed) - local height_min = -31000 - local height_max = -32 - if maxp.y < height_min or minp.y > height_max then - return - end - local y_min = math.max(minp.y, height_min) - local y_max = math.min(maxp.y, height_max) - local volume = (maxp.x - minp.x + 1) * (y_max - y_min + 1) * (maxp.z - minp.z + 1) - local pr = PseudoRandom(seed + 9324342) - local max_num_nyancats = math.floor(volume / (16 * 16 * 16)) - for i = 1, max_num_nyancats do - if pr:next(0, 1000) == 0 then - local x0 = pr:next(minp.x, maxp.x) - local y0 = pr:next(minp.y, maxp.y) - local z0 = pr:next(minp.z, maxp.z) - local p0 = {x = x0, y = y0, z = z0} - default.make_nyancat(p0, pr:next(0, 3), pr:next(3, 15)) - end - end -end +minetest.clear_registered_biomes() +minetest.clear_registered_ores() +minetest.clear_registered_decorations() +local mg_name = minetest.get_mapgen_setting("mg_name") --- --- Detect mapgen to select functions --- - --- Mods using singlenode mapgen can call these functions to enable --- the use of minetest.generate_ores or minetest.generate_decorations - -local mg_params = minetest.get_mapgen_params() -if mg_params.mgname == "v6" then - default.register_ores() +if mg_name == "v6" then + default.register_mgv6_ores() default.register_mgv6_decorations() - minetest.register_on_generated(default.generate_nyancats) -elseif mg_params.mgname ~= "singlenode" then - default.register_biomes() +-- Need to check for 'nofloatlands' because that contains +-- 'floatlands' which makes the second condition true. +elseif mg_name == "v7" and + captures_float == "floatlands" and + captures_nofloat ~= "nofloatlands" then + -- Mgv7 with floatlands and floatland biomes + default.register_biomes(default.mgv7_shadow_limit - 1) + default.register_floatland_biomes( + default.mgv7_floatland_level, default.mgv7_shadow_limit) + default.register_ores() + default.register_decorations() +else + default.register_biomes(31000) default.register_ores() default.register_decorations() - minetest.register_on_generated(default.generate_nyancats) end diff --git a/mods/mtg/default/models/character.b3d b/mods/mtg/default/models/character.b3d deleted file mode 100644 index 9ab4543..0000000 Binary files a/mods/mtg/default/models/character.b3d and /dev/null differ diff --git a/mods/mtg/default/models/character.blend b/mods/mtg/default/models/character.blend deleted file mode 100644 index fca9f65..0000000 Binary files a/mods/mtg/default/models/character.blend and /dev/null differ diff --git a/mods/mtg/default/nodes.lua b/mods/mtg/default/nodes.lua index d001ca0..cfc48be 100644 --- a/mods/mtg/default/nodes.lua +++ b/mods/mtg/default/nodes.lua @@ -51,6 +51,11 @@ default:dirt_with_grass_footsteps default:dirt_with_dry_grass default:dirt_with_snow default:dirt_with_rainforest_litter +default:dirt_with_coniferous_litter + +default:permafrost +default:permafrost_with_stones +default:permafrost_with_moss default:sand default:desert_sand @@ -62,8 +67,8 @@ default:clay default:snow default:snowblock - default:ice +default:cave_ice Trees ----- @@ -79,6 +84,7 @@ default:jungletree default:junglewood default:jungleleaves default:junglesapling +default:emergent_jungle_sapling default:pine_tree default:pine_wood @@ -126,6 +132,8 @@ Plantlife --------- default:cactus +default:large_cactus_seedling + default:papyrus default:dry_shrub default:junglegrass @@ -142,12 +150,28 @@ default:dry_grass_3 default:dry_grass_4 default:dry_grass_5 +default:fern_1 +default:fern_2 +default:fern_3 + +default:marram_grass_1 +default:marram_grass_2 +default:marram_grass_3 + default:bush_stem default:bush_leaves default:bush_sapling default:acacia_bush_stem default:acacia_bush_leaves default:acacia_bush_sapling +default:pine_bush_stem +default:pine_bush_needles +default:pine_bush_sapling +default:blueberry_bush_leaves_with_berries +default:blueberry_bush_leaves +default:blueberry_bush_sapling + +default:sand_with_kelp Corals ------ @@ -172,9 +196,6 @@ default:lava_flowing Tools / "Advanced" crafting / Non-"natural" ------------------------------------------- -default:chest -default:chest_locked - default:bookshelf default:sign_wall_wood @@ -362,6 +383,31 @@ minetest.register_node("default:silver_sandstone_block", { sounds = default.node_sound_stone_defaults(), }) +minetest.register_node("default:obsidian", { + description = "Obsidian", + tiles = {"default_obsidian.png"}, + sounds = default.node_sound_stone_defaults(), + groups = {cracky = 1, level = 2}, +}) + +minetest.register_node("default:obsidianbrick", { + description = "Obsidian Brick", + paramtype2 = "facedir", + place_param2 = 0, + tiles = {"default_obsidian_brick.png"}, + is_ground_content = false, + sounds = default.node_sound_stone_defaults(), + groups = {cracky = 1, level = 2}, +}) + +minetest.register_node("default:obsidian_block", { + description = "Obsidian Block", + tiles = {"default_obsidian_block.png"}, + is_ground_content = false, + sounds = default.node_sound_stone_defaults(), + groups = {cracky = 1, level = 2}, +}) + -- -- Soft / Non-Stone -- @@ -385,6 +431,18 @@ minetest.register_node("default:dirt_with_grass", { }), }) +minetest.register_node("default:dirt_with_grass_footsteps", { + description = "Dirt with Grass and Footsteps", + tiles = {"default_grass.png^default_footprint.png", "default_dirt.png", + {name = "default_dirt.png^default_grass_side.png", + tileable_vertical = false}}, + groups = {crumbly = 3, soil = 1, not_in_creative_inventory = 1}, + drop = 'default:dirt', + sounds = default.node_sound_dirt_defaults({ + footstep = {name = "default_grass_footstep", gain = 0.25}, + }), +}) + minetest.register_node("default:dirt_with_dry_grass", { description = "Dirt with Dry Grass", tiles = {"default_dry_grass.png", @@ -403,10 +461,10 @@ minetest.register_node("default:dirt_with_snow", { tiles = {"default_snow.png", "default_dirt.png", {name = "default_dirt.png^default_snow_side.png", tileable_vertical = false}}, - groups = {crumbly = 3, spreading_dirt_type = 1, snowy = 1}, + groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1, snowy = 1}, drop = 'default:dirt', sounds = default.node_sound_dirt_defaults({ - footstep = {name = "default_snow_footstep", gain = 0.15}, + footstep = {name = "default_snow_footstep", gain = 0.2}, }), }) @@ -425,24 +483,67 @@ minetest.register_node("default:dirt_with_rainforest_litter", { }), }) +minetest.register_node("default:dirt_with_coniferous_litter", { + description = "Dirt with Coniferous Litter", + tiles = { + "default_coniferous_litter.png", + "default_dirt.png", + {name = "default_dirt.png^default_coniferous_litter_side.png", + tileable_vertical = false} + }, + groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1}, + drop = "default:dirt", + sounds = default.node_sound_dirt_defaults({ + footstep = {name = "default_grass_footstep", gain = 0.4}, + }), +}) + +minetest.register_node("default:permafrost", { + description = "Permafrost", + tiles = {"default_permafrost.png"}, + groups = {cracky = 3}, + sounds = default.node_sound_dirt_defaults(), +}) + +minetest.register_node("default:permafrost_with_stones", { + description = "Permafrost with Stones", + tiles = {"default_permafrost.png^default_stones.png", + "default_permafrost.png"}, + groups = {cracky = 3}, + drop = "default:permafrost", + sounds = default.node_sound_gravel_defaults(), +}) + +minetest.register_node("default:permafrost_with_moss", { + description = "Permafrost with Moss", + tiles = {"default_moss.png", "default_permafrost.png", + {name = "default_permafrost.png^default_moss_side.png", + tileable_vertical = false}}, + groups = {cracky = 3}, + drop = "default:permafrost", + sounds = default.node_sound_dirt_defaults({ + footstep = {name = "default_grass_footstep", gain = 0.25}, + }), +}) + minetest.register_node("default:sand", { description = "Sand", tiles = {"default_sand.png"}, - groups = {crumbly = 3, sand = 1}, + groups = {crumbly = 3, falling_node = 1, sand = 1}, sounds = default.node_sound_sand_defaults(), }) minetest.register_node("default:desert_sand", { description = "Desert Sand", tiles = {"default_desert_sand.png"}, - groups = {crumbly = 3, sand = 1}, + groups = {crumbly = 3, falling_node = 1, sand = 1}, sounds = default.node_sound_sand_defaults(), }) minetest.register_node("default:silver_sand", { description = "Silver Sand", tiles = {"default_silver_sand.png"}, - groups = {crumbly = 3, sand = 1}, + groups = {crumbly = 3, falling_node = 1, sand = 1}, sounds = default.node_sound_sand_defaults(), }) @@ -450,11 +551,12 @@ minetest.register_node("default:silver_sand", { minetest.register_node("default:gravel", { description = "Gravel", tiles = {"default_gravel.png"}, - groups = {crumbly = 2}, + groups = {crumbly = 2, falling_node = 1}, sounds = default.node_sound_gravel_defaults(), drop = { max_items = 1, items = { + {items = {'default:flint'}, rarity = 16}, {items = {'default:gravel'}} } } @@ -484,12 +586,14 @@ minetest.register_node("default:snow", { {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5}, }, }, - groups = {crumbly = 3, puts_out_fire = 1, snowy = 1}, - sounds = default.node_sound_dirt_defaults({ - footstep = {name = "default_snow_footstep", gain = 0.15}, - dug = {name = "default_snow_footstep", gain = 0.2}, - dig = {name = "default_snow_footstep", gain = 0.2} - }), + collision_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, -7 / 16, 0.5}, + }, + }, + groups = {crumbly = 3, falling_node = 1, snowy = 1}, + sounds = default.node_sound_snow_defaults(), on_construct = function(pos) pos.y = pos.y - 1 @@ -502,12 +606,8 @@ minetest.register_node("default:snow", { minetest.register_node("default:snowblock", { description = "Snow Block", tiles = {"default_snow.png"}, - groups = {crumbly = 3, puts_out_fire = 1, cools_lava = 1, snowy = 1}, - sounds = default.node_sound_dirt_defaults({ - footstep = {name = "default_snow_footstep", gain = 0.15}, - dug = {name = "default_snow_footstep", gain = 0.2}, - dig = {name = "default_snow_footstep", gain = 0.2} - }), + groups = {crumbly = 3, cools_lava = 1, snowy = 1}, + sounds = default.node_sound_snow_defaults(), on_construct = function(pos) pos.y = pos.y - 1 @@ -517,12 +617,24 @@ minetest.register_node("default:snowblock", { end, }) +-- 'is ground content = false' to avoid tunnels in sea ice or ice rivers minetest.register_node("default:ice", { description = "Ice", tiles = {"default_ice.png"}, is_ground_content = false, paramtype = "light", - groups = {cracky = 3, puts_out_fire = 1, cools_lava = 1}, + groups = {cracky = 3, cools_lava = 1, slippery = 3}, + sounds = default.node_sound_glass_defaults(), +}) + +-- Mapgen-placed ice with 'is ground content = true' to contain tunnels +minetest.register_node("default:cave_ice", { + description = "Cave Ice", + tiles = {"default_ice.png"}, + paramtype = "light", + groups = {cracky = 3, cools_lava = 1, slippery = 3, + not_in_creative_inventory = 1}, + drop = "default:ice", sounds = default.node_sound_glass_defaults(), }) @@ -531,7 +643,7 @@ minetest.register_node("default:ice", { -- minetest.register_node("default:tree", { - description = "Tree", + description = "Apple Tree", tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"}, paramtype2 = "facedir", is_ground_content = false, @@ -542,7 +654,7 @@ minetest.register_node("default:tree", { }) minetest.register_node("default:wood", { - description = "Wooden Planks", + description = "Apple Wood Planks", paramtype2 = "facedir", place_param2 = 0, tiles = {"default_wood.png"}, @@ -551,8 +663,44 @@ minetest.register_node("default:wood", { sounds = default.node_sound_wood_defaults(), }) +minetest.register_node("default:sapling", { + description = "Apple Tree Sapling", + drawtype = "plantlike", + tiles = {"default_sapling.png"}, + inventory_image = "default_sapling.png", + wield_image = "default_sapling.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + on_timer = default.grow_sapling, + selection_box = { + type = "fixed", + fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16} + }, + groups = {snappy = 2, dig_immediate = 3, flammable = 2, + attached_node = 1, sapling = 1}, + sounds = default.node_sound_leaves_defaults(), + + on_construct = function(pos) + minetest.get_node_timer(pos):start(math.random(300, 1500)) + end, + + on_place = function(itemstack, placer, pointed_thing) + itemstack = default.sapling_on_place(itemstack, placer, pointed_thing, + "default:sapling", + -- minp, maxp to be checked, relative to sapling pos + -- minp_relative.y = 1 because sapling pos has been checked + {x = -3, y = 1, z = -3}, + {x = 3, y = 6, z = 3}, + -- maximum interval of interior volume check + 4) + + return itemstack + end, +}) + minetest.register_node("default:leaves", { - description = "Leaves", + description = "Apple Tree Leaves", drawtype = "allfaces_optional", waving = 1, tiles = {"default_leaves.png"}, @@ -560,6 +708,21 @@ minetest.register_node("default:leaves", { paramtype = "light", is_ground_content = false, groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1}, + drop = { + max_items = 1, + items = { + { + -- player will get sapling with 1/20 chance + items = {'default:sapling'}, + rarity = 20, + }, + { + -- player will get leaves only if he get no saplings, + -- this is because max_items is 1 + items = {'default:leaves'}, + } + } + }, sounds = default.node_sound_leaves_defaults(), after_place_node = default.after_place_leaves, @@ -570,7 +733,6 @@ minetest.register_node("default:apple", { drawtype = "plantlike", tiles = {"default_apple.png"}, inventory_image = "default_apple.png", - stack_max = 30, paramtype = "light", sunlight_propagates = true, walkable = false, @@ -580,17 +742,44 @@ minetest.register_node("default:apple", { fixed = {-3 / 16, -7 / 16, -3 / 16, 3 / 16, 4 / 16, 3 / 16} }, groups = {fleshy = 3, dig_immediate = 3, flammable = 2, - leafdecay = 3, leafdecay_drop = 1}, + leafdecay = 3, leafdecay_drop = 1, food_apple = 1}, on_use = minetest.item_eat(2), sounds = default.node_sound_leaves_defaults(), after_place_node = function(pos, placer, itemstack) - if placer:is_player() then - minetest.set_node(pos, {name = "default:apple", param2 = 1}) + minetest.set_node(pos, {name = "default:apple", param2 = 1}) + end, + + after_dig_node = function(pos, oldnode, oldmetadata, digger) + if oldnode.param2 == 0 then + minetest.set_node(pos, {name = "default:apple_mark"}) + minetest.get_node_timer(pos):start(math.random(300, 1500)) end end, }) +minetest.register_node("default:apple_mark", { + description = "Apple Marker", + drawtype = "airlike", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + pointable = false, + diggable = false, + buildable_to = true, + drop = "", + groups = {not_in_creative_inventory = 1}, + on_timer = function(pos, elapsed) + if not minetest.find_node_near(pos, 1, "default:leaves") then + minetest.remove_node(pos) + elseif minetest.get_node_light(pos) < 11 then + minetest.get_node_timer(pos):start(200) + else + minetest.set_node(pos, {name = "default:apple"}) + end + end +}) + minetest.register_node("default:jungletree", { description = "Jungle Tree", @@ -615,7 +804,7 @@ minetest.register_node("default:junglewood", { }) minetest.register_node("default:jungleleaves", { - description = "Jungle Leaves", + description = "Jungle Tree Leaves", drawtype = "allfaces_optional", waving = 1, tiles = {"default_jungleleaves.png"}, @@ -623,11 +812,89 @@ minetest.register_node("default:jungleleaves", { paramtype = "light", is_ground_content = false, groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1}, + drop = { + max_items = 1, + items = { + {items = {'default:junglesapling'}, rarity = 20}, + {items = {'default:jungleleaves'}} + } + }, sounds = default.node_sound_leaves_defaults(), after_place_node = default.after_place_leaves, }) +minetest.register_node("default:junglesapling", { + description = "Jungle Tree Sapling", + drawtype = "plantlike", + tiles = {"default_junglesapling.png"}, + inventory_image = "default_junglesapling.png", + wield_image = "default_junglesapling.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + on_timer = default.grow_sapling, + selection_box = { + type = "fixed", + fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16} + }, + groups = {snappy = 2, dig_immediate = 3, flammable = 2, + attached_node = 1, sapling = 1}, + sounds = default.node_sound_leaves_defaults(), + + on_construct = function(pos) + minetest.get_node_timer(pos):start(math.random(300, 1500)) + end, + + on_place = function(itemstack, placer, pointed_thing) + itemstack = default.sapling_on_place(itemstack, placer, pointed_thing, + "default:junglesapling", + -- minp, maxp to be checked, relative to sapling pos + -- minp_relative.y = 1 because sapling pos has been checked + {x = -2, y = 1, z = -2}, + {x = 2, y = 15, z = 2}, + -- maximum interval of interior volume check + 4) + + return itemstack + end, +}) + +minetest.register_node("default:emergent_jungle_sapling", { + description = "Emergent Jungle Tree Sapling", + drawtype = "plantlike", + tiles = {"default_emergent_jungle_sapling.png"}, + inventory_image = "default_emergent_jungle_sapling.png", + wield_image = "default_emergent_jungle_sapling.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + on_timer = default.grow_sapling, + selection_box = { + type = "fixed", + fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16} + }, + groups = {snappy = 2, dig_immediate = 3, flammable = 2, + attached_node = 1, sapling = 1}, + sounds = default.node_sound_leaves_defaults(), + + on_construct = function(pos) + minetest.get_node_timer(pos):start(math.random(300, 1500)) + end, + + on_place = function(itemstack, placer, pointed_thing) + itemstack = default.sapling_on_place(itemstack, placer, pointed_thing, + "default:emergent_jungle_sapling", + -- minp, maxp to be checked, relative to sapling pos + {x = -3, y = -5, z = -3}, + {x = 3, y = 31, z = 3}, + -- maximum interval of interior volume check + 4) + + return itemstack + end, +}) + minetest.register_node("default:pine_tree", { description = "Pine Tree", @@ -659,11 +926,55 @@ minetest.register_node("default:pine_needles",{ paramtype = "light", is_ground_content = false, groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1}, + drop = { + max_items = 1, + items = { + {items = {"default:pine_sapling"}, rarity = 20}, + {items = {"default:pine_needles"}} + } + }, sounds = default.node_sound_leaves_defaults(), after_place_node = default.after_place_leaves, }) +minetest.register_node("default:pine_sapling", { + description = "Pine Tree Sapling", + drawtype = "plantlike", + tiles = {"default_pine_sapling.png"}, + inventory_image = "default_pine_sapling.png", + wield_image = "default_pine_sapling.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + on_timer = default.grow_sapling, + selection_box = { + type = "fixed", + fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16} + }, + groups = {snappy = 2, dig_immediate = 3, flammable = 3, + attached_node = 1, sapling = 1}, + sounds = default.node_sound_leaves_defaults(), + + on_construct = function(pos) + minetest.get_node_timer(pos):start(math.random(300, 1500)) + end, + + on_place = function(itemstack, placer, pointed_thing) + itemstack = default.sapling_on_place(itemstack, placer, pointed_thing, + "default:pine_sapling", + -- minp, maxp to be checked, relative to sapling pos + -- minp_relative.y = 1 because sapling pos has been checked + {x = -2, y = 1, z = -2}, + {x = 2, y = 14, z = 2}, + -- maximum interval of interior volume check + 4) + + return itemstack + end, +}) + + minetest.register_node("default:acacia_tree", { description = "Acacia Tree", tiles = {"default_acacia_tree_top.png", "default_acacia_tree_top.png", @@ -687,7 +998,7 @@ minetest.register_node("default:acacia_wood", { }) minetest.register_node("default:acacia_leaves", { - description = "Acacia Leaves", + description = "Acacia Tree Leaves", drawtype = "allfaces_optional", tiles = {"default_acacia_leaves.png"}, special_tiles = {"default_acacia_leaves_simple.png"}, @@ -695,11 +1006,54 @@ minetest.register_node("default:acacia_leaves", { paramtype = "light", is_ground_content = false, groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1}, + drop = { + max_items = 1, + items = { + {items = {"default:acacia_sapling"}, rarity = 20}, + {items = {"default:acacia_leaves"}} + } + }, sounds = default.node_sound_leaves_defaults(), after_place_node = default.after_place_leaves, }) +minetest.register_node("default:acacia_sapling", { + description = "Acacia Tree Sapling", + drawtype = "plantlike", + tiles = {"default_acacia_sapling.png"}, + inventory_image = "default_acacia_sapling.png", + wield_image = "default_acacia_sapling.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + on_timer = default.grow_sapling, + selection_box = { + type = "fixed", + fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16} + }, + groups = {snappy = 2, dig_immediate = 3, flammable = 2, + attached_node = 1, sapling = 1}, + sounds = default.node_sound_leaves_defaults(), + + on_construct = function(pos) + minetest.get_node_timer(pos):start(math.random(300, 1500)) + end, + + on_place = function(itemstack, placer, pointed_thing) + itemstack = default.sapling_on_place(itemstack, placer, pointed_thing, + "default:acacia_sapling", + -- minp, maxp to be checked, relative to sapling pos + -- minp_relative.y = 1 because sapling pos has been checked + {x = -4, y = 1, z = -4}, + {x = 4, y = 7, z = 4}, + -- maximum interval of interior volume check + 4) + + return itemstack + end, +}) + minetest.register_node("default:aspen_tree", { description = "Aspen Tree", tiles = {"default_aspen_tree_top.png", "default_aspen_tree_top.png", @@ -723,18 +1077,61 @@ minetest.register_node("default:aspen_wood", { }) minetest.register_node("default:aspen_leaves", { - description = "Aspen Leaves", + description = "Aspen Tree Leaves", drawtype = "allfaces_optional", tiles = {"default_aspen_leaves.png"}, waving = 1, paramtype = "light", is_ground_content = false, groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1}, + drop = { + max_items = 1, + items = { + {items = {"default:aspen_sapling"}, rarity = 20}, + {items = {"default:aspen_leaves"}} + } + }, sounds = default.node_sound_leaves_defaults(), after_place_node = default.after_place_leaves, }) +minetest.register_node("default:aspen_sapling", { + description = "Aspen Tree Sapling", + drawtype = "plantlike", + tiles = {"default_aspen_sapling.png"}, + inventory_image = "default_aspen_sapling.png", + wield_image = "default_aspen_sapling.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + on_timer = default.grow_sapling, + selection_box = { + type = "fixed", + fixed = {-3 / 16, -0.5, -3 / 16, 3 / 16, 0.5, 3 / 16} + }, + groups = {snappy = 2, dig_immediate = 3, flammable = 3, + attached_node = 1, sapling = 1}, + sounds = default.node_sound_leaves_defaults(), + + on_construct = function(pos) + minetest.get_node_timer(pos):start(math.random(300, 1500)) + end, + + on_place = function(itemstack, placer, pointed_thing) + itemstack = default.sapling_on_place(itemstack, placer, pointed_thing, + "default:aspen_sapling", + -- minp, maxp to be checked, relative to sapling pos + -- minp_relative.y = 1 because sapling pos has been checked + {x = -2, y = 1, z = -2}, + {x = 2, y = 12, z = 2}, + -- maximum interval of interior volume check + 4) + + return itemstack + end, +}) + -- -- Ores -- @@ -764,6 +1161,15 @@ minetest.register_node("default:stone_with_iron", { sounds = default.node_sound_stone_defaults(), }) +minetest.register_node("default:steelblock", { + description = "Steel Block", + tiles = {"default_steel_block.png"}, + is_ground_content = false, + groups = {cracky = 1, level = 2}, + sounds = default.node_sound_metal_defaults(), +}) + + minetest.register_node("default:stone_with_copper", { description = "Copper Ore", tiles = {"default_stone.png^default_mineral_copper.png"}, @@ -772,6 +1178,15 @@ minetest.register_node("default:stone_with_copper", { sounds = default.node_sound_stone_defaults(), }) +minetest.register_node("default:copperblock", { + description = "Copper Block", + tiles = {"default_copper_block.png"}, + is_ground_content = false, + groups = {cracky = 1, level = 2}, + sounds = default.node_sound_metal_defaults(), +}) + + minetest.register_node("default:stone_with_tin", { description = "Tin Ore", tiles = {"default_stone.png^default_mineral_tin.png"}, @@ -780,6 +1195,15 @@ minetest.register_node("default:stone_with_tin", { sounds = default.node_sound_stone_defaults(), }) +minetest.register_node("default:tinblock", { + description = "Tin Block", + tiles = {"default_tin_block.png"}, + is_ground_content = false, + groups = {cracky = 1, level = 2}, + sounds = default.node_sound_metal_defaults(), +}) + + minetest.register_node("default:bronzeblock", { description = "Bronze Block", tiles = {"default_bronze_block.png"}, @@ -788,6 +1212,7 @@ minetest.register_node("default:bronzeblock", { sounds = default.node_sound_metal_defaults(), }) + minetest.register_node("default:stone_with_mese", { description = "Mese Ore", tiles = {"default_stone.png^default_mineral_mese.png"}, @@ -805,6 +1230,24 @@ minetest.register_node("default:mese", { light_source = 3, }) + +minetest.register_node("default:stone_with_gold", { + description = "Gold Ore", + tiles = {"default_stone.png^default_mineral_gold.png"}, + groups = {cracky = 2}, + drop = "default:gold_lump", + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("default:goldblock", { + description = "Gold Block", + tiles = {"default_gold_block.png"}, + is_ground_content = false, + groups = {cracky = 1}, + sounds = default.node_sound_metal_defaults(), +}) + + minetest.register_node("default:stone_with_diamond", { description = "Diamond Ore", tiles = {"default_stone.png^default_mineral_diamond.png"}, @@ -813,6 +1256,14 @@ minetest.register_node("default:stone_with_diamond", { sounds = default.node_sound_stone_defaults(), }) +minetest.register_node("default:diamondblock", { + description = "Diamond Block", + tiles = {"default_diamond_block.png"}, + is_ground_content = false, + groups = {cracky = 1, level = 3}, + sounds = default.node_sound_stone_defaults(), +}) + -- -- Plantlife (non-cubic) -- @@ -827,6 +1278,77 @@ minetest.register_node("default:cactus", { on_place = minetest.rotate_node, }) +minetest.register_node("default:large_cactus_seedling", { + description = "Large Cactus Seedling", + drawtype = "plantlike", + tiles = {"default_large_cactus_seedling.png"}, + inventory_image = "default_large_cactus_seedling.png", + wield_image = "default_large_cactus_seedling.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + selection_box = { + type = "fixed", + fixed = { + -5 / 16, -0.5, -5 / 16, + 5 / 16, 0.5, 5 / 16 + } + }, + groups = {choppy = 3, dig_immediate = 3, attached_node = 1}, + sounds = default.node_sound_wood_defaults(), + + on_place = function(itemstack, placer, pointed_thing) + itemstack = default.sapling_on_place(itemstack, placer, pointed_thing, + "default:large_cactus_seedling", + {x = -2, y = -1, z = -2}, + {x = 2, y = 5, z = 2}, + 4) + + return itemstack + end, + + on_construct = function(pos) + -- Normal cactus farming adds 1 cactus node by ABM, + -- interval 12s, chance 83. + -- Consider starting with 5 cactus nodes. We make sure that growing a + -- large cactus is not a faster way to produce new cactus nodes. + -- Confirmed by experiment, when farming 5 cacti, on average 1 new + -- cactus node is added on average every + -- 83 / 5 = 16.6 intervals = 16.6 * 12 = 199.2s. + -- Large cactus contains on average 14 cactus nodes. + -- 14 * 199.2 = 2788.8s. + -- Set random range to average to 2789s. + minetest.get_node_timer(pos):start(math.random(1859, 3719)) + end, + + on_timer = function(pos) + local node_under = minetest.get_node_or_nil( + {x = pos.x, y = pos.y - 1, z = pos.z}) + if not node_under then + -- Node under not yet loaded, try later + minetest.get_node_timer(pos):start(300) + return + end + + if minetest.get_item_group(node_under.name, "sand") == 0 then + -- Seedling dies + minetest.remove_node(pos) + return + end + + local light_level = minetest.get_node_light(pos) + if not light_level or light_level < 13 then + -- Too dark for growth, try later in case it's night + minetest.get_node_timer(pos):start(300) + return + end + + minetest.log("action", "A large cactus seedling grows into a large" .. + "cactus at ".. minetest.pos_to_string(pos)) + default.grow_large_cactus(pos) + end, +}) + minetest.register_node("default:papyrus", { description = "Papyrus", drawtype = "plantlike", @@ -848,6 +1370,795 @@ minetest.register_node("default:papyrus", { end, }) +minetest.register_node("default:dry_shrub", { + description = "Dry Shrub", + drawtype = "plantlike", + waving = 1, + tiles = {"default_dry_shrub.png"}, + inventory_image = "default_dry_shrub.png", + wield_image = "default_dry_shrub.png", + paramtype = "light", + paramtype2 = "meshoptions", + place_param2 = 4, + sunlight_propagates = true, + walkable = false, + buildable_to = true, + groups = {snappy = 3, flammable = 3, attached_node = 1}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 4 / 16, 6 / 16}, + }, +}) + +minetest.register_node("default:junglegrass", { + description = "Jungle Grass", + drawtype = "plantlike", + waving = 1, + visual_scale = 1.69, + tiles = {"default_junglegrass.png"}, + inventory_image = "default_junglegrass.png", + wield_image = "default_junglegrass.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 1}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16}, + }, +}) + + +minetest.register_node("default:grass_1", { + description = "Grass", + drawtype = "plantlike", + waving = 1, + tiles = {"default_grass_1.png"}, + -- Use texture of a taller grass stage in inventory + inventory_image = "default_grass_3.png", + wield_image = "default_grass_3.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1, flammable = 1}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -5 / 16, 6 / 16}, + }, + + on_place = function(itemstack, placer, pointed_thing) + -- place a random grass node + local stack = ItemStack("default:grass_" .. math.random(1,5)) + local ret = minetest.item_place(stack, placer, pointed_thing) + return ItemStack("default:grass_1 " .. + itemstack:get_count() - (1 - ret:get_count())) + end, +}) + +for i = 2, 5 do + minetest.register_node("default:grass_" .. i, { + description = "Grass", + drawtype = "plantlike", + waving = 1, + tiles = {"default_grass_" .. i .. ".png"}, + inventory_image = "default_grass_" .. i .. ".png", + wield_image = "default_grass_" .. i .. ".png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + drop = "default:grass_1", + groups = {snappy = 3, flora = 1, attached_node = 1, + not_in_creative_inventory = 1, grass = 1, flammable = 1}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -3 / 16, 6 / 16}, + }, + }) +end + + +minetest.register_node("default:dry_grass_1", { + description = "Dry Grass", + drawtype = "plantlike", + waving = 1, + tiles = {"default_dry_grass_1.png"}, + inventory_image = "default_dry_grass_3.png", + wield_image = "default_dry_grass_3.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + groups = {snappy = 3, flammable = 3, flora = 1, + attached_node = 1, dry_grass = 1}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -3 / 16, 6 / 16}, + }, + + on_place = function(itemstack, placer, pointed_thing) + -- place a random dry grass node + local stack = ItemStack("default:dry_grass_" .. math.random(1, 5)) + local ret = minetest.item_place(stack, placer, pointed_thing) + return ItemStack("default:dry_grass_1 " .. + itemstack:get_count() - (1 - ret:get_count())) + end, +}) + +for i = 2, 5 do + minetest.register_node("default:dry_grass_" .. i, { + description = "Dry Grass", + drawtype = "plantlike", + waving = 1, + tiles = {"default_dry_grass_" .. i .. ".png"}, + inventory_image = "default_dry_grass_" .. i .. ".png", + wield_image = "default_dry_grass_" .. i .. ".png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1, + not_in_creative_inventory=1, dry_grass = 1}, + drop = "default:dry_grass_1", + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -1 / 16, 6 / 16}, + }, + }) +end + + +minetest.register_node("default:fern_1", { + description = "Fern", + drawtype = "plantlike", + waving = 1, + tiles = {"default_fern_1.png"}, + inventory_image = "default_fern_1.png", + wield_image = "default_fern_1.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -0.25, 6 / 16}, + }, + + on_place = function(itemstack, placer, pointed_thing) + -- place a random fern node + local stack = ItemStack("default:fern_" .. math.random(1, 3)) + local ret = minetest.item_place(stack, placer, pointed_thing) + return ItemStack("default:fern_1 " .. + itemstack:get_count() - (1 - ret:get_count())) + end, +}) + +for i = 2, 3 do + minetest.register_node("default:fern_" .. i, { + description = "Fern", + drawtype = "plantlike", + waving = 1, + visual_scale = 2, + tiles = {"default_fern_" .. i .. ".png"}, + inventory_image = "default_fern_" .. i .. ".png", + wield_image = "default_fern_" .. i .. ".png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1, + not_in_creative_inventory=1}, + drop = "default:fern_1", + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -0.25, 6 / 16}, + }, + }) +end + + +minetest.register_node("default:marram_grass_1", { + description = "Marram Grass", + drawtype = "plantlike", + waving = 1, + tiles = {"default_marram_grass_1.png"}, + inventory_image = "default_marram_grass_1.png", + wield_image = "default_marram_grass_1.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + groups = {snappy = 3, flammable = 3, attached_node = 1}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -0.25, 6 / 16}, + }, + + on_place = function(itemstack, placer, pointed_thing) + -- place a random marram grass node + local stack = ItemStack("default:marram_grass_" .. math.random(1, 3)) + local ret = minetest.item_place(stack, placer, pointed_thing) + return ItemStack("default:marram_grass_1 " .. + itemstack:get_count() - (1 - ret:get_count())) + end, +}) + +for i = 2, 3 do + minetest.register_node("default:marram_grass_" .. i, { + description = "Marram Grass", + drawtype = "plantlike", + waving = 1, + tiles = {"default_marram_grass_" .. i .. ".png"}, + inventory_image = "default_marram_grass_" .. i .. ".png", + wield_image = "default_marram_grass_" .. i .. ".png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + groups = {snappy = 3, flammable = 3, attached_node = 1, + not_in_creative_inventory=1}, + drop = "default:marram_grass_1", + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -0.25, 6 / 16}, + }, + }) +end + + +minetest.register_node("default:bush_stem", { + description = "Bush Stem", + drawtype = "plantlike", + visual_scale = 1.41, + tiles = {"default_bush_stem.png"}, + inventory_image = "default_bush_stem.png", + wield_image = "default_bush_stem.png", + paramtype = "light", + sunlight_propagates = true, + groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, + sounds = default.node_sound_wood_defaults(), + selection_box = { + type = "fixed", + fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.5, 7 / 16}, + }, +}) + +minetest.register_node("default:bush_leaves", { + description = "Bush Leaves", + drawtype = "allfaces_optional", + waving = 1, + tiles = {"default_leaves_simple.png"}, + paramtype = "light", + groups = {snappy = 3, flammable = 2, leaves = 1}, + drop = { + max_items = 1, + items = { + {items = {"default:bush_sapling"}, rarity = 5}, + {items = {"default:bush_leaves"}} + } + }, + sounds = default.node_sound_leaves_defaults(), + + after_place_node = default.after_place_leaves, +}) + +minetest.register_node("default:bush_sapling", { + description = "Bush Sapling", + drawtype = "plantlike", + tiles = {"default_bush_sapling.png"}, + inventory_image = "default_bush_sapling.png", + wield_image = "default_bush_sapling.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + on_timer = default.grow_sapling, + selection_box = { + type = "fixed", + fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 2 / 16, 4 / 16} + }, + groups = {snappy = 2, dig_immediate = 3, flammable = 2, + attached_node = 1, sapling = 1}, + sounds = default.node_sound_leaves_defaults(), + + on_construct = function(pos) + minetest.get_node_timer(pos):start(math.random(300, 1500)) + end, + + on_place = function(itemstack, placer, pointed_thing) + itemstack = default.sapling_on_place(itemstack, placer, pointed_thing, + "default:bush_sapling", + -- minp, maxp to be checked, relative to sapling pos + {x = -1, y = 0, z = -1}, + {x = 1, y = 1, z = 1}, + -- maximum interval of interior volume check + 2) + + return itemstack + end, +}) + +minetest.register_node("default:blueberry_bush_leaves_with_berries", { + description = "Blueberry Bush Leaves with Berries", + drawtype = "allfaces_optional", + waving = 1, + tiles = {"default_blueberry_bush_leaves.png^default_blueberry_overlay.png"}, + paramtype = "light", + groups = {snappy = 3, flammable = 2, leaves = 1, dig_immediate = 3}, + drop = "default:blueberries", + sounds = default.node_sound_leaves_defaults(), + node_dig_prediction = "default:blueberry_bush_leaves", + + after_dig_node = function(pos, oldnode, oldmetadata, digger) + minetest.set_node(pos, {name = "default:blueberry_bush_leaves"}) + minetest.get_node_timer(pos):start(math.random(300, 1500)) + end, +}) + +minetest.register_node("default:blueberry_bush_leaves", { + description = "Blueberry Bush Leaves", + drawtype = "allfaces_optional", + waving = 1, + tiles = {"default_blueberry_bush_leaves.png"}, + paramtype = "light", + groups = {snappy = 3, flammable = 2, leaves = 1}, + drop = { + max_items = 1, + items = { + {items = {"default:blueberry_bush_sapling"}, rarity = 5}, + {items = {"default:blueberry_bush_leaves"}} + } + }, + sounds = default.node_sound_leaves_defaults(), + + on_timer = function(pos, elapsed) + if minetest.get_node_light(pos) < 11 then + minetest.get_node_timer(pos):start(200) + else + minetest.set_node(pos, {name = "default:blueberry_bush_leaves_with_berries"}) + end + end, + + after_place_node = default.after_place_leaves, +}) + +minetest.register_node("default:blueberry_bush_sapling", { + description = "Blueberry Bush Sapling", + drawtype = "plantlike", + tiles = {"default_blueberry_bush_sapling.png"}, + inventory_image = "default_blueberry_bush_sapling.png", + wield_image = "default_blueberry_bush_sapling.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + on_timer = default.grow_sapling, + selection_box = { + type = "fixed", + fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 2 / 16, 4 / 16} + }, + groups = {snappy = 2, dig_immediate = 3, flammable = 2, + attached_node = 1, sapling = 1}, + sounds = default.node_sound_leaves_defaults(), + + on_construct = function(pos) + minetest.get_node_timer(pos):start(math.random(300, 1500)) + end, + + on_place = function(itemstack, placer, pointed_thing) + itemstack = default.sapling_on_place(itemstack, placer, pointed_thing, + "default:blueberry_bush_sapling", + -- minp, maxp to be checked, relative to sapling pos + {x = -1, y = 0, z = -1}, + {x = 1, y = 1, z = 1}, + -- maximum interval of interior volume check + 2) + + return itemstack + end, +}) + +minetest.register_node("default:acacia_bush_stem", { + description = "Acacia Bush Stem", + drawtype = "plantlike", + visual_scale = 1.41, + tiles = {"default_acacia_bush_stem.png"}, + inventory_image = "default_acacia_bush_stem.png", + wield_image = "default_acacia_bush_stem.png", + paramtype = "light", + sunlight_propagates = true, + groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, + sounds = default.node_sound_wood_defaults(), + selection_box = { + type = "fixed", + fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.5, 7 / 16}, + }, +}) + +minetest.register_node("default:acacia_bush_leaves", { + description = "Acacia Bush Leaves", + drawtype = "allfaces_optional", + waving = 1, + tiles = {"default_acacia_leaves_simple.png"}, + paramtype = "light", + groups = {snappy = 3, flammable = 2, leaves = 1}, + drop = { + max_items = 1, + items = { + {items = {"default:acacia_bush_sapling"}, rarity = 5}, + {items = {"default:acacia_bush_leaves"}} + } + }, + sounds = default.node_sound_leaves_defaults(), + + after_place_node = default.after_place_leaves, +}) + +minetest.register_node("default:acacia_bush_sapling", { + description = "Acacia Bush Sapling", + drawtype = "plantlike", + tiles = {"default_acacia_bush_sapling.png"}, + inventory_image = "default_acacia_bush_sapling.png", + wield_image = "default_acacia_bush_sapling.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + on_timer = default.grow_sapling, + selection_box = { + type = "fixed", + fixed = {-3 / 16, -0.5, -3 / 16, 3 / 16, 2 / 16, 3 / 16} + }, + groups = {snappy = 2, dig_immediate = 3, flammable = 2, + attached_node = 1, sapling = 1}, + sounds = default.node_sound_leaves_defaults(), + + on_construct = function(pos) + minetest.get_node_timer(pos):start(math.random(300, 1500)) + end, + + on_place = function(itemstack, placer, pointed_thing) + itemstack = default.sapling_on_place(itemstack, placer, pointed_thing, + "default:acacia_bush_sapling", + -- minp, maxp to be checked, relative to sapling pos + {x = -1, y = 0, z = -1}, + {x = 1, y = 1, z = 1}, + -- maximum interval of interior volume check + 2) + + return itemstack + end, +}) + +minetest.register_node("default:pine_bush_stem", { + description = "Pine Bush Stem", + drawtype = "plantlike", + visual_scale = 1.41, + tiles = {"default_pine_bush_stem.png"}, + inventory_image = "default_pine_bush_stem.png", + wield_image = "default_pine_bush_stem.png", + paramtype = "light", + sunlight_propagates = true, + groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, + sounds = default.node_sound_wood_defaults(), + selection_box = { + type = "fixed", + fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.5, 7 / 16}, + }, +}) + +minetest.register_node("default:pine_bush_needles", { + description = "Pine Bush Needles", + drawtype = "allfaces_optional", + waving = 1, + tiles = {"default_pine_needles.png"}, + paramtype = "light", + groups = {snappy = 3, flammable = 2, leaves = 1}, + drop = { + max_items = 1, + items = { + {items = {"default:pine_bush_sapling"}, rarity = 5}, + {items = {"default:pine_bush_needles"}} + } + }, + sounds = default.node_sound_leaves_defaults(), + + after_place_node = default.after_place_leaves, +}) + +minetest.register_node("default:pine_bush_sapling", { + description = "Pine Bush Sapling", + drawtype = "plantlike", + tiles = {"default_pine_bush_sapling.png"}, + inventory_image = "default_pine_bush_sapling.png", + wield_image = "default_pine_bush_sapling.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + on_timer = default.grow_sapling, + selection_box = { + type = "fixed", + fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 2 / 16, 4 / 16} + }, + groups = {snappy = 2, dig_immediate = 3, flammable = 2, + attached_node = 1, sapling = 1}, + sounds = default.node_sound_leaves_defaults(), + + on_construct = function(pos) + minetest.get_node_timer(pos):start(math.random(300, 1500)) + end, + + on_place = function(itemstack, placer, pointed_thing) + itemstack = default.sapling_on_place(itemstack, placer, pointed_thing, + "default:pine_bush_sapling", + -- minp, maxp to be checked, relative to sapling pos + {x = -1, y = 0, z = -1}, + {x = 1, y = 1, z = 1}, + -- maximum interval of interior volume check + 2) + + return itemstack + end, +}) + +minetest.register_node("default:sand_with_kelp", { + description = "Kelp", + drawtype = "plantlike_rooted", + waving = 1, + tiles = {"default_sand.png"}, + special_tiles = {{name = "default_kelp.png", tileable_vertical = true}}, + inventory_image = "default_kelp.png", + paramtype = "light", + paramtype2 = "leveled", + groups = {snappy = 3}, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, + {-2/16, 0.5, -2/16, 2/16, 3.5, 2/16}, + }, + }, + node_dig_prediction = "default:sand", + node_placement_prediction = "", + + on_place = function(itemstack, placer, pointed_thing) + -- Call on_rightclick if the pointed node defines it + if pointed_thing.type == "node" and placer and + not placer:get_player_control().sneak then + local node_ptu = minetest.get_node(pointed_thing.under) + local def_ptu = minetest.registered_nodes[node_ptu.name] + if def_ptu and def_ptu.on_rightclick then + return def_ptu.on_rightclick(pointed_thing.under, node_ptu, placer, + itemstack, pointed_thing) + end + end + + local pos = pointed_thing.under + if minetest.get_node(pos).name ~= "default:sand" then + return itemstack + end + + local height = math.random(4, 6) + local pos_top = {x = pos.x, y = pos.y + height, z = pos.z} + local node_top = minetest.get_node(pos_top) + local def_top = minetest.registered_nodes[node_top.name] + local player_name = placer:get_player_name() + + if def_top and def_top.liquidtype == "source" and + minetest.get_item_group(node_top.name, "water") > 0 then + if not minetest.is_protected(pos, player_name) and + not minetest.is_protected(pos_top, player_name) then + minetest.set_node(pos, {name = "default:sand_with_kelp", + param2 = height * 16}) + if not (creative and creative.is_enabled_for + and creative.is_enabled_for(player_name)) then + itemstack:take_item() + end + else + minetest.chat_send_player(player_name, "Node is protected") + minetest.record_protection_violation(pos, player_name) + end + end + + return itemstack + end, + + after_destruct = function(pos, oldnode) + minetest.set_node(pos, {name = "default:sand"}) + end +}) + + +-- +-- Corals +-- + +minetest.register_node("default:coral_green", { + description = "Green Coral", + drawtype = "plantlike_rooted", + waving = 1, + paramtype = "light", + tiles = {"default_coral_skeleton.png"}, + special_tiles = {{name = "default_coral_green.png", tileable_vertical = true}}, + inventory_image = "default_coral_green.png", + groups = {snappy = 3}, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, + {-4/16, 0.5, -4/16, 4/16, 1.5, 4/16}, + }, + }, + node_dig_prediction = "default:coral_skeleton", + node_placement_prediction = "", + on_place = function(itemstack, placer, pointed_thing) + if pointed_thing.type ~= "node" or not placer then + return itemstack + end + + local player_name = placer:get_player_name() + local pos_under = pointed_thing.under + local pos_above = pointed_thing.above + + if minetest.get_node(pos_under).name ~= "default:coral_skeleton" or + minetest.get_node(pos_above).name ~= "default:water_source" then + return itemstack + end + + if minetest.is_protected(pos_under, player_name) or + minetest.is_protected(pos_above, player_name) then + minetest.chat_send_player(player_name, "Node is protected") + minetest.record_protection_violation(pos_under, player_name) + return itemstack + end + + minetest.set_node(pos_under, {name = "default:coral_green"}) + if not (creative and creative.is_enabled_for(player_name)) then + itemstack:take_item() + end + + return itemstack + end, + after_destruct = function(pos, oldnode) + minetest.set_node(pos, {name = "default:coral_skeleton"}) + end, +}) + +minetest.register_node("default:coral_pink", { + description = "Pink Coral", + drawtype = "plantlike_rooted", + waving = 1, + paramtype = "light", + tiles = {"default_coral_skeleton.png"}, + special_tiles = {{name = "default_coral_pink.png", tileable_vertical = true}}, + inventory_image = "default_coral_pink.png", + groups = {snappy = 3}, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, + {-4/16, 0.5, -4/16, 4/16, 1.5, 4/16}, + }, + }, + node_dig_prediction = "default:coral_skeleton", + node_placement_prediction = "", + on_place = function(itemstack, placer, pointed_thing) + if pointed_thing.type ~= "node" or not placer then + return itemstack + end + + local player_name = placer:get_player_name() + local pos_under = pointed_thing.under + local pos_above = pointed_thing.above + + if minetest.get_node(pos_under).name ~= "default:coral_skeleton" or + minetest.get_node(pos_above).name ~= "default:water_source" then + return itemstack + end + + if minetest.is_protected(pos_under, player_name) or + minetest.is_protected(pos_above, player_name) then + minetest.chat_send_player(player_name, "Node is protected") + minetest.record_protection_violation(pos_under, player_name) + return itemstack + end + + minetest.set_node(pos_under, {name = "default:coral_pink"}) + if not (creative and creative.is_enabled_for(player_name)) then + itemstack:take_item() + end + + return itemstack + end, + after_destruct = function(pos, oldnode) + minetest.set_node(pos, {name = "default:coral_skeleton"}) + end, +}) + +minetest.register_node("default:coral_cyan", { + description = "Cyan Coral", + drawtype = "plantlike_rooted", + waving = 1, + paramtype = "light", + tiles = {"default_coral_skeleton.png"}, + special_tiles = {{name = "default_coral_cyan.png", tileable_vertical = true}}, + inventory_image = "default_coral_cyan.png", + groups = {snappy = 3}, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, + {-4/16, 0.5, -4/16, 4/16, 1.5, 4/16}, + }, + }, + node_dig_prediction = "default:coral_skeleton", + node_placement_prediction = "", + on_place = function(itemstack, placer, pointed_thing) + if pointed_thing.type ~= "node" or not placer then + return itemstack + end + + local player_name = placer:get_player_name() + local pos_under = pointed_thing.under + local pos_above = pointed_thing.above + + if minetest.get_node(pos_under).name ~= "default:coral_skeleton" or + minetest.get_node(pos_above).name ~= "default:water_source" then + return itemstack + end + + if minetest.is_protected(pos_under, player_name) or + minetest.is_protected(pos_above, player_name) then + minetest.chat_send_player(player_name, "Node is protected") + minetest.record_protection_violation(pos_under, player_name) + return itemstack + end + + minetest.set_node(pos_under, {name = "default:coral_cyan"}) + if not (creative and creative.is_enabled_for(player_name)) then + itemstack:take_item() + end + + return itemstack + end, + after_destruct = function(pos, oldnode) + minetest.set_node(pos, {name = "default:coral_skeleton"}) + end, +}) + +minetest.register_node("default:coral_brown", { + description = "Brown Coral", + tiles = {"default_coral_brown.png"}, + groups = {cracky = 3}, + drop = "default:coral_skeleton", + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("default:coral_orange", { + description = "Orange Coral", + tiles = {"default_coral_orange.png"}, + groups = {cracky = 3}, + drop = "default:coral_skeleton", + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("default:coral_skeleton", { + description = "Coral Skeleton", + tiles = {"default_coral_skeleton.png"}, + groups = {cracky = 3}, + sounds = default.node_sound_stone_defaults(), +}) + -- -- Liquids @@ -859,6 +2170,7 @@ minetest.register_node("default:water_source", { tiles = { { name = "default_water_source_animated.png", + backface_culling = false, animation = { type = "vertical_frames", aspect_w = 16, @@ -866,18 +2178,15 @@ minetest.register_node("default:water_source", { length = 2.0, }, }, - }, - special_tiles = { - -- New-style water source material (mostly unused) { name = "default_water_source_animated.png", + backface_culling = true, animation = { type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 2.0, }, - backface_culling = false, }, }, alpha = 160, @@ -894,7 +2203,7 @@ minetest.register_node("default:water_source", { liquid_alternative_source = "default:water_source", liquid_viscosity = 1, post_effect_color = {a = 103, r = 30, g = 60, b = 90}, - groups = {water = 3, liquid = 3, puts_out_fire = 1, cools_lava = 1}, + groups = {water = 3, liquid = 3, cools_lava = 1}, sounds = default.node_sound_water_defaults(), }) @@ -939,8 +2248,8 @@ minetest.register_node("default:water_flowing", { liquid_alternative_source = "default:water_source", liquid_viscosity = 1, post_effect_color = {a = 103, r = 30, g = 60, b = 90}, - groups = {water = 3, liquid = 3, puts_out_fire = 1, - not_in_creative_inventory = 1, cools_lava = 1}, + groups = {water = 3, liquid = 3, not_in_creative_inventory = 1, + cools_lava = 1}, sounds = default.node_sound_water_defaults(), }) @@ -951,6 +2260,7 @@ minetest.register_node("default:river_water_source", { tiles = { { name = "default_river_water_source_animated.png", + backface_culling = false, animation = { type = "vertical_frames", aspect_w = 16, @@ -958,17 +2268,15 @@ minetest.register_node("default:river_water_source", { length = 2.0, }, }, - }, - special_tiles = { { name = "default_river_water_source_animated.png", + backface_culling = true, animation = { type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 2.0, }, - backface_culling = false, }, }, alpha = 160, @@ -984,10 +2292,14 @@ minetest.register_node("default:river_water_source", { liquid_alternative_flowing = "default:river_water_flowing", liquid_alternative_source = "default:river_water_source", liquid_viscosity = 1, + -- Not renewable to avoid horizontal spread of water sources in sloping + -- rivers that can cause water to overflow riverbanks and cause floods. + -- River water source is instead made renewable by the 'force renew' + -- option used in the 'bucket' mod by the river water bucket. liquid_renewable = false, liquid_range = 2, post_effect_color = {a = 103, r = 30, g = 76, b = 90}, - groups = {water = 3, liquid = 3, puts_out_fire = 1, cools_lava = 1}, + groups = {water = 3, liquid = 3, cools_lava = 1}, sounds = default.node_sound_water_defaults(), }) @@ -1034,8 +2346,8 @@ minetest.register_node("default:river_water_flowing", { liquid_renewable = false, liquid_range = 2, post_effect_color = {a = 103, r = 30, g = 76, b = 90}, - groups = {water = 3, liquid = 3, puts_out_fire = 1, - not_in_creative_inventory = 1, cools_lava = 1}, + groups = {water = 3, liquid = 3, not_in_creative_inventory = 1, + cools_lava = 1}, sounds = default.node_sound_water_defaults(), }) @@ -1046,6 +2358,7 @@ minetest.register_node("default:lava_source", { tiles = { { name = "default_lava_source_animated.png", + backface_culling = false, animation = { type = "vertical_frames", aspect_w = 16, @@ -1053,18 +2366,15 @@ minetest.register_node("default:lava_source", { length = 3.0, }, }, - }, - special_tiles = { - -- New-style lava source material (mostly unused) { name = "default_lava_source_animated.png", + backface_culling = true, animation = { type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 3.0, }, - backface_culling = false, }, }, paramtype = "light", @@ -1126,7 +2436,6 @@ minetest.register_node("default:lava_flowing", { liquid_alternative_flowing = "default:lava_flowing", liquid_alternative_source = "default:lava_source", liquid_viscosity = 7, - liquid_range = 2, liquid_renewable = false, damage_per_second = 4 * 2, post_effect_color = {a = 191, r = 255, g = 64, b = 0}, @@ -1134,6 +2443,159 @@ minetest.register_node("default:lava_flowing", { not_in_creative_inventory = 1}, }) +-- +-- Tools / "Advanced" crafting / Non-"natural" +-- + +local bookshelf_formspec = + "size[8,7;]" .. + "list[context;books;0,0.3;8,2;]" .. + "list[current_player;main;0,2.85;8,1;]" .. + "list[current_player;main;0,4.08;8,3;8]" .. + "listring[context;books]" .. + "listring[current_player;main]" .. + default.get_hotbar_bg(0,2.85) + +local function update_bookshelf(pos) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local invlist = inv:get_list("books") + + local formspec = bookshelf_formspec + -- Inventory slots overlay + local bx, by = 0, 0.3 + local n_written, n_empty = 0, 0 + for i = 1, 16 do + if i == 9 then + bx = 0 + by = by + 1 + end + local stack = invlist[i] + if stack:is_empty() then + formspec = formspec .. + "image[" .. bx .. "," .. by .. ";1,1;default_bookshelf_slot.png]" + else + local metatable = stack:get_meta():to_table() or {} + if metatable.fields and metatable.fields.text then + n_written = n_written + stack:get_count() + else + n_empty = n_empty + stack:get_count() + end + end + bx = bx + 1 + end + meta:set_string("formspec", formspec) + if n_written + n_empty == 0 then + meta:set_string("infotext", "Empty Bookshelf") + else + meta:set_string("infotext", "Bookshelf (" .. n_written .. + " written, " .. n_empty .. " empty books)") + end +end + +minetest.register_node("default:bookshelf", { + description = "Bookshelf", + tiles = {"default_wood.png", "default_wood.png", "default_wood.png", + "default_wood.png", "default_bookshelf.png", "default_bookshelf.png"}, + paramtype2 = "facedir", + is_ground_content = false, + groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3}, + sounds = default.node_sound_wood_defaults(), + + on_construct = function(pos) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + inv:set_size("books", 8 * 2) + update_bookshelf(pos) + end, + can_dig = function(pos,player) + local inv = minetest.get_meta(pos):get_inventory() + return inv:is_empty("books") + end, + allow_metadata_inventory_put = function(pos, listname, index, stack) + if minetest.get_item_group(stack:get_name(), "book") ~= 0 then + return stack:get_count() + end + return 0 + end, + on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + minetest.log("action", player:get_player_name() .. + " moves stuff in bookshelf at " .. minetest.pos_to_string(pos)) + update_bookshelf(pos) + end, + on_metadata_inventory_put = function(pos, listname, index, stack, player) + minetest.log("action", player:get_player_name() .. + " puts stuff to bookshelf at " .. minetest.pos_to_string(pos)) + update_bookshelf(pos) + end, + on_metadata_inventory_take = function(pos, listname, index, stack, player) + minetest.log("action", player:get_player_name() .. + " takes stuff from bookshelf at " .. minetest.pos_to_string(pos)) + update_bookshelf(pos) + end, + on_blast = function(pos) + local drops = {} + default.get_inventory_drops(pos, "books", drops) + drops[#drops+1] = "default:bookshelf" + minetest.remove_node(pos) + return drops + end, +}) + +local function register_sign(material, desc, def) + minetest.register_node("default:sign_wall_" .. material, { + description = desc .. " Sign", + drawtype = "nodebox", + tiles = {"default_sign_wall_" .. material .. ".png"}, + inventory_image = "default_sign_" .. material .. ".png", + wield_image = "default_sign_" .. material .. ".png", + paramtype = "light", + paramtype2 = "wallmounted", + sunlight_propagates = true, + is_ground_content = false, + walkable = false, + node_box = { + type = "wallmounted", + wall_top = {-0.4375, 0.4375, -0.3125, 0.4375, 0.5, 0.3125}, + wall_bottom = {-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125}, + wall_side = {-0.5, -0.3125, -0.4375, -0.4375, 0.3125, 0.4375}, + }, + groups = def.groups, + legacy_wallmounted = true, + sounds = def.sounds, + + on_construct = function(pos) + --local n = minetest.get_node(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec", "field[text;;${text}]") + end, + on_receive_fields = function(pos, formname, fields, sender) + --print("Sign at "..minetest.pos_to_string(pos).." got "..dump(fields)) + local player_name = sender:get_player_name() + if minetest.is_protected(pos, player_name) then + minetest.record_protection_violation(pos, player_name) + return + end + local meta = minetest.get_meta(pos) + if not fields.text then return end + minetest.log("action", (player_name or "") .. " wrote \"" .. + fields.text .. "\" to sign at " .. minetest.pos_to_string(pos)) + meta:set_string("text", fields.text) + meta:set_string("infotext", '"' .. fields.text .. '"') + end, + }) +end + +register_sign("wood", "Wooden", { + sounds = default.node_sound_wood_defaults(), + groups = {choppy = 2, attached_node = 1, flammable = 2, oddly_breakable_by_hand = 3} +}) + +register_sign("steel", "Steel", { + sounds = default.node_sound_metal_defaults(), + groups = {cracky = 2, attached_node = 1} +}) + minetest.register_node("default:ladder_wood", { description = "Wooden Ladder", drawtype = "signlike", @@ -1157,21 +2619,47 @@ minetest.register_node("default:ladder_wood", { sounds = default.node_sound_wood_defaults(), }) +minetest.register_node("default:ladder_steel", { + description = "Steel Ladder", + drawtype = "signlike", + tiles = {"default_ladder_steel.png"}, + inventory_image = "default_ladder_steel.png", + wield_image = "default_ladder_steel.png", + paramtype = "light", + paramtype2 = "wallmounted", + sunlight_propagates = true, + walkable = false, + climbable = true, + is_ground_content = false, + selection_box = { + type = "wallmounted", + --wall_top = = + --wall_bottom = = + --wall_side = = + }, + groups = {cracky = 2}, + sounds = default.node_sound_metal_defaults(), +}) + default.register_fence("default:fence_wood", { - description = "Wooden Fence", + description = "Apple Wood Fence", texture = "default_fence_wood.png", - inventory_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126", - wield_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126", + inventory_image = "default_fence_overlay.png^default_wood.png^" .. + "default_fence_overlay.png^[makealpha:255,126,126", + wield_image = "default_fence_overlay.png^default_wood.png^" .. + "default_fence_overlay.png^[makealpha:255,126,126", material = "default:wood", groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, sounds = default.node_sound_wood_defaults() }) default.register_fence("default:fence_acacia_wood", { - description = "Acacia Fence", + description = "Acacia Wood Fence", texture = "default_fence_acacia_wood.png", - inventory_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126", - wield_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126", + inventory_image = "default_fence_overlay.png^default_acacia_wood.png^" .. + "default_fence_overlay.png^[makealpha:255,126,126", + wield_image = "default_fence_overlay.png^default_acacia_wood.png^" .. + "default_fence_overlay.png^[makealpha:255,126,126", material = "default:acacia_wood", groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, sounds = default.node_sound_wood_defaults() @@ -1180,33 +2668,99 @@ default.register_fence("default:fence_acacia_wood", { default.register_fence("default:fence_junglewood", { description = "Jungle Wood Fence", texture = "default_fence_junglewood.png", - inventory_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126", - wield_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126", + inventory_image = "default_fence_overlay.png^default_junglewood.png^" .. + "default_fence_overlay.png^[makealpha:255,126,126", + wield_image = "default_fence_overlay.png^default_junglewood.png^" .. + "default_fence_overlay.png^[makealpha:255,126,126", material = "default:junglewood", groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, sounds = default.node_sound_wood_defaults() }) default.register_fence("default:fence_pine_wood", { - description = "Pine Fence", + description = "Pine Wood Fence", texture = "default_fence_pine_wood.png", - inventory_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126", - wield_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126", + inventory_image = "default_fence_overlay.png^default_pine_wood.png^" .. + "default_fence_overlay.png^[makealpha:255,126,126", + wield_image = "default_fence_overlay.png^default_pine_wood.png^" .. + "default_fence_overlay.png^[makealpha:255,126,126", material = "default:pine_wood", groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3}, sounds = default.node_sound_wood_defaults() }) default.register_fence("default:fence_aspen_wood", { - description = "Aspen Fence", + description = "Aspen Wood Fence", texture = "default_fence_aspen_wood.png", - inventory_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126", - wield_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126", + inventory_image = "default_fence_overlay.png^default_aspen_wood.png^" .. + "default_fence_overlay.png^[makealpha:255,126,126", + wield_image = "default_fence_overlay.png^default_aspen_wood.png^" .. + "default_fence_overlay.png^[makealpha:255,126,126", material = "default:aspen_wood", groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3}, sounds = default.node_sound_wood_defaults() }) +default.register_fence_rail("default:fence_rail_wood", { + description = "Apple Wood Fence Rail", + texture = "default_fence_rail_wood.png", + inventory_image = "default_fence_rail_overlay.png^default_wood.png^" .. + "default_fence_rail_overlay.png^[makealpha:255,126,126", + wield_image = "default_fence_rail_overlay.png^default_wood.png^" .. + "default_fence_rail_overlay.png^[makealpha:255,126,126", + material = "default:wood", + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + sounds = default.node_sound_wood_defaults() +}) + +default.register_fence_rail("default:fence_rail_acacia_wood", { + description = "Acacia Wood Fence Rail", + texture = "default_fence_rail_acacia_wood.png", + inventory_image = "default_fence_rail_overlay.png^default_acacia_wood.png^" .. + "default_fence_rail_overlay.png^[makealpha:255,126,126", + wield_image = "default_fence_rail_overlay.png^default_acacia_wood.png^" .. + "default_fence_rail_overlay.png^[makealpha:255,126,126", + material = "default:acacia_wood", + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + sounds = default.node_sound_wood_defaults() +}) + +default.register_fence_rail("default:fence_rail_junglewood", { + description = "Jungle Wood Fence Rail", + texture = "default_fence_rail_junglewood.png", + inventory_image = "default_fence_rail_overlay.png^default_junglewood.png^" .. + "default_fence_rail_overlay.png^[makealpha:255,126,126", + wield_image = "default_fence_rail_overlay.png^default_junglewood.png^" .. + "default_fence_rail_overlay.png^[makealpha:255,126,126", + material = "default:junglewood", + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + sounds = default.node_sound_wood_defaults() +}) + +default.register_fence_rail("default:fence_rail_pine_wood", { + description = "Pine Wood Fence Rail", + texture = "default_fence_rail_pine_wood.png", + inventory_image = "default_fence_rail_overlay.png^default_pine_wood.png^" .. + "default_fence_rail_overlay.png^[makealpha:255,126,126", + wield_image = "default_fence_rail_overlay.png^default_pine_wood.png^" .. + "default_fence_rail_overlay.png^[makealpha:255,126,126", + material = "default:pine_wood", + groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3}, + sounds = default.node_sound_wood_defaults() +}) + +default.register_fence_rail("default:fence_rail_aspen_wood", { + description = "Aspen Wood Fence Rail", + texture = "default_fence_rail_aspen_wood.png", + inventory_image = "default_fence_rail_overlay.png^default_aspen_wood.png^" .. + "default_fence_rail_overlay.png^[makealpha:255,126,126", + wield_image = "default_fence_rail_overlay.png^default_aspen_wood.png^" .. + "default_fence_rail_overlay.png^[makealpha:255,126,126", + material = "default:aspen_wood", + groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 2}, + sounds = default.node_sound_wood_defaults() +}) + minetest.register_node("default:glass", { description = "Glass", drawtype = "glasslike_framed_optional", @@ -1219,6 +2773,19 @@ minetest.register_node("default:glass", { sounds = default.node_sound_glass_defaults(), }) +minetest.register_node("default:obsidian_glass", { + description = "Obsidian Glass", + drawtype = "glasslike_framed_optional", + tiles = {"default_obsidian_glass.png", "default_obsidian_glass_detail.png"}, + paramtype = "light", + paramtype2 = "glasslikeliquidlevel", + is_ground_content = false, + sunlight_propagates = true, + sounds = default.node_sound_glass_defaults(), + groups = {cracky = 3}, +}) + + minetest.register_node("default:brick", { description = "Brick Block", paramtype2 = "facedir", @@ -1229,6 +2796,7 @@ minetest.register_node("default:brick", { sounds = default.node_sound_stone_defaults(), }) + minetest.register_node("default:meselamp", { description = "Mese Lamp", drawtype = "glasslike", @@ -1241,6 +2809,39 @@ minetest.register_node("default:meselamp", { light_source = default.LIGHT_MAX, }) +minetest.register_node("default:mese_post_light", { + description = "Mese Post Light", + tiles = {"default_mese_post_light_top.png", "default_mese_post_light_top.png", + "default_mese_post_light_side_dark.png", "default_mese_post_light_side_dark.png", + "default_mese_post_light_side.png", "default_mese_post_light_side.png"}, + wield_image = "default_mese_post_light_side.png", + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-2 / 16, -8 / 16, -2 / 16, 2 / 16, 8 / 16, 2 / 16}, + }, + }, + paramtype = "light", + light_source = default.LIGHT_MAX, + sunlight_propagates = true, + is_ground_content = false, + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + sounds = default.node_sound_wood_defaults(), +}) + +-- +-- Misc +-- + +minetest.register_node("default:cloud", { + description = "Cloud", + tiles = {"default_cloud.png"}, + is_ground_content = false, + sounds = default.node_sound_defaults(), + groups = {not_in_creative_inventory = 1}, +}) + -- -- register trees for leafdecay -- @@ -1257,12 +2858,6 @@ if minetest.get_mapgen_setting("mg_name") == "v6" then leaves = {"default:jungleleaves"}, radius = 3, }) - - default.register_leafdecay({ - trunks = {"default:pine_tree"}, - leaves = {"default:pine_needles"}, - radius = 3, - }) else default.register_leafdecay({ trunks = {"default:tree"}, @@ -1275,14 +2870,14 @@ else leaves = {"default:jungleleaves"}, radius = 2, }) - - default.register_leafdecay({ - trunks = {"default:pine_tree"}, - leaves = {"default:pine_needles"}, - radius = 2, - }) end +default.register_leafdecay({ + trunks = {"default:pine_tree"}, + leaves = {"default:pine_needles"}, + radius = 3, +}) + default.register_leafdecay({ trunks = {"default:acacia_tree"}, leaves = {"default:acacia_leaves"}, @@ -1294,3 +2889,21 @@ default.register_leafdecay({ leaves = {"default:aspen_leaves"}, radius = 3, }) + +default.register_leafdecay({ + trunks = {"default:bush_stem"}, + leaves = {"default:bush_leaves"}, + radius = 1, +}) + +default.register_leafdecay({ + trunks = {"default:acacia_bush_stem"}, + leaves = {"default:acacia_bush_leaves"}, + radius = 1, +}) + +default.register_leafdecay({ + trunks = {"default:pine_bush_stem"}, + leaves = {"default:pine_bush_needles"}, + radius = 1, +}) diff --git a/mods/mtg/default/schematics/acacia_bush.mts b/mods/mtg/default/schematics/acacia_bush.mts deleted file mode 100644 index df95586..0000000 Binary files a/mods/mtg/default/schematics/acacia_bush.mts and /dev/null differ diff --git a/mods/mtg/default/schematics/acacia_log.mts b/mods/mtg/default/schematics/acacia_log.mts deleted file mode 100644 index 037bca8..0000000 Binary files a/mods/mtg/default/schematics/acacia_log.mts and /dev/null differ diff --git a/mods/mtg/default/schematics/acacia_tree.mts b/mods/mtg/default/schematics/acacia_tree.mts deleted file mode 100644 index 4732ade..0000000 Binary files a/mods/mtg/default/schematics/acacia_tree.mts and /dev/null differ diff --git a/mods/mtg/default/schematics/acacia_tree_from_sapling.mts b/mods/mtg/default/schematics/acacia_tree_from_sapling.mts deleted file mode 100644 index 23e8e4b..0000000 Binary files a/mods/mtg/default/schematics/acacia_tree_from_sapling.mts and /dev/null differ diff --git a/mods/mtg/default/schematics/apple_log.mts b/mods/mtg/default/schematics/apple_log.mts deleted file mode 100644 index e7ee8f2..0000000 Binary files a/mods/mtg/default/schematics/apple_log.mts and /dev/null differ diff --git a/mods/mtg/default/schematics/apple_tree.mts b/mods/mtg/default/schematics/apple_tree.mts deleted file mode 100644 index 2bd57c1..0000000 Binary files a/mods/mtg/default/schematics/apple_tree.mts and /dev/null differ diff --git a/mods/mtg/default/schematics/apple_tree_from_sapling.mts b/mods/mtg/default/schematics/apple_tree_from_sapling.mts deleted file mode 100644 index d258ab1..0000000 Binary files a/mods/mtg/default/schematics/apple_tree_from_sapling.mts and /dev/null differ diff --git a/mods/mtg/default/schematics/aspen_log.mts b/mods/mtg/default/schematics/aspen_log.mts deleted file mode 100644 index 180e6fd..0000000 Binary files a/mods/mtg/default/schematics/aspen_log.mts and /dev/null differ diff --git a/mods/mtg/default/schematics/aspen_tree.mts b/mods/mtg/default/schematics/aspen_tree.mts deleted file mode 100644 index 429a831..0000000 Binary files a/mods/mtg/default/schematics/aspen_tree.mts and /dev/null differ diff --git a/mods/mtg/default/schematics/aspen_tree_from_sapling.mts b/mods/mtg/default/schematics/aspen_tree_from_sapling.mts deleted file mode 100644 index b7ab3ee..0000000 Binary files a/mods/mtg/default/schematics/aspen_tree_from_sapling.mts and /dev/null differ diff --git a/mods/mtg/default/schematics/bush.mts b/mods/mtg/default/schematics/bush.mts deleted file mode 100644 index d08cf5f..0000000 Binary files a/mods/mtg/default/schematics/bush.mts and /dev/null differ diff --git a/mods/mtg/default/schematics/corals.mts b/mods/mtg/default/schematics/corals.mts deleted file mode 100644 index e1bd7de..0000000 Binary files a/mods/mtg/default/schematics/corals.mts and /dev/null differ diff --git a/mods/mtg/default/schematics/jungle_log.mts b/mods/mtg/default/schematics/jungle_log.mts deleted file mode 100644 index 54fa16d..0000000 Binary files a/mods/mtg/default/schematics/jungle_log.mts and /dev/null differ diff --git a/mods/mtg/default/schematics/jungle_tree.mts b/mods/mtg/default/schematics/jungle_tree.mts deleted file mode 100644 index 01a1b11..0000000 Binary files a/mods/mtg/default/schematics/jungle_tree.mts and /dev/null differ diff --git a/mods/mtg/default/schematics/jungle_tree_from_sapling.mts b/mods/mtg/default/schematics/jungle_tree_from_sapling.mts deleted file mode 100644 index f93f014..0000000 Binary files a/mods/mtg/default/schematics/jungle_tree_from_sapling.mts and /dev/null differ diff --git a/mods/mtg/default/schematics/large_cactus.mts b/mods/mtg/default/schematics/large_cactus.mts deleted file mode 100644 index b71077b..0000000 Binary files a/mods/mtg/default/schematics/large_cactus.mts and /dev/null differ diff --git a/mods/mtg/default/schematics/papyrus.mts b/mods/mtg/default/schematics/papyrus.mts deleted file mode 100644 index 1333a7c..0000000 Binary files a/mods/mtg/default/schematics/papyrus.mts and /dev/null differ diff --git a/mods/mtg/default/schematics/pine_log.mts b/mods/mtg/default/schematics/pine_log.mts deleted file mode 100644 index 744c38b..0000000 Binary files a/mods/mtg/default/schematics/pine_log.mts and /dev/null differ diff --git a/mods/mtg/default/schematics/pine_tree.mts b/mods/mtg/default/schematics/pine_tree.mts deleted file mode 100644 index 6f27d83..0000000 Binary files a/mods/mtg/default/schematics/pine_tree.mts and /dev/null differ diff --git a/mods/mtg/default/schematics/pine_tree_from_sapling.mts b/mods/mtg/default/schematics/pine_tree_from_sapling.mts deleted file mode 100644 index e42a996..0000000 Binary files a/mods/mtg/default/schematics/pine_tree_from_sapling.mts and /dev/null differ diff --git a/mods/mtg/default/schematics/snowy_pine_tree_from_sapling.mts b/mods/mtg/default/schematics/snowy_pine_tree_from_sapling.mts deleted file mode 100644 index 0692049..0000000 Binary files a/mods/mtg/default/schematics/snowy_pine_tree_from_sapling.mts and /dev/null differ diff --git a/mods/mtg/default/sounds/default_chest_close.ogg b/mods/mtg/default/sounds/default_chest_close.ogg index 53ff23d..068d900 100644 Binary files a/mods/mtg/default/sounds/default_chest_close.ogg and b/mods/mtg/default/sounds/default_chest_close.ogg differ diff --git a/mods/mtg/default/sounds/default_chest_open.ogg b/mods/mtg/default/sounds/default_chest_open.ogg index c73c072..40b0b93 100644 Binary files a/mods/mtg/default/sounds/default_chest_open.ogg and b/mods/mtg/default/sounds/default_chest_open.ogg differ diff --git a/mods/mtg/default/sounds/default_dirt_footstep.1.ogg b/mods/mtg/default/sounds/default_dirt_footstep.1.ogg index 84a197d..201aa3b 100644 Binary files a/mods/mtg/default/sounds/default_dirt_footstep.1.ogg and b/mods/mtg/default/sounds/default_dirt_footstep.1.ogg differ diff --git a/mods/mtg/default/sounds/default_dirt_footstep.2.ogg b/mods/mtg/default/sounds/default_dirt_footstep.2.ogg index 2e23b8a..2667dbc 100644 Binary files a/mods/mtg/default/sounds/default_dirt_footstep.2.ogg and b/mods/mtg/default/sounds/default_dirt_footstep.2.ogg differ diff --git a/mods/mtg/default/sounds/default_snow_footstep.1.ogg b/mods/mtg/default/sounds/default_snow_footstep.1.ogg index 3260b91..97cc825 100644 Binary files a/mods/mtg/default/sounds/default_snow_footstep.1.ogg and b/mods/mtg/default/sounds/default_snow_footstep.1.ogg differ diff --git a/mods/mtg/default/sounds/default_snow_footstep.2.ogg b/mods/mtg/default/sounds/default_snow_footstep.2.ogg index 4aac1e7..97a6baa 100644 Binary files a/mods/mtg/default/sounds/default_snow_footstep.2.ogg and b/mods/mtg/default/sounds/default_snow_footstep.2.ogg differ diff --git a/mods/mtg/default/sounds/default_snow_footstep.3.ogg b/mods/mtg/default/sounds/default_snow_footstep.3.ogg index cf4235b..bde1f21 100644 Binary files a/mods/mtg/default/sounds/default_snow_footstep.3.ogg and b/mods/mtg/default/sounds/default_snow_footstep.3.ogg differ diff --git a/mods/mtg/default/sounds/default_snow_footstep.4.ogg b/mods/mtg/default/sounds/default_snow_footstep.4.ogg new file mode 100644 index 0000000..8ca6a59 Binary files /dev/null and b/mods/mtg/default/sounds/default_snow_footstep.4.ogg differ diff --git a/mods/mtg/default/sounds/default_snow_footstep.5.ogg b/mods/mtg/default/sounds/default_snow_footstep.5.ogg new file mode 100644 index 0000000..220d60c Binary files /dev/null and b/mods/mtg/default/sounds/default_snow_footstep.5.ogg differ diff --git a/mods/mtg/default/textures/default_blueberries.png b/mods/mtg/default/textures/default_blueberries.png new file mode 100644 index 0000000..1dbb0d6 Binary files /dev/null and b/mods/mtg/default/textures/default_blueberries.png differ diff --git a/mods/mtg/default/textures/default_blueberry_bush_leaves.png b/mods/mtg/default/textures/default_blueberry_bush_leaves.png new file mode 100644 index 0000000..2cd112c Binary files /dev/null and b/mods/mtg/default/textures/default_blueberry_bush_leaves.png differ diff --git a/mods/mtg/default/textures/default_blueberry_bush_sapling.png b/mods/mtg/default/textures/default_blueberry_bush_sapling.png new file mode 100644 index 0000000..5d7393f Binary files /dev/null and b/mods/mtg/default/textures/default_blueberry_bush_sapling.png differ diff --git a/mods/mtg/default/textures/default_blueberry_overlay.png b/mods/mtg/default/textures/default_blueberry_overlay.png new file mode 100644 index 0000000..de9de62 Binary files /dev/null and b/mods/mtg/default/textures/default_blueberry_overlay.png differ diff --git a/mods/mtg/default/textures/default_book.png b/mods/mtg/default/textures/default_book.png index 448a7df..bcf1e6a 100644 Binary files a/mods/mtg/default/textures/default_book.png and b/mods/mtg/default/textures/default_book.png differ diff --git a/mods/mtg/default/textures/default_book_written.png b/mods/mtg/default/textures/default_book_written.png index 9196ac6..f23d122 100644 Binary files a/mods/mtg/default/textures/default_book_written.png and b/mods/mtg/default/textures/default_book_written.png differ diff --git a/mods/mtg/default/textures/default_bookshelf_slot.png b/mods/mtg/default/textures/default_bookshelf_slot.png index 715a3dc..cd2c8bc 100644 Binary files a/mods/mtg/default/textures/default_bookshelf_slot.png and b/mods/mtg/default/textures/default_bookshelf_slot.png differ diff --git a/mods/mtg/default/textures/default_clay_brick.png b/mods/mtg/default/textures/default_clay_brick.png index dc7a431..b288ef0 100644 Binary files a/mods/mtg/default/textures/default_clay_brick.png and b/mods/mtg/default/textures/default_clay_brick.png differ diff --git a/mods/mtg/default/textures/default_coniferous_litter.png b/mods/mtg/default/textures/default_coniferous_litter.png new file mode 100644 index 0000000..da340e0 Binary files /dev/null and b/mods/mtg/default/textures/default_coniferous_litter.png differ diff --git a/mods/mtg/default/textures/default_coniferous_litter_side.png b/mods/mtg/default/textures/default_coniferous_litter_side.png new file mode 100644 index 0000000..0701461 Binary files /dev/null and b/mods/mtg/default/textures/default_coniferous_litter_side.png differ diff --git a/mods/mtg/default/textures/default_coral_cyan.png b/mods/mtg/default/textures/default_coral_cyan.png new file mode 100644 index 0000000..11cc7bf Binary files /dev/null and b/mods/mtg/default/textures/default_coral_cyan.png differ diff --git a/mods/mtg/default/textures/default_coral_green.png b/mods/mtg/default/textures/default_coral_green.png new file mode 100644 index 0000000..847c572 Binary files /dev/null and b/mods/mtg/default/textures/default_coral_green.png differ diff --git a/mods/mtg/default/textures/default_coral_pink.png b/mods/mtg/default/textures/default_coral_pink.png new file mode 100644 index 0000000..62d70c6 Binary files /dev/null and b/mods/mtg/default/textures/default_coral_pink.png differ diff --git a/mods/mtg/default/textures/default_desert_cobble.png b/mods/mtg/default/textures/default_desert_cobble.png index 184a9d8..fa1af5d 100644 Binary files a/mods/mtg/default/textures/default_desert_cobble.png and b/mods/mtg/default/textures/default_desert_cobble.png differ diff --git a/mods/mtg/default/textures/default_dirt.png b/mods/mtg/default/textures/default_dirt.png index ca7e4ae..afe4a2e 100644 Binary files a/mods/mtg/default/textures/default_dirt.png and b/mods/mtg/default/textures/default_dirt.png differ diff --git a/mods/mtg/default/textures/default_emergent_jungle_sapling.png b/mods/mtg/default/textures/default_emergent_jungle_sapling.png new file mode 100644 index 0000000..b363b3c Binary files /dev/null and b/mods/mtg/default/textures/default_emergent_jungle_sapling.png differ diff --git a/mods/mtg/default/textures/default_fence_rail_acacia_wood.png b/mods/mtg/default/textures/default_fence_rail_acacia_wood.png new file mode 100644 index 0000000..64dc90f Binary files /dev/null and b/mods/mtg/default/textures/default_fence_rail_acacia_wood.png differ diff --git a/mods/mtg/default/textures/default_fence_rail_aspen_wood.png b/mods/mtg/default/textures/default_fence_rail_aspen_wood.png new file mode 100644 index 0000000..ab16a60 Binary files /dev/null and b/mods/mtg/default/textures/default_fence_rail_aspen_wood.png differ diff --git a/mods/mtg/default/textures/default_fence_rail_junglewood.png b/mods/mtg/default/textures/default_fence_rail_junglewood.png new file mode 100644 index 0000000..ebc1ef0 Binary files /dev/null and b/mods/mtg/default/textures/default_fence_rail_junglewood.png differ diff --git a/mods/mtg/default/textures/default_fence_rail_overlay.png b/mods/mtg/default/textures/default_fence_rail_overlay.png new file mode 100644 index 0000000..4da47ae Binary files /dev/null and b/mods/mtg/default/textures/default_fence_rail_overlay.png differ diff --git a/mods/mtg/default/textures/default_fence_rail_pine_wood.png b/mods/mtg/default/textures/default_fence_rail_pine_wood.png new file mode 100644 index 0000000..fd8d99d Binary files /dev/null and b/mods/mtg/default/textures/default_fence_rail_pine_wood.png differ diff --git a/mods/mtg/default/textures/default_fence_rail_wood.png b/mods/mtg/default/textures/default_fence_rail_wood.png new file mode 100644 index 0000000..f84b755 Binary files /dev/null and b/mods/mtg/default/textures/default_fence_rail_wood.png differ diff --git a/mods/mtg/default/textures/default_fern_1.png b/mods/mtg/default/textures/default_fern_1.png new file mode 100644 index 0000000..b307986 Binary files /dev/null and b/mods/mtg/default/textures/default_fern_1.png differ diff --git a/mods/mtg/default/textures/default_fern_2.png b/mods/mtg/default/textures/default_fern_2.png new file mode 100644 index 0000000..6c5f7d5 Binary files /dev/null and b/mods/mtg/default/textures/default_fern_2.png differ diff --git a/mods/mtg/default/textures/default_fern_3.png b/mods/mtg/default/textures/default_fern_3.png new file mode 100644 index 0000000..2c1f605 Binary files /dev/null and b/mods/mtg/default/textures/default_fern_3.png differ diff --git a/mods/mtg/default/textures/default_furnace_bottom.png b/mods/mtg/default/textures/default_furnace_bottom.png new file mode 100644 index 0000000..b79ed06 Binary files /dev/null and b/mods/mtg/default/textures/default_furnace_bottom.png differ diff --git a/mods/mtg/default/textures/default_furnace_fire_bg.png b/mods/mtg/default/textures/default_furnace_fire_bg.png new file mode 100644 index 0000000..126204a Binary files /dev/null and b/mods/mtg/default/textures/default_furnace_fire_bg.png differ diff --git a/mods/mtg/default/textures/default_furnace_fire_fg.png b/mods/mtg/default/textures/default_furnace_fire_fg.png new file mode 100644 index 0000000..63888f3 Binary files /dev/null and b/mods/mtg/default/textures/default_furnace_fire_fg.png differ diff --git a/mods/mtg/default/textures/default_furnace_front.png b/mods/mtg/default/textures/default_furnace_front.png new file mode 100644 index 0000000..8c1798e Binary files /dev/null and b/mods/mtg/default/textures/default_furnace_front.png differ diff --git a/mods/mtg/default/textures/default_furnace_front_active.png b/mods/mtg/default/textures/default_furnace_front_active.png new file mode 100644 index 0000000..ea43ed9 Binary files /dev/null and b/mods/mtg/default/textures/default_furnace_front_active.png differ diff --git a/mods/mtg/default/textures/default_furnace_side.png b/mods/mtg/default/textures/default_furnace_side.png new file mode 100644 index 0000000..33408cf Binary files /dev/null and b/mods/mtg/default/textures/default_furnace_side.png differ diff --git a/mods/mtg/default/textures/default_furnace_top.png b/mods/mtg/default/textures/default_furnace_top.png new file mode 100644 index 0000000..b79ed06 Binary files /dev/null and b/mods/mtg/default/textures/default_furnace_top.png differ diff --git a/mods/mtg/default/textures/default_glass.png b/mods/mtg/default/textures/default_glass.png index da25402..74d6a02 100644 Binary files a/mods/mtg/default/textures/default_glass.png and b/mods/mtg/default/textures/default_glass.png differ diff --git a/mods/mtg/default/textures/default_glass_detail.png b/mods/mtg/default/textures/default_glass_detail.png index d38dbb7..811a4db 100644 Binary files a/mods/mtg/default/textures/default_glass_detail.png and b/mods/mtg/default/textures/default_glass_detail.png differ diff --git a/mods/mtg/default/textures/default_kelp.png b/mods/mtg/default/textures/default_kelp.png new file mode 100644 index 0000000..70b743d Binary files /dev/null and b/mods/mtg/default/textures/default_kelp.png differ diff --git a/mods/mtg/default/textures/default_large_cactus_seedling.png b/mods/mtg/default/textures/default_large_cactus_seedling.png new file mode 100644 index 0000000..378351a Binary files /dev/null and b/mods/mtg/default/textures/default_large_cactus_seedling.png differ diff --git a/mods/mtg/default/textures/default_marram_grass_1.png b/mods/mtg/default/textures/default_marram_grass_1.png new file mode 100644 index 0000000..73ec9e9 Binary files /dev/null and b/mods/mtg/default/textures/default_marram_grass_1.png differ diff --git a/mods/mtg/default/textures/default_marram_grass_2.png b/mods/mtg/default/textures/default_marram_grass_2.png new file mode 100644 index 0000000..2db75c7 Binary files /dev/null and b/mods/mtg/default/textures/default_marram_grass_2.png differ diff --git a/mods/mtg/default/textures/default_marram_grass_3.png b/mods/mtg/default/textures/default_marram_grass_3.png new file mode 100644 index 0000000..f6c155f Binary files /dev/null and b/mods/mtg/default/textures/default_marram_grass_3.png differ diff --git a/mods/mtg/default/textures/default_mese_post_light_top.png b/mods/mtg/default/textures/default_mese_post_light_top.png index 6834bd3..365c1a7 100644 Binary files a/mods/mtg/default/textures/default_mese_post_light_top.png and b/mods/mtg/default/textures/default_mese_post_light_top.png differ diff --git a/mods/mtg/default/textures/default_moss.png b/mods/mtg/default/textures/default_moss.png new file mode 100644 index 0000000..479038e Binary files /dev/null and b/mods/mtg/default/textures/default_moss.png differ diff --git a/mods/mtg/default/textures/default_moss_side.png b/mods/mtg/default/textures/default_moss_side.png new file mode 100644 index 0000000..4a20345 Binary files /dev/null and b/mods/mtg/default/textures/default_moss_side.png differ diff --git a/mods/mtg/default/textures/default_obsidian.png b/mods/mtg/default/textures/default_obsidian.png new file mode 100644 index 0000000..8f4a49c Binary files /dev/null and b/mods/mtg/default/textures/default_obsidian.png differ diff --git a/mods/mtg/default/textures/default_obsidian_block.png b/mods/mtg/default/textures/default_obsidian_block.png new file mode 100644 index 0000000..7e1d4d3 Binary files /dev/null and b/mods/mtg/default/textures/default_obsidian_block.png differ diff --git a/mods/mtg/default/textures/default_obsidian_brick.png b/mods/mtg/default/textures/default_obsidian_brick.png new file mode 100644 index 0000000..30c67ca Binary files /dev/null and b/mods/mtg/default/textures/default_obsidian_brick.png differ diff --git a/mods/mtg/default/textures/default_obsidian_glass.png b/mods/mtg/default/textures/default_obsidian_glass.png new file mode 100644 index 0000000..d5ac83d Binary files /dev/null and b/mods/mtg/default/textures/default_obsidian_glass.png differ diff --git a/mods/mtg/default/textures/default_obsidian_glass_detail.png b/mods/mtg/default/textures/default_obsidian_glass_detail.png new file mode 100644 index 0000000..a8bbec9 Binary files /dev/null and b/mods/mtg/default/textures/default_obsidian_glass_detail.png differ diff --git a/mods/mtg/default/textures/default_obsidian_shard.png b/mods/mtg/default/textures/default_obsidian_shard.png new file mode 100644 index 0000000..a988d8c Binary files /dev/null and b/mods/mtg/default/textures/default_obsidian_shard.png differ diff --git a/mods/mtg/default/textures/default_permafrost.png b/mods/mtg/default/textures/default_permafrost.png new file mode 100644 index 0000000..f1edbab Binary files /dev/null and b/mods/mtg/default/textures/default_permafrost.png differ diff --git a/mods/mtg/default/textures/default_pine_bush_sapling.png b/mods/mtg/default/textures/default_pine_bush_sapling.png new file mode 100644 index 0000000..fadeff8 Binary files /dev/null and b/mods/mtg/default/textures/default_pine_bush_sapling.png differ diff --git a/mods/mtg/default/textures/default_pine_bush_stem.png b/mods/mtg/default/textures/default_pine_bush_stem.png new file mode 100644 index 0000000..e239f81 Binary files /dev/null and b/mods/mtg/default/textures/default_pine_bush_stem.png differ diff --git a/mods/mtg/default/textures/default_pine_needles.png b/mods/mtg/default/textures/default_pine_needles.png index ad7373b..f699727 100644 Binary files a/mods/mtg/default/textures/default_pine_needles.png and b/mods/mtg/default/textures/default_pine_needles.png differ diff --git a/mods/mtg/default/textures/default_stones.png b/mods/mtg/default/textures/default_stones.png new file mode 100644 index 0000000..09c5ee1 Binary files /dev/null and b/mods/mtg/default/textures/default_stones.png differ diff --git a/mods/mtg/default/textures/gui_hotbar.png b/mods/mtg/default/textures/gui_hotbar.png deleted file mode 100644 index 73fb3ca..0000000 Binary files a/mods/mtg/default/textures/gui_hotbar.png and /dev/null differ diff --git a/mods/mtg/default/textures/gui_hotbar_selected.png b/mods/mtg/default/textures/gui_hotbar_selected.png deleted file mode 100644 index 40bafe6..0000000 Binary files a/mods/mtg/default/textures/gui_hotbar_selected.png and /dev/null differ diff --git a/mods/mtg/default/tools.lua b/mods/mtg/default/tools.lua index 5a39615..9f503ed 100644 --- a/mods/mtg/default/tools.lua +++ b/mods/mtg/default/tools.lua @@ -50,6 +50,20 @@ minetest.register_tool("default:pick_stone", { sound = {breaks = "default_tool_breaks"}, }) +minetest.register_tool("default:pick_bronze", { + description = "Bronze Pickaxe", + inventory_image = "default_tool_bronzepick.png", + tool_capabilities = { + full_punch_interval = 1.0, + max_drop_level=1, + groupcaps={ + cracky = {times={[1]=4.50, [2]=1.80, [3]=0.90}, uses=20, maxlevel=2}, + }, + damage_groups = {fleshy=4}, + }, + sound = {breaks = "default_tool_breaks"}, +}) + minetest.register_tool("default:pick_steel", { description = "Steel Pickaxe", inventory_image = "default_tool_steelpick.png", @@ -64,20 +78,6 @@ minetest.register_tool("default:pick_steel", { sound = {breaks = "default_tool_breaks"}, }) -minetest.register_tool("default:pick_bronze", { - description = "Bronze Pickaxe", - inventory_image = "default_tool_bronzepick.png", - tool_capabilities = { - full_punch_interval = 1.0, - max_drop_level=1, - groupcaps={ - cracky = {times={[1]=4.00, [2]=1.60, [3]=0.80}, uses=30, maxlevel=2}, - }, - damage_groups = {fleshy=4}, - }, - sound = {breaks = "default_tool_breaks"}, -}) - minetest.register_tool("default:pick_mese", { description = "Mese Pickaxe", inventory_image = "default_tool_mesepick.png", @@ -141,6 +141,21 @@ minetest.register_tool("default:shovel_stone", { sound = {breaks = "default_tool_breaks"}, }) +minetest.register_tool("default:shovel_bronze", { + description = "Bronze Shovel", + inventory_image = "default_tool_bronzeshovel.png", + wield_image = "default_tool_bronzeshovel.png^[transformR90", + tool_capabilities = { + full_punch_interval = 1.1, + max_drop_level=1, + groupcaps={ + crumbly = {times={[1]=1.65, [2]=1.05, [3]=0.45}, uses=25, maxlevel=2}, + }, + damage_groups = {fleshy=3}, + }, + sound = {breaks = "default_tool_breaks"}, +}) + minetest.register_tool("default:shovel_steel", { description = "Steel Shovel", inventory_image = "default_tool_steelshovel.png", @@ -156,21 +171,6 @@ minetest.register_tool("default:shovel_steel", { sound = {breaks = "default_tool_breaks"}, }) -minetest.register_tool("default:shovel_bronze", { - description = "Bronze Shovel", - inventory_image = "default_tool_bronzeshovel.png", - wield_image = "default_tool_bronzeshovel.png^[transformR90", - tool_capabilities = { - full_punch_interval = 1.1, - max_drop_level=1, - groupcaps={ - crumbly = {times={[1]=1.50, [2]=0.90, [3]=0.40}, uses=40, maxlevel=2}, - }, - damage_groups = {fleshy=3}, - }, - sound = {breaks = "default_tool_breaks"}, -}) - minetest.register_tool("default:shovel_mese", { description = "Mese Shovel", inventory_image = "default_tool_meseshovel.png", @@ -234,6 +234,20 @@ minetest.register_tool("default:axe_stone", { sound = {breaks = "default_tool_breaks"}, }) +minetest.register_tool("default:axe_bronze", { + description = "Bronze Axe", + inventory_image = "default_tool_bronzeaxe.png", + tool_capabilities = { + full_punch_interval = 1.0, + max_drop_level=1, + groupcaps={ + choppy={times={[1]=2.75, [2]=1.70, [3]=1.15}, uses=20, maxlevel=2}, + }, + damage_groups = {fleshy=4}, + }, + sound = {breaks = "default_tool_breaks"}, +}) + minetest.register_tool("default:axe_steel", { description = "Steel Axe", inventory_image = "default_tool_steelaxe.png", @@ -248,20 +262,6 @@ minetest.register_tool("default:axe_steel", { sound = {breaks = "default_tool_breaks"}, }) -minetest.register_tool("default:axe_bronze", { - description = "Bronze Axe", - inventory_image = "default_tool_bronzeaxe.png", - tool_capabilities = { - full_punch_interval = 1.0, - max_drop_level=1, - groupcaps={ - choppy={times={[1]=2.50, [2]=1.40, [3]=1.00}, uses=30, maxlevel=2}, - }, - damage_groups = {fleshy=4}, - }, - sound = {breaks = "default_tool_breaks"}, -}) - minetest.register_tool("default:axe_mese", { description = "Mese Axe", inventory_image = "default_tool_meseaxe.png", @@ -283,7 +283,7 @@ minetest.register_tool("default:axe_diamond", { full_punch_interval = 0.9, max_drop_level=1, groupcaps={ - choppy={times={[1]=2.10, [2]=0.90, [3]=0.50}, uses=30, maxlevel=2}, + choppy={times={[1]=2.10, [2]=0.90, [3]=0.50}, uses=30, maxlevel=3}, }, damage_groups = {fleshy=7}, }, @@ -323,6 +323,20 @@ minetest.register_tool("default:sword_stone", { sound = {breaks = "default_tool_breaks"}, }) +minetest.register_tool("default:sword_bronze", { + description = "Bronze Sword", + inventory_image = "default_tool_bronzesword.png", + tool_capabilities = { + full_punch_interval = 0.8, + max_drop_level=1, + groupcaps={ + snappy={times={[1]=2.75, [2]=1.30, [3]=0.375}, uses=25, maxlevel=2}, + }, + damage_groups = {fleshy=6}, + }, + sound = {breaks = "default_tool_breaks"}, +}) + minetest.register_tool("default:sword_steel", { description = "Steel Sword", inventory_image = "default_tool_steelsword.png", @@ -337,20 +351,6 @@ minetest.register_tool("default:sword_steel", { sound = {breaks = "default_tool_breaks"}, }) -minetest.register_tool("default:sword_bronze", { - description = "Bronze Sword", - inventory_image = "default_tool_bronzesword.png", - tool_capabilities = { - full_punch_interval = 0.8, - max_drop_level=1, - groupcaps={ - snappy={times={[1]=2.5, [2]=1.20, [3]=0.35}, uses=40, maxlevel=2}, - }, - damage_groups = {fleshy=6}, - }, - sound = {breaks = "default_tool_breaks"}, -}) - minetest.register_tool("default:sword_mese", { description = "Mese Sword", inventory_image = "default_tool_mesesword.png", @@ -378,3 +378,43 @@ minetest.register_tool("default:sword_diamond", { }, sound = {breaks = "default_tool_breaks"}, }) + +minetest.register_tool("default:key", { + description = "Key", + inventory_image = "default_key.png", + groups = {key = 1, not_in_creative_inventory = 1}, + stack_max = 1, + on_place = function(itemstack, placer, pointed_thing) + local under = pointed_thing.under + local node = minetest.get_node(under) + local def = minetest.registered_nodes[node.name] + if def and def.on_rightclick and + not (placer and placer:is_player() and + placer:get_player_control().sneak) then + return def.on_rightclick(under, node, placer, itemstack, + pointed_thing) or itemstack + end + if pointed_thing.type ~= "node" then + return itemstack + end + + local pos = pointed_thing.under + node = minetest.get_node(pos) + + if not node or node.name == "ignore" then + return itemstack + end + + local ndef = minetest.registered_nodes[node.name] + if not ndef then + return itemstack + end + + local on_key_use = ndef.on_key_use + if on_key_use then + on_key_use(pos, placer) + end + + return nil + end +}) diff --git a/mods/mtg/default/torch.lua b/mods/mtg/default/torch.lua index 3c3ae96..5de5f89 100644 --- a/mods/mtg/default/torch.lua +++ b/mods/mtg/default/torch.lua @@ -1,39 +1,17 @@ - ---[[ - -Torch mod - formerly mod "Torches" -====================== - -(c) Copyright BlockMen (2013-2015) -(C) Copyright sofar (2016) - -This mod changes the default torch drawtype from "torchlike" to "mesh", -giving the torch a three dimensional appearance. The mesh contains the -proper pixel mapping to make the animation appear as a particle above -the torch, while in fact the animation is just the texture of the mesh. - - -License: -~~~~~~~~ -(c) Copyright BlockMen (2013-2015) - -Textures and Meshes/Models: -CC-BY 3.0 BlockMen -Note that the models were entirely done from scratch by sofar. - -Code: -Licensed under the GNU LGPL version 2.1 or higher. -You can redistribute it and/or modify it under -the terms of the GNU Lesser General Public License -as published by the Free Software Foundation; - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -See LICENSE.txt and http://www.gnu.org/licenses/lgpl-2.1.txt - ---]] +local function on_flood(pos, oldnode, newnode) + minetest.add_item(pos, ItemStack("default:torch 1")) + -- Play flame-extinguish sound if liquid is not an 'igniter' + local nodedef = minetest.registered_items[newnode.name] + if not (nodedef and nodedef.groups and + nodedef.groups.igniter and nodedef.groups.igniter > 0) then + minetest.sound_play( + "default_cool_lava", + {pos = pos, max_hear_distance = 16, gain = 0.1} + ) + end + -- Remove the torch node + return false +end minetest.register_node("default:torch", { description = "Torch", @@ -63,7 +41,8 @@ minetest.register_node("default:torch", { local node = minetest.get_node(under) local def = minetest.registered_nodes[node.name] if def and def.on_rightclick and - ((not placer) or (placer and not placer:get_player_control().sneak)) then + not (placer and placer:is_player() and + placer:get_player_control().sneak) then return def.on_rightclick(under, node, placer, itemstack, pointed_thing) or itemstack end @@ -83,7 +62,9 @@ minetest.register_node("default:torch", { itemstack:set_name("default:torch") return itemstack - end + end, + floodable = true, + on_flood = on_flood, }) minetest.register_node("default:torch_wall", { @@ -105,6 +86,8 @@ minetest.register_node("default:torch_wall", { wall_side = {-1/2, -1/2, -1/8, -1/8, 1/8, 1/8}, }, sounds = default.node_sound_wood_defaults(), + floodable = true, + on_flood = on_flood, }) minetest.register_node("default:torch_ceiling", { @@ -126,6 +109,8 @@ minetest.register_node("default:torch_ceiling", { wall_top = {-1/8, -1/16, -5/16, 1/8, 1/2, 1/8}, }, sounds = default.node_sound_wood_defaults(), + floodable = true, + on_flood = on_flood, }) minetest.register_lbm({ diff --git a/mods/mtg/default/trees.lua b/mods/mtg/default/trees.lua index 81c9831..564b714 100644 --- a/mods/mtg/default/trees.lua +++ b/mods/mtg/default/trees.lua @@ -31,12 +31,12 @@ local function is_snow_nearby(pos) end --- Sapling ABM +-- Grow sapling function default.grow_sapling(pos) if not default.can_grow(pos) then - -- try a bit later again - minetest.get_node_timer(pos):start(math.random(240, 600)) + -- try again 5 min later + minetest.get_node_timer(pos):start(300) return end @@ -81,10 +81,22 @@ function default.grow_sapling(pos) minetest.log("action", "A bush sapling grows into a bush at ".. minetest.pos_to_string(pos)) default.grow_bush(pos) + elseif node.name == "default:blueberry_bush_sapling" then + minetest.log("action", "A blueberry bush sapling grows into a bush at ".. + minetest.pos_to_string(pos)) + default.grow_blueberry_bush(pos) elseif node.name == "default:acacia_bush_sapling" then minetest.log("action", "An acacia bush sapling grows into a bush at ".. minetest.pos_to_string(pos)) default.grow_acacia_bush(pos) + elseif node.name == "default:pine_bush_sapling" then + minetest.log("action", "A pine bush sapling grows into a bush at ".. + minetest.pos_to_string(pos)) + default.grow_pine_bush(pos) + elseif node.name == "default:emergent_jungle_sapling" then + minetest.log("action", "An emergent jungle sapling grows into a tree at ".. + minetest.pos_to_string(pos)) + default.grow_new_emergent_jungle_tree(pos) end end @@ -94,7 +106,7 @@ minetest.register_lbm({ "default:pine_sapling", "default:acacia_sapling", "default:aspen_sapling"}, action = function(pos) - minetest.get_node_timer(pos):start(math.random(1200, 2400)) + minetest.get_node_timer(pos):start(math.random(300, 1500)) end }) @@ -379,7 +391,7 @@ end function default.grow_new_apple_tree(pos) local path = minetest.get_modpath("default") .. "/schematics/apple_tree_from_sapling.mts" - minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2}, + minetest.place_schematic({x = pos.x - 3, y = pos.y - 1, z = pos.z - 3}, path, "random", nil, false) end @@ -394,11 +406,27 @@ function default.grow_new_jungle_tree(pos) end +-- New emergent jungle tree + +function default.grow_new_emergent_jungle_tree(pos) + local path = minetest.get_modpath("default") .. + "/schematics/emergent_jungle_tree_from_sapling.mts" + minetest.place_schematic({x = pos.x - 3, y = pos.y - 5, z = pos.z - 3}, + path, "random", nil, false) +end + + -- New pine tree function default.grow_new_pine_tree(pos) - local path = minetest.get_modpath("default") .. - "/schematics/pine_tree_from_sapling.mts" + local path + if math.random() > 0.5 then + path = minetest.get_modpath("default") .. + "/schematics/pine_tree_from_sapling.mts" + else + path = minetest.get_modpath("default") .. + "/schematics/small_pine_tree_from_sapling.mts" + end minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2}, path, "0", nil, false) end @@ -407,8 +435,14 @@ end -- New snowy pine tree function default.grow_new_snowy_pine_tree(pos) - local path = minetest.get_modpath("default") .. - "/schematics/snowy_pine_tree_from_sapling.mts" + local path + if math.random() > 0.5 then + path = minetest.get_modpath("default") .. + "/schematics/snowy_pine_tree_from_sapling.mts" + else + path = minetest.get_modpath("default") .. + "/schematics/snowy_small_pine_tree_from_sapling.mts" + end minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2}, path, "random", nil, false) end @@ -446,6 +480,15 @@ function default.grow_bush(pos) path, "0", nil, false) end +-- Blueberry bush + +function default.grow_blueberry_bush(pos) + local path = minetest.get_modpath("default") .. + "/schematics/blueberry_bush.mts" + minetest.place_schematic({x = pos.x - 1, y = pos.y, z = pos.z - 1}, + path, "0", nil, false) +end + -- Acacia bush @@ -457,6 +500,26 @@ function default.grow_acacia_bush(pos) end +-- Pine bush + +function default.grow_pine_bush(pos) + local path = minetest.get_modpath("default") .. + "/schematics/pine_bush.mts" + minetest.place_schematic({x = pos.x - 1, y = pos.y - 1, z = pos.z - 1}, + path, "0", nil, false) +end + + +-- Large cactus + +function default.grow_large_cactus(pos) + local path = minetest.get_modpath("default") .. + "/schematics/large_cactus.mts" + minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2}, + path, "random", nil, false) +end + + -- -- Sapling 'on place' function to check protection of node and resulting tree volume -- @@ -468,7 +531,9 @@ function default.sapling_on_place(itemstack, placer, pointed_thing, local node = minetest.get_node_or_nil(pos) local pdef = node and minetest.registered_nodes[node.name] - if pdef and pdef.on_rightclick and not placer:get_player_control().sneak then + if pdef and pdef.on_rightclick and + not (placer and placer:is_player() and + placer:get_player_control().sneak) then return pdef.on_rightclick(pos, node, placer, itemstack, pointed_thing) end @@ -481,21 +546,23 @@ function default.sapling_on_place(itemstack, placer, pointed_thing, end end - local player_name = placer:get_player_name() + local player_name = placer and placer:get_player_name() or "" -- Check sapling position for protection if minetest.is_protected(pos, player_name) then minetest.record_protection_violation(pos, player_name) return itemstack end -- Check tree volume for protection - if default.intersects_protection( + if minetest.is_area_protected( vector.add(pos, minp_relative), vector.add(pos, maxp_relative), player_name, interval) then minetest.record_protection_violation(pos, player_name) -- Print extra information to explain - minetest.chat_send_player(player_name, "Tree will intersect protection") + minetest.chat_send_player(player_name, + itemstack:get_definition().description .. " will intersect protection " .. + "on growth") return itemstack end diff --git a/mods/mtg/game_commands/README.txt b/mods/mtg/game_commands/README.txt new file mode 100644 index 0000000..a451608 --- /dev/null +++ b/mods/mtg/game_commands/README.txt @@ -0,0 +1,7 @@ +Minetest Game mod: game_commands +================================ +See license.txt for license information. + +Authors of source code +---------------------- +rubenwardy (MIT) diff --git a/mods/mtg/game_commands/init.lua b/mods/mtg/game_commands/init.lua new file mode 100644 index 0000000..609c4a7 --- /dev/null +++ b/mods/mtg/game_commands/init.lua @@ -0,0 +1,25 @@ +minetest.register_chatcommand("killme", { + description = "Kill yourself to respawn", + func = function(name) + local player = minetest.get_player_by_name(name) + if player then + if minetest.settings:get_bool("enable_damage") then + player:set_hp(0) + return true + else + for _, callback in pairs(core.registered_on_respawnplayers) do + if callback(player) then + return true + end + end + + -- There doesn't seem to be a way to get a default spawn pos + -- from the lua API + return false, "No static_spawnpoint defined" + end + else + -- Show error message if used when not logged in, eg: from IRC mod + return false, "You need to be online to be killed!" + end + end +}) diff --git a/mods/mtg/game_commands/license.txt b/mods/mtg/game_commands/license.txt new file mode 100644 index 0000000..fa85564 --- /dev/null +++ b/mods/mtg/game_commands/license.txt @@ -0,0 +1,24 @@ +License of source code +---------------------- + +The MIT License (MIT) +Copyright (C) 2017-2018 rubenwardy + +Permission is hereby granted, free of charge, to any person obtaining a copy of this +software and associated documentation files (the "Software"), to deal in the Software +without restriction, including without limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +For more details: +https://opensource.org/licenses/MIT diff --git a/mods/mtg/player_api/README.txt b/mods/mtg/player_api/README.txt new file mode 100644 index 0000000..22d040c --- /dev/null +++ b/mods/mtg/player_api/README.txt @@ -0,0 +1,32 @@ +Minetest Game mod: player_api +============================= +See license.txt for license information. + +Provides an API to allow multiple mods to set player models and textures. +Also sets the default model, texture, and player flags. + +Authors of source code +---------------------- +Originally by celeron55, Perttu Ahola (LGPLv2.1+) +Various Minetest developers and contributors (LGPLv2.1+) + +Authors of media (textures, models and sounds) +---------------------------------------------- +stujones11 (CC BY-SA 3.0): + character.b3d + character.blend -- Both derived from a model by MirceaKitsune (CC BY-SA 3.0) + +Jordach (CC BY-SA 3.0): + character.png + +paramat (CC BY-SA 3.0): + gui_hotbar.png + gui_hotbar_selected.png + +celeron55, Perttu Ahola (CC BY-SA 3.0): + player.png + player_back.png + +sonictechtonic (CC BY 3.0): +https://www.freesound.org/people/sonictechtonic/sounds/241872/ + player_damage.ogg diff --git a/mods/mtg/default/player.lua b/mods/mtg/player_api/api.lua similarity index 66% rename from mods/mtg/default/player.lua rename to mods/mtg/player_api/api.lua index 0a2078d..e309b08 100644 --- a/mods/mtg/default/player.lua +++ b/mods/mtg/player_api/api.lua @@ -1,42 +1,29 @@ -- Minetest 0.4 mod: player -- See README.txt for licensing and other information. +player_api = {} + -- Player animation blending -- Note: This is currently broken due to a bug in Irrlicht, leave at 0 local animation_blend = 0 -default.registered_player_models = { } +player_api.registered_models = { } -- Local for speed. -local models = default.registered_player_models +local models = player_api.registered_models -function default.player_register_model(name, def) +function player_api.register_model(name, def) models[name] = def end --- Default player appearance -default.player_register_model("character.b3d", { - animation_speed = 30, - textures = {"character.png", }, - animations = { - -- Standard animations. - stand = { x= 0, y= 79, }, - lay = { x=162, y=166, }, - walk = { x=168, y=187, }, - mine = { x=189, y=198, }, - walk_mine = { x=200, y=219, }, - sit = { x= 81, y=160, }, - }, -}) - -- Player stats and animations local player_model = {} local player_textures = {} local player_anim = {} local player_sneak = {} -default.player_attached = {} +player_api.player_attached = {} -function default.player_get_animation(player) +function player_api.get_animation(player) local name = player:get_player_name() return { model = player_model[name], @@ -46,7 +33,7 @@ function default.player_get_animation(player) end -- Called when a player's appearance needs to be updated -function default.player_set_model(player, model_name) +function player_api.set_model(player, model_name) local name = player:get_player_name() local model = models[model_name] if model then @@ -57,25 +44,33 @@ function default.player_set_model(player, model_name) mesh = model_name, textures = player_textures[name] or model.textures, visual = "mesh", - visual_size = model.visual_size or {x=1, y=1}, + visual_size = model.visual_size or {x = 1, y = 1}, + collisionbox = model.collisionbox or {-0.3, 0.0, -0.3, 0.3, 1.7, 0.3}, + stepheight = model.stepheight or 0.6, + eye_height = model.eye_height or 1.47, }) - default.player_set_animation(player, "stand") + player_api.set_animation(player, "stand") else player:set_properties({ - textures = { "player.png", "player_back.png", }, + textures = {"player.png", "player_back.png"}, visual = "upright_sprite", + collisionbox = {-0.3, 0.0, -0.3, 0.3, 1.75, 0.3}, + stepheight = 0.6, + eye_height = 1.625, }) end player_model[name] = model_name end -function default.player_set_textures(player, textures) +function player_api.set_textures(player, textures) local name = player:get_player_name() - player_textures[name] = textures - player:set_properties({textures = textures,}) + local model = models[player_model[name]] + local model_textures = model and model.textures or nil + player_textures[name] = textures or model_textures + player:set_properties({textures = textures or model_textures,}) end -function default.player_set_animation(player, anim_name, speed) +function player_api.set_animation(player, anim_name, speed) local name = player:get_player_name() if player_anim[name] == anim_name then return @@ -89,16 +84,6 @@ function default.player_set_animation(player, anim_name, speed) player:set_animation(anim, speed or model.animation_speed, animation_blend) end --- Update appearance when the player joins -minetest.register_on_joinplayer(function(player) - default.player_attached[player:get_player_name()] = false - default.player_set_model(player, "character.b3d") - player:set_local_animation({x=0, y=79}, {x=168, y=187}, {x=189, y=198}, {x=200, y=219}, 30) - - player:hud_set_hotbar_image("gui_hotbar.png") - player:hud_set_hotbar_selected_image("gui_hotbar_selected.png") -end) - minetest.register_on_leaveplayer(function(player) local name = player:get_player_name() player_model[name] = nil @@ -107,8 +92,8 @@ minetest.register_on_leaveplayer(function(player) end) -- Localize for better performance. -local player_set_animation = default.player_set_animation -local player_attached = default.player_attached +local player_set_animation = player_api.set_animation +local player_attached = player_api.player_attached -- Check each player and apply animations minetest.register_globalstep(function(dtime) diff --git a/mods/mtg/player_api/init.lua b/mods/mtg/player_api/init.lua new file mode 100644 index 0000000..7a1f353 --- /dev/null +++ b/mods/mtg/player_api/init.lua @@ -0,0 +1,34 @@ +dofile(minetest.get_modpath("player_api") .. "/api.lua") + +-- Default player appearance +player_api.register_model("character.b3d", { + animation_speed = 30, + textures = {"character.png", }, + animations = { + -- Standard animations. + stand = {x = 0, y = 79}, + lay = {x = 162, y = 166}, + walk = {x = 168, y = 187}, + mine = {x = 189, y = 198}, + walk_mine = {x = 200, y = 219}, + sit = {x = 81, y = 160}, + }, + collisionbox = {-0.3, 0.0, -0.3, 0.3, 1.7, 0.3}, + stepheight = 0.6, + eye_height = 1.47, +}) + +-- Update appearance when the player joins +minetest.register_on_joinplayer(function(player) + player_api.player_attached[player:get_player_name()] = false + player_api.set_model(player, "character.b3d") + player:set_local_animation( + {x = 0, y = 79}, + {x = 168, y = 187}, + {x = 189, y = 198}, + {x = 200, y = 219}, + 30 + ) + player:hud_set_hotbar_image("gui_hotbar.png") + player:hud_set_hotbar_selected_image("gui_hotbar_selected.png") +end) diff --git a/mods/mtg/player_api/license.txt b/mods/mtg/player_api/license.txt new file mode 100644 index 0000000..69bb2f8 --- /dev/null +++ b/mods/mtg/player_api/license.txt @@ -0,0 +1,84 @@ +License of source code +---------------------- + +GNU Lesser General Public License, version 2.1 +Copyright (C) 2011-2018 celeron55, Perttu Ahola +Copyright (C) 2011-2018 Various Minetest developers and contributors + +This program is free software; you can redistribute it and/or modify it under the terms +of the GNU Lesser General Public License as published by the Free Software Foundation; +either version 2.1 of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; +without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +See the GNU Lesser General Public License for more details: +https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html + + +Licenses of media (textures, models and sounds) +----------------------------------------------- + +Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) +Copyright (C) 2011-2018 celeron55, Perttu Ahola +Copyright (C) 2012-2018 Jordach +Copyright (C) 2018 stujones11 +Copyright (C) 2018 paramat + +You are free to: +Share — copy and redistribute the material in any medium or format. +Adapt — remix, transform, and build upon the material for any purpose, even commercially. +The licensor cannot revoke these freedoms as long as you follow the license terms. + +Under the following terms: + +Attribution — You must give appropriate credit, provide a link to the license, and +indicate if changes were made. You may do so in any reasonable manner, but not in any way +that suggests the licensor endorses you or your use. + +ShareAlike — If you remix, transform, or build upon the material, you must distribute +your contributions under the same license as the original. + +No additional restrictions — You may not apply legal terms or technological measures that +legally restrict others from doing anything the license permits. + +Notices: + +You do not have to comply with the license for elements of the material in the public +domain or where your use is permitted by an applicable exception or limitation. +No warranties are given. The license may not give you all of the permissions necessary +for your intended use. For example, other rights such as publicity, privacy, or moral +rights may limit how you use the material. + +For more details: +http://creativecommons.org/licenses/by-sa/3.0/ + +------------------------------------ + +Attribution 3.0 Unported (CC BY 3.0) +Copyright (C) 2014-2018 sonictechtonic + +You are free to: +Share — copy and redistribute the material in any medium or format. +Adapt — remix, transform, and build upon the material for any purpose, even commercially. +The licensor cannot revoke these freedoms as long as you follow the license terms. + +Under the following terms: + +Attribution — You must give appropriate credit, provide a link to the license, and +indicate if changes were made. You may do so in any reasonable manner, but not in any way +that suggests the licensor endorses you or your use. + +No additional restrictions — You may not apply legal terms or technological measures that +legally restrict others from doing anything the license permits. + +Notices: + +You do not have to comply with the license for elements of the material in the public +domain or where your use is permitted by an applicable exception or limitation. +No warranties are given. The license may not give you all of the permissions necessary +for your intended use. For example, other rights such as publicity, privacy, or moral +rights may limit how you use the material. + +For more details: +http://creativecommons.org/licenses/by/3.0/ + diff --git a/mods/mtg/player_api/models/character.b3d b/mods/mtg/player_api/models/character.b3d new file mode 100644 index 0000000..b3b772a Binary files /dev/null and b/mods/mtg/player_api/models/character.b3d differ diff --git a/mods/mtg/player_api/models/character.blend b/mods/mtg/player_api/models/character.blend new file mode 100644 index 0000000..652579c Binary files /dev/null and b/mods/mtg/player_api/models/character.blend differ diff --git a/mods/mtg/default/models/character.png b/mods/mtg/player_api/models/character.png similarity index 100% rename from mods/mtg/default/models/character.png rename to mods/mtg/player_api/models/character.png diff --git a/mods/mtg/default/sounds/player_damage.ogg b/mods/mtg/player_api/sounds/player_damage.ogg similarity index 100% rename from mods/mtg/default/sounds/player_damage.ogg rename to mods/mtg/player_api/sounds/player_damage.ogg diff --git a/mods/mtg/player_api/textures/gui_hotbar.png b/mods/mtg/player_api/textures/gui_hotbar.png new file mode 100644 index 0000000..7bc7887 Binary files /dev/null and b/mods/mtg/player_api/textures/gui_hotbar.png differ diff --git a/mods/mtg/player_api/textures/gui_hotbar_selected.png b/mods/mtg/player_api/textures/gui_hotbar_selected.png new file mode 100644 index 0000000..7203e9a Binary files /dev/null and b/mods/mtg/player_api/textures/gui_hotbar_selected.png differ diff --git a/mods/mtg/default/textures/player.png b/mods/mtg/player_api/textures/player.png similarity index 100% rename from mods/mtg/default/textures/player.png rename to mods/mtg/player_api/textures/player.png diff --git a/mods/mtg/default/textures/player_back.png b/mods/mtg/player_api/textures/player_back.png similarity index 100% rename from mods/mtg/default/textures/player_back.png rename to mods/mtg/player_api/textures/player_back.png diff --git a/mods/mtg/sfinv/README.txt b/mods/mtg/sfinv/README.txt new file mode 100644 index 0000000..a7ac794 --- /dev/null +++ b/mods/mtg/sfinv/README.txt @@ -0,0 +1,13 @@ +Minetest Game mod: sfinv +======================== +See license.txt for license information. + +Simple Fast Inventory. +A cleaner, simpler, solution to having an advanced inventory in Minetest. +See game_api.txt for this mod's API. +Available for use outside of MTG here: +https://forum.minetest.net/viewtopic.php?t=19765 + +Authors of source code +---------------------- +rubenwardy (MIT) diff --git a/mods/mtg/sfinv/api.lua b/mods/mtg/sfinv/api.lua index bd6de1e..cd5b5e8 100644 --- a/mods/mtg/sfinv/api.lua +++ b/mods/mtg/sfinv/api.lua @@ -29,16 +29,14 @@ end function sfinv.get_nav_fs(player, context, nav, current_idx) -- Only show tabs if there is more than one page if #nav > 1 then - return "tabheader[0,0;tabs;" .. table.concat(nav, ",") .. ";" .. current_idx .. ";true;false]" + return "tabheader[0,0;sfinv_nav_tabs;" .. table.concat(nav, ",") .. + ";" .. current_idx .. ";true;false]" else return "" end end -local theme_main = "bgcolor[#080808BB;true]" .. default.gui_bg .. - default.gui_bg_img - -local theme_inv = default.gui_slots .. [[ +local theme_inv = [[ list[current_player;main;0,4.7;8,1;] list[current_player;main;0,5.85;8,3;8] ]] @@ -46,7 +44,6 @@ local theme_inv = default.gui_slots .. [[ function sfinv.make_formspec(player, context, content, show_inv, size) local tmp = { size or "size[8,8.6]", - theme_main, sfinv.get_nav_fs(player, context, context.nav_titles, context.nav_idx), content } @@ -84,9 +81,20 @@ function sfinv.get_formspec(player, context) return page:get(player, context) else local old_page = context.page - context.page = sfinv.get_homepage_name(player) + local home_page = sfinv.get_homepage_name(player) + + if old_page == home_page then + minetest.log("error", "[sfinv] Couldn't find " .. dump(old_page) .. + ", which is also the old page") + + return "" + end + + context.page = home_page assert(sfinv.pages[context.page], "[sfinv] Invalid homepage") - minetest.log("warning", "[sfinv] Couldn't find " .. dump(old_page) .. " so using switching to homepage") + minetest.log("warning", "[sfinv] Couldn't find " .. dump(old_page) .. + " so switching to homepage") + return sfinv.get_formspec(player, context) end end @@ -127,6 +135,11 @@ function sfinv.set_page(player, pagename) sfinv.set_player_inventory_formspec(player, context) end +function sfinv.get_page(player) + local context = sfinv.contexts[player:get_player_name()] + return context and context.page or sfinv.get_homepage_name(player) +end + minetest.register_on_joinplayer(function(player) if sfinv.enabled then sfinv.set_player_inventory_formspec(player) @@ -151,8 +164,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) end -- Was a tab selected? - if fields.tabs and context.nav then - local tid = tonumber(fields.tabs) + if fields.sfinv_nav_tabs and context.nav then + local tid = tonumber(fields.sfinv_nav_tabs) if tid and tid > 0 then local id = context.nav[tid] local page = sfinv.pages[id] diff --git a/mods/mtg/sfinv/license.txt b/mods/mtg/sfinv/license.txt new file mode 100644 index 0000000..e27dc85 --- /dev/null +++ b/mods/mtg/sfinv/license.txt @@ -0,0 +1,24 @@ +License of source code +---------------------- + +The MIT License (MIT) +Copyright (C) 2016-2018 rubenwardy + +Permission is hereby granted, free of charge, to any person obtaining a copy of this +software and associated documentation files (the "Software"), to deal in the Software +without restriction, including without limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +For more details: +https://opensource.org/licenses/MIT