diff --git a/README.txt b/README.txt index 7a9b12f5..b59b7f94 100644 --- a/README.txt +++ b/README.txt @@ -1,23 +1,24 @@ -The main game for the Minetest game engine [minetest_game] -========================================================== +Minetest Game [minetest_game] +============================= +The main subgame for the Minetest engine +======================================== -To use this game with Minetest, insert this repository as - /games/minetest_game -in the Minetest Engine. +To use this subgame with the Minetest engine, insert this repository as + /games/minetest_game -The Minetest Engine can be found in: - https://github.com/minetest/minetest/ +The Minetest engine can be found in: + https://github.com/minetest/minetest/ Compatibility -------------- -The minetest_game github master HEAD is generally compatible with the github -master HEAD of minetest. +The Minetest Game github master HEAD is generally compatible with the github +master HEAD of the Minetest engine. -Additionally, when the minetest engine is tagged to be a certain version (eg. -0.4.10), minetest_game is tagged with the version too. +Additionally, when the Minetest engine is tagged to be a certain version (eg. +0.4.10), Minetest Game is tagged with the version too. -When stable releases are made, minetest_game is packaged and made available in - http://minetest.net/download +When stable releases are made, Minetest Game is packaged and made available in + http://minetest.net/download and in case the repository has grown too much, it may be reset. In that sense, this is not a "real" git repository. (Package maintainers please note!) @@ -49,4 +50,4 @@ Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) http://creativecommons.org/licenses/by-sa/3.0/ License of menu/header.png -Copyright (C) 2013 BlockMen CC BY-3.0 +Copyright (C) 2015 paramat CC BY-SA 3.0 diff --git a/game.conf b/game.conf index 8b819bb9..4dea9498 100644 --- a/game.conf +++ b/game.conf @@ -1 +1 @@ -name = Minetest +name = Minetest Game diff --git a/game_api.txt b/game_api.txt index 791a7f92..8ab44309 100644 --- a/game_api.txt +++ b/game_api.txt @@ -1,11 +1,11 @@ -minetest_game API -====================== +Minetest Game API +================= GitHub Repo: https://github.com/minetest/minetest_game Introduction ------------ -The minetest_game gamemode offers multiple new possibilities in addition to Minetest's built-in API, allowing you to -add new plants to farming mod, buckets for new liquids, new stairs and custom panes. +The Minetest Game subgame offers multiple new possibilities in addition to the Minetest engine's built-in API, +allowing you to add new plants to farming mod, buckets for new liquids, new stairs and custom panes. For information on the Minetest API, visit https://github.com/minetest/minetest/blob/master/doc/lua_api.txt Please note: [XYZ] refers to a section the Minetest API @@ -17,23 +17,24 @@ Bucket API The bucket API allows registering new types of buckets for non-default liquids. bucket.register_liquid( - "default:lava_source", -- Source node name - "default:lava_flowing", -- Flowing node name - "bucket:bucket_lava", -- Name to be used for bucket - "bucket_lava.png", -- Bucket texture (for wielditem and inventory_image) - "Lava Bucket" -- Bucket description + "default:lava_source", -- name of the source node + "default:lava_flowing", -- name of the flowing node + "bucket:bucket_lava", -- name of the new bucket item (or nil if liquid is not takeable) + "bucket_lava.png", -- texture of the new bucket item (ignored if itemname == nil) + "Lava Bucket", -- text description of the bucket item + {lava_bucket = 1} -- groups of the bucket item, OPTIONAL ) Beds API -------- beds.register_bed( - "beds:bed", -- Bed name - def: See [#Bed definition] -- Bed definition + "beds:bed", -- Bed name + def: See [#Bed definition] -- Bed definition ) - beds.read_spawns() -- returns a table containing players respawn positions - beds.kick_players() -- forces all players to leave bed - beds.skip_night() -- sets world time to morning and saves respawn position of all players currently sleeping + beds.read_spawns() -- returns a table containing players respawn positions + beds.kick_players() -- forces all players to leave bed + beds.skip_night() -- sets world time to morning and saves respawn position of all players currently sleeping #Bed definition --------------- @@ -50,11 +51,11 @@ Beds API } }, nodebox = { - bottom = regular nodebox, see [Node boxes], -- bottm part of bed - top = regular nodebox, see [Node boxes], -- top part of bed + bottom = regular nodebox, see [Node boxes], -- bottm part of bed + top = regular nodebox, see [Node boxes], -- top part of bed }, - selectionbox = regular nodebox, see [Node boxes], -- for both nodeboxes - recipe = { -- Craft recipe + selectionbox = regular nodebox, see [Node boxes], -- for both nodeboxes + recipe = { -- Craft recipe {"group:wool", "group:wool", "group:wool"}, {"group:wood", "group:wood", "group:wood"} } @@ -104,9 +105,9 @@ doors.register_trapdoor(name, def) sound_open = sound to play when opening the trapdoor, OPTIONAL, sound_close = sound to play when closing the trapdoor, OPTIONAL, -> You can add any other node definition properties for minetest.register_node, - such as wield_image, inventory_image, sounds, groups, description, ... - Only node_box, selection_box, tiles, drop, drawtype, paramtype, paramtype2, on_rightclick - will be overwritten by the trapdoor registration function + such as wield_image, inventory_image, sounds, groups, description, ... + Only node_box, selection_box, tiles, drop, drawtype, paramtype, paramtype2, on_rightclick + will be overwritten by the trapdoor registration function } Farming API @@ -122,11 +123,11 @@ farming.register_plant(name, Plant definition) #Hoe Definition --------------- { - description = "", -- Description for tooltip - inventory_image = "unknown_item.png", -- Image to be used as wield- and inventory image - max_uses = 30, -- Uses until destroyed - material = "", -- Material for recipes - recipe = { -- Craft recipe, if material isn't used + description = "", -- Description for tooltip + inventory_image = "unknown_item.png", -- Image to be used as wield- and inventory image + max_uses = 30, -- Uses until destroyed + material = "", -- Material for recipes + recipe = { -- Craft recipe, if material isn't used {"air", "air", "air"}, {"", "group:stick"}, {"", "group:stick"}, @@ -136,12 +137,12 @@ farming.register_plant(name, Plant definition) #Plant definition ----------------- { - description = "", -- Description of seed item - inventory_image = "unknown_item.png", -- Image to be used as seed's wield- and inventory image - steps = 8, -- How many steps the plant has to grow, until it can be harvested + description = "", -- Description of seed item + inventory_image = "unknown_item.png", -- Image to be used as seed's wield- and inventory image + steps = 8, -- How many steps the plant has to grow, until it can be harvested ^ Always provide a plant texture for each step, format: modname_plantname_i.png (i = stepnumber) - minlight = 13, -- Minimum light to grow - maxlight = default.LIGHT_MAX -- Maximum light to grow + minlight = 13, -- Minimum light to grow + maxlight = default.LIGHT_MAX -- Maximum light to grow } Screwdriver API @@ -155,14 +156,14 @@ on_rotate(pos, node, user, mode, new_param2) ^ mode: screwdriver.ROTATE_FACE or screwdriver.ROTATE_AXIS ^ new_param2: the new value of param2 that would have been set if on_rotate wasn't there ^ return value: false to disallow rotation, nil to keep default behaviour, true to allow - it but to indicate that changed have already been made (so the screwdriver will wear out) + it but to indicate that changed have already been made (so the screwdriver will wear out) ^ use on_rotate = screwdriver.disallow to always disallow rotation ^ use on_rotate = screwdriver.rotate_simple to allow only face rotation Stairs API ---------- The stairs API lets you register stairs and slabs and ensures that they are registered the same way as those -delivered with minetest_game, to keep them compatible with other mods. +delivered with Minetest Game, to keep them compatible with other mods. stairs.register_stair(subname, recipeitem, groups, images, description, sounds) -> Registers a stair. @@ -215,10 +216,10 @@ The following nodes use the group `connect_to_raillike` and will only connect to raillike nodes within this group and the same group value. Use `minetest.raillike_group()` to get the group value. -| Node type | Raillike group name -+-----------------------+---------------------------------- -| default:rail | "rail" -| tnt:gunpowder | "gunpowder" +| Node type | Raillike group name ++-----------------------+-------------------- +| default:rail | "rail" +| tnt:gunpowder | "gunpowder" | tnt:gunpowder_burning | "gunpowder" Example: @@ -281,13 +282,13 @@ default.player_get_animation(player) Model Definition ---------------- { - animation_speed = 30, -- Default animation speed, in FPS. - textures = {"character.png", }, -- Default array of textures. - visual_size = {x=1, y=1,}, -- Used to scale the model. + animation_speed = 30, -- Default animation speed, in FPS. + textures = {"character.png", }, -- Default array of textures. + visual_size = {x = 1, y = 1}, -- Used to scale the model. animations = { - -- = { x=, y=, }, - foo = { x= 0, y=19, }, - bar = { x=20, y=39, }, + -- = {x = , y = }, + foo = {x = 0, y = 19}, + bar = {x = 20, y = 39}, -- ... }, } @@ -375,10 +376,22 @@ dye.excolors Trees ----- default.grow_tree(pos, is_apple_tree) -^ Grows a tree or apple tree at pos +^ Grows a mgv6 tree or apple tree at pos default.grow_jungle_tree(pos) -^ Grows a jungletree at pos +^ Grows a mgv6 jungletree at pos default.grow_pine_tree(pos) -^ Grows a pinetree at pos +^ Grows a mgv6 pinetree at pos + +default.grow_new_apple_tree(pos) +^ Grows a new design apple tree at pos + +default.grow_new_jungle_tree(pos) +^ Grows a new design jungle tree at pos + +default.grow_new_pine_tree(pos) +^ Grows a new design pine tree at pos + +default.grow_new_acacia_tree(pos) +^ Grows a new design acacia tree at pos diff --git a/menu/header.png b/menu/header.png index 2866626e..2ecda837 100644 Binary files a/menu/header.png and b/menu/header.png differ diff --git a/minetest.conf.example b/minetest.conf.example index b908ad24..11b4835f 100644 --- a/minetest.conf.example +++ b/minetest.conf.example @@ -1,6 +1,4 @@ -# This file contains settings of minetest_game that can be changed in -# minetest.conf -# +# This file contains settings of Minetest Game that can be changed in minetest.conf # By default, all the settings are commented and not functional. # Uncomment settings by removing the preceding #. @@ -11,7 +9,8 @@ # 0 to disable #share_bones_time = 1200 -# Whether fire should be disabled (all fire nodes will instantly disappear) +# Whether standard fire should be disabled ('basic flame' nodes will disappear) +# 'permanent flame' nodes will remain with either setting #disable_fire = false # Whether steel tools, torches and cobblestone should be given to new players @@ -22,3 +21,15 @@ # The radius of a TNT explosion #tnt_radius = 3 + +# Enable the stairs mod ABM that replaces the old 'upside down' +# stair and slab nodes in old maps with the new param2 versions. +#enable_stairs_replace_abm = false + +# Whether you allow respawning in beds +# Default value is true +#enable_bed_respawn = true + +# Whether players can skip night by sleeping +# Default value is true +#enable_bed_night_skip = true diff --git a/mods/beds/Changelog.txt b/mods/beds/Changelog.txt deleted file mode 100644 index 988db2af..00000000 --- a/mods/beds/Changelog.txt +++ /dev/null @@ -1,18 +0,0 @@ -1.0.1 beta ----------- -- Add backwards compatibility with PilzAdam's beds mod -- Fix placement -- Fix small bugs -- Prevent possible crash - -1.1 ---- -- Add fancy bed model (based on jp's model) -- Add API to register beds -- Allow players always to detach from bed (by donat-b) -- If more than 50% of players want sleep they can skip the night -- Don't show sleep dialog in singleplayer - -1.1.1 ------ -- Prevent possbile crash by trying to reposition leaving players diff --git a/mods/beds/README.txt b/mods/beds/README.txt index 21d4433f..9710c459 100644 --- a/mods/beds/README.txt +++ b/mods/beds/README.txt @@ -1,5 +1,5 @@ -Minetest mod "Beds" -=================== +Minetest Game mod: beds +======================= by BlockMen (c) 2014-2015 Version: 1.1.1 @@ -14,7 +14,8 @@ if more than 50% of the players are lying in bed and use this option. Another feature is a controled respawning. If you have slept in bed (not just lying in it) your respawn point is set to the beds location and you will respawn there after death. You can disable the respawn at beds by setting "enable_bed_respawn = false" in minetest.conf - +You can also disable the night skip feature by setting "enable_bed_night_skip = false" in minetest.conf or by using +the /set command ingame. License of source code, textures: WTFPL diff --git a/mods/beds/api.lua b/mods/beds/api.lua index 9104ee77..6b72814d 100644 --- a/mods/beds/api.lua +++ b/mods/beds/api.lua @@ -18,7 +18,6 @@ function beds.register_bed(name, def) selection_box = { type = "fixed", fixed = def.selectionbox, - }, after_place_node = function(pos, placer, itemstack) local n = minetest.get_node_or_nil(pos) @@ -89,16 +88,13 @@ function beds.register_bed(name, def) paramtype = "light", paramtype2 = "facedir", is_ground_content = false, + pointable = false, groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, bed = 2}, sounds = default.node_sound_wood_defaults(), node_box = { type = "fixed", fixed = def.nodebox.top, }, - selection_box = { - type = "fixed", - fixed = {0, 0, 0, 0, 0, 0}, - }, }) minetest.register_alias(name, name .. "_bottom") diff --git a/mods/beds/functions.lua b/mods/beds/functions.lua index 4c5c7d16..5b2f5406 100644 --- a/mods/beds/functions.lua +++ b/mods/beds/functions.lua @@ -1,3 +1,4 @@ +local pi = math.pi local player_in_bed = 0 local is_sp = minetest.is_singleplayer() local enable_respawn = minetest.setting_getbool("enable_bed_respawn") @@ -11,16 +12,24 @@ end local function get_look_yaw(pos) local n = minetest.get_node(pos) if n.param2 == 1 then - return 7.9, n.param2 + return pi/2, n.param2 elseif n.param2 == 3 then - return 4.75, n.param2 + return -pi/2, n.param2 elseif n.param2 == 0 then - return 3.15, n.param2 + return pi, n.param2 else - return 6.28, n.param2 + return 0, n.param2 end end +local function is_night_skip_enabled() + local enable_night_skip = minetest.setting_getbool("enable_bed_night_skip") + if enable_night_skip == nil then + enable_night_skip = true + end + return enable_night_skip +end + local function check_in_beds(players) local in_bed = beds.player if not players then @@ -56,7 +65,7 @@ local function lay_down(player, pos, bed_pos, state, skip) if skip then return end - if p then + if p then player:setpos(p) end @@ -100,8 +109,8 @@ local function update_formspecs(finished) "label[2.7,11; Good morning.]" else form_n = beds.formspec .. - "label[2.2,11;"..tostring(player_in_bed).." of "..tostring(ges).." players are in bed]" - if is_majority then + "label[2.2,11;"..tostring(player_in_bed).." of "..tostring(ges).." players are in bed]" + if is_majority and is_night_skip_enabled() then form_n = form_n .. "button_exit[2,8;4,0.75;force;Force night skip]" end @@ -154,11 +163,13 @@ function beds.on_rightclick(pos, player) -- skip the night and let all players stand up if check_in_beds() then minetest.after(2, function() - beds.skip_night() if not is_sp then - update_formspecs(true) + update_formspecs(is_night_skip_enabled()) + end + if is_night_skip_enabled() then + beds.skip_night() + beds.kick_players() end - beds.kick_players() end) end end @@ -189,9 +200,11 @@ minetest.register_on_leaveplayer(function(player) beds.player[name] = nil if check_in_beds() then minetest.after(2, function() - beds.skip_night() - update_formspecs(true) - beds.kick_players() + update_formspecs(is_night_skip_enabled()) + if is_night_skip_enabled() then + beds.skip_night() + beds.kick_players() + end end) end end) @@ -206,8 +219,10 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) end if fields.force then - beds.skip_night() - update_formspecs(true) - beds.kick_players() + update_formspecs(is_night_skip_enabled()) + if is_night_skip_enabled() then + beds.skip_night() + beds.kick_players() + end end end) diff --git a/mods/boats/README.txt b/mods/boats/README.txt index 5100481d..1de71678 100644 --- a/mods/boats/README.txt +++ b/mods/boats/README.txt @@ -1,6 +1,6 @@ -Minetest 0.4 mod: boats -======================= -by PilzAdam, slightly modified for NeXt +Minetest Game mod: boats +======================== +by PilzAdam License of source code: ----------------------- diff --git a/mods/boats/init.lua b/mods/boats/init.lua index 8d61dc57..a7e62e43 100644 --- a/mods/boats/init.lua +++ b/mods/boats/init.lua @@ -1,4 +1,3 @@ - -- -- Helper functions -- @@ -8,6 +7,7 @@ local function is_water(pos) return minetest.get_item_group(nn, "water") ~= 0 end + local function get_sign(i) if i == 0 then return 0 @@ -16,12 +16,14 @@ local function get_sign(i) end end + local function get_velocity(v, yaw, y) local x = -math.sin(yaw) * v local z = math.cos(yaw) * v return {x = x, y = y, z = z} end + local function get_v(v) return math.sqrt(v.x ^ 2 + v.z ^ 2) end @@ -32,7 +34,7 @@ end local boat = { physical = true, - collisionbox = {-0.5, -0.4, -0.5, 0.5, 0.3, 0.5}, + collisionbox = {-0.5, -0.35, -0.5, 0.5, 0.3, 0.5}, visual = "mesh", mesh = "boat.obj", textures = {"default_wood.png"}, @@ -43,6 +45,7 @@ local boat = { removed = false } + function boat.on_rightclick(self, clicker) if not clicker or not clicker:is_player() then return @@ -53,9 +56,23 @@ function boat.on_rightclick(self, clicker) clicker:set_detach() default.player_attached[name] = false default.player_set_animation(clicker, "stand" , 30) + local pos = clicker:getpos() + pos = {x = pos.x, y = pos.y + 0.2, z = pos.z} + minetest.after(0.1, function() + clicker:setpos(pos) + end) elseif not self.driver then + local attach = clicker:get_attach() + if attach and attach:get_luaentity() then + local luaentity = attach:get_luaentity() + if luaentity.driver then + luaentity.driver = nil + end + clicker:set_detach() + end self.driver = clicker - clicker:set_attach(self.object, "", {x = 0, y = 11, z = -3}, {x = 0, y = 0, z = 0}) + clicker:set_attach(self.object, "", + {x = 0, y = 11, z = -3}, {x = 0, y = 0, z = 0}) default.player_attached[name] = true minetest.after(0.2, function() default.player_set_animation(clicker, "sit" , 30) @@ -64,6 +81,7 @@ function boat.on_rightclick(self, clicker) end end + function boat.on_activate(self, staticdata, dtime_s) self.object:set_armor_groups({immortal = 1}) if staticdata then @@ -72,11 +90,13 @@ function boat.on_activate(self, staticdata, dtime_s) self.last_v = self.v end + function boat.get_staticdata(self) return tostring(self.v) end -function boat.on_punch(self, puncher, time_from_last_punch, tool_capabilities, direction) + +function boat.on_punch(self, puncher) if not puncher or not puncher:is_player() or self.removed then return end @@ -92,11 +112,17 @@ function boat.on_punch(self, puncher, time_from_last_punch, tool_capabilities, d self.object:remove() end) if not minetest.setting_getbool("creative_mode") then - puncher:get_inventory():add_item("main", "boats:boat") + local inv = puncher:get_inventory() + if inv:room_for_item("main", "boats:boat") then + inv:add_item("main", "boats:boat") + else + minetest.add_item(self.object:getpos(), "boats:boat") + end end end end + function boat.on_step(self, dtime) self.v = get_v(self.object:getvelocity()) * get_sign(self.v) if self.driver then @@ -149,7 +175,8 @@ function boat.on_step(self, dtime) else new_acce = {x = 0, y = -9.8, z = 0} end - new_velo = get_velocity(self.v, self.object:getyaw(), self.object:getvelocity().y) + new_velo = get_velocity(self.v, self.object:getyaw(), + self.object:getvelocity().y) self.object:setpos(self.object:getpos()) else p.y = p.y + 1 @@ -172,7 +199,8 @@ function boat.on_step(self, dtime) self.object:setpos(pos) new_velo = get_velocity(self.v, self.object:getyaw(), 0) else - new_velo = get_velocity(self.v, self.object:getyaw(), self.object:getvelocity().y) + new_velo = get_velocity(self.v, self.object:getyaw(), + self.object:getvelocity().y) self.object:setpos(self.object:getpos()) end end @@ -181,8 +209,10 @@ function boat.on_step(self, dtime) self.object:setacceleration(new_acce) end + minetest.register_entity("boats:boat", boat) + minetest.register_craftitem("boats:boat", { description = "Boat", inventory_image = "boat_inventory.png", @@ -206,6 +236,7 @@ minetest.register_craftitem("boats:boat", { end, }) + minetest.register_craft({ output = "boats:boat", recipe = { @@ -214,4 +245,3 @@ minetest.register_craft({ {"group:wood", "group:wood", "group:wood"}, }, }) - diff --git a/mods/bones/README.txt b/mods/bones/README.txt index b0ebed8f..b40a384d 100644 --- a/mods/bones/README.txt +++ b/mods/bones/README.txt @@ -1,5 +1,5 @@ -Minetest 0.4 mod: bones -======================= +Minetest Game mod: bones +======================== License of source code: ----------------------- diff --git a/mods/bones/init.lua b/mods/bones/init.lua index 8e3e59e8..f8e6c677 100644 --- a/mods/bones/init.lua +++ b/mods/bones/init.lua @@ -76,6 +76,10 @@ minetest.register_node("bones:bones", { return end + if(minetest.get_meta(pos):get_string("infotext") == "") then + return + end + local inv = minetest.get_meta(pos):get_inventory() local player_inv = player:get_inventory() local has_space = true @@ -93,6 +97,11 @@ minetest.register_node("bones:bones", { -- remove bones if player emptied them if has_space then + if player_inv:room_for_item("main", {name = "bones:bones"}) then + player_inv:add_item("main", {name = "bones:bones"}) + else + minetest.add_item(pos,"bones:bones") + end minetest.remove_node(pos) end end, diff --git a/mods/bucket/README.txt b/mods/bucket/README.txt index 7dad6419..a6674b43 100644 --- a/mods/bucket/README.txt +++ b/mods/bucket/README.txt @@ -1,4 +1,4 @@ -Minetest 0.4 mod: bucket +Minetest Game mod: bucket ========================= License of source code: diff --git a/mods/bucket/textures/bucket.png b/mods/bucket/textures/bucket.png old mode 100644 new mode 100755 index 67795287..17b0c493 Binary files a/mods/bucket/textures/bucket.png and b/mods/bucket/textures/bucket.png differ diff --git a/mods/bucket/textures/bucket_lava.png b/mods/bucket/textures/bucket_lava.png index d2baeb9b..ac6108d9 100644 Binary files a/mods/bucket/textures/bucket_lava.png and b/mods/bucket/textures/bucket_lava.png differ diff --git a/mods/bucket/textures/bucket_river_water.png b/mods/bucket/textures/bucket_river_water.png index 1d9e62a7..d4648bb3 100644 Binary files a/mods/bucket/textures/bucket_river_water.png and b/mods/bucket/textures/bucket_river_water.png differ diff --git a/mods/bucket/textures/bucket_water.png b/mods/bucket/textures/bucket_water.png index 877692a2..5af836bc 100644 Binary files a/mods/bucket/textures/bucket_water.png and b/mods/bucket/textures/bucket_water.png differ diff --git a/mods/creative/README.txt b/mods/creative/README.txt index 7d49b981..a34dcaad 100644 --- a/mods/creative/README.txt +++ b/mods/creative/README.txt @@ -1,5 +1,5 @@ -Minetest 0.4 mod: creative -========================== +Minetest Game mod: creative +=========================== Implements creative mode. diff --git a/mods/creative/init.lua b/mods/creative/init.lua index 68d5180e..8e6eda95 100644 --- a/mods/creative/init.lua +++ b/mods/creative/init.lua @@ -1,11 +1,16 @@ -- minetest/creative/init.lua creative_inventory = {} -creative_inventory.creative_inventory_size = 0 -- Create detached creative inventory after loading all mods -minetest.after(0, function() - local inv = minetest.create_detached_inventory("creative", { +creative_inventory.init_creative_inventory = function(player) + local player_name = player:get_player_name() + creative_inventory[player_name] = {} + creative_inventory[player_name].size = 0 + creative_inventory[player_name].filter = nil + creative_inventory[player_name].start_i = 1 + + local inv = minetest.create_detached_inventory("creative_" .. player_name, { allow_move = function(inv, from_list, from_index, to_list, to_index, count, player) if minetest.setting_getbool("creative_mode") then return count @@ -35,21 +40,29 @@ minetest.after(0, function() end end, }) + + creative_inventory.update(player_name, nil) + --print("creative inventory size: "..dump(creative_inventory.creative_inventory_size)) +end + +function creative_inventory.update(player_name, filter) local creative_list = {} - for name,def in pairs(minetest.registered_items) do - if (not def.groups.not_in_creative_inventory or def.groups.not_in_creative_inventory == 0) - and def.description and def.description ~= "" then - table.insert(creative_list, name) + local inv = minetest.get_inventory({type = "detached", name = "creative_" .. player_name}) + + for name, def in pairs(minetest.registered_items) do + if not (def.groups.not_in_creative_inventory == 1) and + def.description and def.description ~= "" then + if (filter and def.name:find(filter, 1, true)) or not filter then + creative_list[#creative_list+1] = name + end end end + table.sort(creative_list) inv:set_size("main", #creative_list) - for _,itemstring in ipairs(creative_list) do - inv:add_item("main", ItemStack(itemstring)) - end - creative_inventory.creative_inventory_size = #creative_list - --print("creative inventory size: "..dump(creative_inventory.creative_inventory_size)) -end) + inv:set_list("main", creative_list) + creative_inventory[player_name].size = #creative_list +end -- Create the trash field local trash = minetest.create_detached_inventory("creative_trash", { @@ -68,10 +81,12 @@ local trash = minetest.create_detached_inventory("creative_trash", { }) trash:set_size("main", 1) - creative_inventory.set_creative_formspec = function(player, start_i, pagenum) + local player_name = player:get_player_name() + local filter = creative_inventory[player_name].filter or "" pagenum = math.floor(pagenum) - local pagemax = math.floor((creative_inventory.creative_inventory_size-1) / (6*4) + 1) + local pagemax = math.floor((creative_inventory[player_name].size - 1) / (6*4) + 1) + player:set_inventory_formspec( "size[13,7.5]".. --"image[6,0.6;1,2;player.png]".. @@ -83,51 +98,67 @@ creative_inventory.set_creative_formspec = function(player, start_i, pagenum) "list[current_player;craft;8,0;3,3;]".. "list[current_player;craftpreview;12,1;1,1;]".. "image[11,1;1,1;gui_furnace_arrow_bg.png^[transformR270]".. - "list[detached:creative;main;0.3,0.5;4,6;"..tostring(start_i).."]".. - "label[2.0,6.55;"..tostring(pagenum).."/"..tostring(pagemax).."]".. - "button[0.3,6.5;1.6,1;creative_prev;<<]".. - "button[2.7,6.5;1.6,1;creative_next;>>]".. + "list[detached:creative_" .. player_name .. ";main;0.05,1;4,6;" .. tostring(start_i) .. "]".. + "tablecolumns[color;text;color;text]".. + "tableoptions[background=#00000000;highlight=#00000000;border=false]".. + "table[1.4,7.2;1.1,0.5;pagenum;#FFFF00," .. tostring(pagenum) .. ",#FFFFFF,/ " .. tostring(pagemax) .. "]".. + "button[0,7;1,1;creative_prev;<<]".. + "button[3.08,7;1,1;creative_next;>>]".. + "button[2.55,0.2;0.8,0.5;search;?]".. + "button[3.3,0.2;0.8,0.5;clear;X]".. + "tooltip[search;Search]".. + "tooltip[clear;Reset]".. "listring[current_player;main]".. "listring[current_player;craft]".. "listring[current_player;main]".. - "listring[detached:creative;main]".. + "listring[detached:creative_" .. player_name .. ";main]".. "label[5,1.5;Trash:]".. "list[detached:creative_trash;main;5,2;1,1;]".. + "field[0.3,0.3;2.6,1;filter;;" .. filter .. "]".. default.get_hotbar_bg(5,3.5) ) end + minetest.register_on_joinplayer(function(player) -- If in creative mode, modify player's inventory forms if not minetest.setting_getbool("creative_mode") then return end + creative_inventory.init_creative_inventory(player) creative_inventory.set_creative_formspec(player, 0, 1) end) + minetest.register_on_player_receive_fields(function(player, formname, fields) if not minetest.setting_getbool("creative_mode") then return end -- Figure out current page from formspec local current_page = 0 + local player_name = player:get_player_name() local formspec = player:get_inventory_formspec() - local start_i = string.match(formspec, "list%[detached:creative;main;[%d.]+,[%d.]+;[%d.]+,[%d.]+;(%d+)%]") + local start_i = formspec:match("list%[detached:creative_" .. player_name .. ";main;[%d.]+,[%d.]+;[%d.]+,[%d.]+;(%d+)%]") start_i = tonumber(start_i) or 0 - if fields.creative_prev then + if fields.creative_prev or start_i >= creative_inventory[player_name].size then start_i = start_i - 4*6 - end - if fields.creative_next then + elseif fields.creative_next or start_i < 0 then start_i = start_i + 4*6 end - if start_i < 0 then - start_i = start_i + 4*6 + if fields.search or fields.clear then + if fields.clear then + creative_inventory[player_name].filter = "" + creative_inventory.update(player_name, nil) + else + creative_inventory[player_name].filter = fields.filter:lower() + creative_inventory.update(player_name, fields.filter:lower()) + end + minetest.after(0, function() + creative_inventory.set_creative_formspec(player, 0, 1) + end) end - if start_i >= creative_inventory.creative_inventory_size then - start_i = start_i - 4*6 - end - - if start_i < 0 or start_i >= creative_inventory.creative_inventory_size then + + if start_i < 0 or start_i >= creative_inventory[player_name].size then start_i = 0 end @@ -154,18 +185,18 @@ if minetest.setting_getbool("creative_mode") then damage_groups = {fleshy = 10}, } }) - + minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack) return true end) - + function minetest.handle_node_drops(pos, drops, digger) if not digger or not digger:is_player() then return end local inv = digger:get_inventory() if inv then - for _,item in ipairs(drops) do + for _, item in ipairs(drops) do item = ItemStack(item):get_name() if not inv:contains_item("main", item) then inv:add_item("main", item) @@ -173,5 +204,4 @@ if minetest.setting_getbool("creative_mode") then end end end - end diff --git a/mods/default/README.txt b/mods/default/README.txt index ec8c17c0..5b07a36c 100644 --- a/mods/default/README.txt +++ b/mods/default/README.txt @@ -1,4 +1,4 @@ -Minetest 0.4 mod: default +Minetest Game mod: default ========================== License of source code: @@ -24,7 +24,6 @@ Copyright (C) 2010-2012 celeron55, Perttu Ahola Cisoun's WTFPL texture pack: default_jungletree.png - default_jungletree_top.png default_lava.png default_leaves.png default_sapling.png @@ -59,8 +58,8 @@ VanessaE (WTFPL): default_nc_side.png default_desert_sand.png default_desert_stone.png - default_desert_stone_brick.png default_sand.png + default_jungletree_top.png Calinou (CC BY-SA): default_brick.png @@ -77,7 +76,6 @@ Jordach (CC BY-SA 3.0): PilzAdam (WTFPL): default_jungleleaves.png default_junglesapling.png - default_junglewood.png default_obsidian_glass.png default_obsidian_shard.png default_mineral_gold.png @@ -119,12 +117,16 @@ paramat (CC BY-SA 3.0): default_dry_grass.png default_dry_grass_side.png default_dry_grass_*.png + default_junglewood.png, derived from a texture by BlockMen (CC BY-SA 3.0) + default_grass.png, derived from a texture by Philipbenr (CC BY-SA 3.0) + default_grass_side.png, derived from a texture by Philipbenr (CC BY-SA 3.0) + default_stone_brick.png, derived from a texture by Cisoun (WTFPL) + default_desert_stone_brick.png, derived from a texture by VanessaE (WTFPL) brunob.santos (CC BY-SA 4.0): default_desert_cobble.png BlockMen (CC BY-SA 3.0): - default_stone_brick.png default_wood.png default_clay_brick.png default_iron_ingot.png @@ -146,6 +148,9 @@ BlockMen (CC BY-SA 3.0): heart.png gui_*.png +sofar (CC BY-SA 3.0): + default_book_written.png, based on default_book.png + Neuromancer (CC BY-SA 2.0): default_cobble.png, based on texture by Brane praefect default_mossycobble.png, based on texture by Brane praefect @@ -153,10 +158,6 @@ Neuromancer (CC BY-SA 3.0): default_dirt.png default_furnace_*.png -Philipbenr (CC BY-SA 3.0): - default_grass.png - default_grass_side.png - Gambit (WTFPL): default_bronze_ingot.png default_copper_ingot.png diff --git a/mods/default/aliases.lua b/mods/default/aliases.lua index 203cd616..64e6ebba 100644 --- a/mods/default/aliases.lua +++ b/mods/default/aliases.lua @@ -68,5 +68,9 @@ minetest.register_alias("steel_ingot", "default:steel_ingot") minetest.register_alias("clay_brick", "default:clay_brick") minetest.register_alias("snow", "default:snow") --- Mese now comes in the form of blocks, ore, crystal and fragments +-- 'mese_block' was used for a while for the block form of mese minetest.register_alias("default:mese_block", "default:mese") + +-- Aliases for corrected pine node names +minetest.register_alias("default:pinetree", "default:pine_tree") +minetest.register_alias("default:pinewood", "default:pine_wood") diff --git a/mods/default/crafting.lua b/mods/default/crafting.lua index 304b2032..fa8df2d6 100644 --- a/mods/default/crafting.lua +++ b/mods/default/crafting.lua @@ -15,9 +15,9 @@ minetest.register_craft({ }) minetest.register_craft({ - output = 'default:pinewood 4', + output = 'default:pine_wood 4', recipe = { - {'default:pinetree'}, + {'default:pine_tree'}, } }) diff --git a/mods/default/craftitems.lua b/mods/default/craftitems.lua index facff57e..bbe11f52 100644 --- a/mods/default/craftitems.lua +++ b/mods/default/craftitems.lua @@ -30,7 +30,8 @@ local function book_on_use(itemstack, user, pointed_thing) formspec = "size[8,8]"..default.gui_bg.. "label[0.5,0.5;by "..owner.."]".. "label[0.5,0;"..minetest.formspec_escape(title).."]".. - "textarea[0.5,1.5;7.5,7;;"..minetest.formspec_escape(text)..";]" + "tableoptions[background=#00000000;highlight=#00000000;border=false]".. + "table[0.5,1.5;7.5,7;;"..minetest.formspec_escape(text):gsub("\n", ",")..";1]" end minetest.show_formspec(user:get_player_name(), "default:book", formspec) end @@ -81,7 +82,7 @@ minetest.register_craftitem("default:book", { minetest.register_craftitem("default:book_written", { description = "Book With Text", - inventory_image = "default_book.png", + inventory_image = "default_book_written.png", groups = {book=1, not_in_creative_inventory=1}, stack_max = 1, on_use = book_on_use, diff --git a/mods/default/functions.lua b/mods/default/functions.lua index fd759275..ef4ea55b 100644 --- a/mods/default/functions.lua +++ b/mods/default/functions.lua @@ -105,6 +105,7 @@ minetest.register_abm({ neighbors = {"group:water"}, interval = 1, chance = 2, + catch_up = false, action = function(...) default.cool_lava_flowing(...) end, @@ -115,6 +116,7 @@ minetest.register_abm({ neighbors = {"group:water"}, interval = 1, chance = 2, + catch_up = false, action = function(...) default.cool_lava_source(...) end, @@ -184,7 +186,7 @@ minetest.register_abm({ minetest.register_abm({ nodenames = {"default:papyrus"}, - neighbors = {"default:dirt", "default:dirt_with_grass"}, + neighbors = {"default:dirt", "default:dirt_with_grass", "default:sand"}, interval = 50, chance = 20, action = function(...) @@ -306,13 +308,14 @@ minetest.register_abm({ -- --- Grass growing +-- Grass growing on well-lit dirt -- minetest.register_abm({ nodenames = {"default:dirt"}, interval = 2, chance = 200, + catch_up = false, action = function(pos, node) local above = {x = pos.x, y = pos.y + 1, z = pos.z} local name = minetest.get_node(above).name @@ -329,10 +332,16 @@ minetest.register_abm({ end }) + +-- +-- Grass and dry grass removed in darkness +-- + minetest.register_abm({ nodenames = {"default:dirt_with_grass", "default:dirt_with_dry_grass"}, interval = 2, chance = 20, + catch_up = false, action = function(pos, node) local above = {x = pos.x, y = pos.y + 1, z = pos.z} local name = minetest.get_node(above).name @@ -345,3 +354,18 @@ minetest.register_abm({ end }) + +-- +-- Moss growth on cobble near water +-- + +minetest.register_abm({ + nodenames = {"default:cobble"}, + neighbors = {"group:water"}, + interval = 17, + chance = 200, + catch_up = false, + action = function(pos, node) + minetest.set_node(pos, {name = "default:mossycobble"}) + end +}) diff --git a/mods/default/mapgen.lua b/mods/default/mapgen.lua index 660e0a12..7c3c20b9 100644 --- a/mods/default/mapgen.lua +++ b/mods/default/mapgen.lua @@ -26,7 +26,7 @@ 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", "default:junglegrass") -minetest.register_alias("mapgen_pinetree", "default:pinetree") +minetest.register_alias("mapgen_pine_tree", "default:pine_tree") minetest.register_alias("mapgen_pine_needles", "default:pine_needles") -- Dungeons @@ -50,84 +50,85 @@ function default.register_ores() -- Clay minetest.register_ore({ - ore_type = "blob", - ore = "default:clay", - wherein = {"default:sand"}, - clust_scarcity = 24 * 24 * 24, - clust_size = 7, - y_min = -15, - y_max = 0, - noise_threshhold = 0, - noise_params = { - offset = 0.35, + ore_type = "blob", + ore = "default:clay", + wherein = {"default:sand"}, + clust_scarcity = 16 * 16 * 16, + clust_size = 5, + y_min = -15, + y_max = 0, + 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.5 + persist = 0.0 }, }) -- Sand minetest.register_ore({ - ore_type = "blob", - ore = "default:sand", - wherein = {"default:stone"}, - clust_scarcity = 24 * 24 * 24, - clust_size = 7, - y_min = -63, - y_max = 4, - noise_threshhold = 0, - noise_params = { - offset = 0.35, + ore_type = "blob", + ore = "default:sand", + wherein = {"default:stone", "default:sandstone", + "default:desert_stone"}, + clust_scarcity = 16 * 16 * 16, + clust_size = 5, + y_min = -31, + y_max = 4, + 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.5 + persist = 0.0 }, }) -- Dirt minetest.register_ore({ - ore_type = "blob", - ore = "default:dirt", - wherein = {"default:stone"}, - clust_scarcity = 24 * 24 * 24, - clust_size = 7, - y_min = -63, - y_max = 31000, - noise_threshhold = 0, - noise_params = { - offset = 0.35, + ore_type = "blob", + ore = "default:dirt", + wherein = {"default:stone", "default:sandstone"}, + clust_scarcity = 16 * 16 * 16, + clust_size = 5, + y_min = -31, + y_max = 31000, + 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.5 + persist = 0.0 }, }) -- Gravel minetest.register_ore({ - ore_type = "blob", - ore = "default:gravel", - wherein = {"default:stone"}, - clust_scarcity = 24 * 24 * 24, - clust_size = 7, - y_min = -31000, - y_max = 31000, - noise_threshhold = 0, - noise_params = { - offset = 0.35, + ore_type = "blob", + ore = "default:gravel", + wherein = {"default:stone"}, + clust_scarcity = 16 * 16 * 16, + clust_size = 5, + y_min = -31000, + y_max = 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.5 + persist = 0.0 }, }) @@ -330,11 +331,12 @@ function default.register_biomes() depth_filler = 3, node_stone = "default:ice", node_water_top = "default:ice", - depth_water_top = 8, + depth_water_top = 10, --node_water = "", - y_min = -6, + node_river_water = "default:ice", + y_min = -8, y_max = 31000, - heat_point = -5, + heat_point = 0, humidity_point = 50, }) @@ -344,14 +346,15 @@ function default.register_biomes() node_top = "default:sand", depth_top = 1, node_filler = "default:sand", - depth_filler = 2, + depth_filler = 3, --node_stone = "", --node_water_top = "", --depth_water_top = , --node_water = "", + --node_river_water = "", y_min = -112, - y_max = -7, - heat_point = -5, + y_max = -9, + heat_point = 0, humidity_point = 50, }) @@ -359,19 +362,20 @@ function default.register_biomes() minetest.register_biome({ name = "tundra", - node_dust = "default:snow", + --node_dust = "", node_top = "default:dirt_with_snow", depth_top = 1, node_filler = "default:dirt", - depth_filler = 0, + depth_filler = 1, --node_stone = "", --node_water_top = "", --depth_water_top = , --node_water = "", + --node_river_water = "", y_min = 2, y_max = 31000, - heat_point = 20, - humidity_point = 30, + heat_point = 15, + humidity_point = 35, }) minetest.register_biome({ @@ -380,32 +384,35 @@ function default.register_biomes() node_top = "default:sand", depth_top = 1, node_filler = "default:sand", - depth_filler = 2, + depth_filler = 3, --node_stone = "", --node_water_top = "", --depth_water_top = , --node_water = "", + --node_river_water = "", y_min = -112, y_max = 1, - heat_point = 20, - humidity_point = 30, + heat_point = 15, + humidity_point = 35, }) + minetest.register_biome({ name = "taiga", node_dust = "default:snow", - node_top = "default:snowblock", + node_top = "default:dirt_with_snow", depth_top = 1, node_filler = "default:dirt", - depth_filler = 2, + depth_filler = 3, --node_stone = "", --node_water_top = "", --depth_water_top = , --node_water = "", + --node_river_water = "", y_min = 2, y_max = 31000, - heat_point = 20, - humidity_point = 70, + heat_point = 15, + humidity_point = 65, }) minetest.register_biome({ @@ -414,18 +421,19 @@ function default.register_biomes() node_top = "default:sand", depth_top = 1, node_filler = "default:sand", - depth_filler = 2, + depth_filler = 3, --node_stone = "", --node_water_top = "", --depth_water_top = , --node_water = "", + --node_river_water = "", y_min = -112, y_max = 1, - heat_point = 20, - humidity_point = 70, + heat_point = 15, + humidity_point = 65, }) - -- Cool + -- Temperate minetest.register_biome({ name = "stone_grassland", @@ -433,15 +441,34 @@ function default.register_biomes() node_top = "default:dirt_with_grass", depth_top = 1, node_filler = "default:dirt", - depth_filler = 0, + depth_filler = 1, --node_stone = "", --node_water_top = "", --depth_water_top = , --node_water = "", + --node_river_water = "", y_min = 6, y_max = 31000, - heat_point = 45, - humidity_point = 30, + heat_point = 40, + humidity_point = 35, + }) + + minetest.register_biome({ + name = "stone_grassland_dunes", + --node_dust = "", + node_top = "default:sand", + depth_top = 1, + node_filler = "default:sand", + depth_filler = 2, + --node_stone = "", + --node_water_top = "", + --depth_water_top = , + --node_water = "", + --node_river_water = "", + y_min = 5, + y_max = 5, + heat_point = 40, + humidity_point = 35, }) minetest.register_biome({ @@ -450,32 +477,53 @@ function default.register_biomes() node_top = "default:sand", depth_top = 1, node_filler = "default:sand", - depth_filler = 2, + depth_filler = 3, --node_stone = "", --node_water_top = "", --depth_water_top = , --node_water = "", + --node_river_water = "", y_min = -112, - y_max = 5, - heat_point = 45, - humidity_point = 30, + y_max = 4, + heat_point = 40, + humidity_point = 35, }) + minetest.register_biome({ name = "coniferous_forest", --node_dust = "", node_top = "default:dirt_with_grass", depth_top = 1, node_filler = "default:dirt", - depth_filler = 2, + depth_filler = 3, --node_stone = "", --node_water_top = "", --depth_water_top = , --node_water = "", + --node_river_water = "", y_min = 6, y_max = 31000, - heat_point = 45, - humidity_point = 70, + heat_point = 40, + humidity_point = 65, + }) + + minetest.register_biome({ + name = "coniferous_forest_dunes", + --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 = "", + y_min = 5, + y_max = 5, + heat_point = 40, + humidity_point = 65, }) minetest.register_biome({ @@ -484,18 +532,18 @@ function default.register_biomes() node_top = "default:sand", depth_top = 1, node_filler = "default:sand", - depth_filler = 2, + depth_filler = 3, --node_stone = "", --node_water_top = "", --depth_water_top = , --node_water = "", + --node_river_water = "", y_min = -112, - y_max = 5, - heat_point = 45, - humidity_point = 70, + y_max = 4, + heat_point = 40, + humidity_point = 65, }) - -- Warm minetest.register_biome({ name = "sandstone_grassland", @@ -503,15 +551,34 @@ function default.register_biomes() node_top = "default:dirt_with_grass", depth_top = 1, node_filler = "default:dirt", - depth_filler = 0, + depth_filler = 1, node_stone = "default:sandstone", --node_water_top = "", --depth_water_top = , --node_water = "", + --node_river_water = "", y_min = 6, y_max = 31000, - heat_point = 70, - humidity_point = 30, + heat_point = 60, + humidity_point = 35, + }) + + minetest.register_biome({ + name = "sandstone_grassland_dunes", + --node_dust = "", + node_top = "default:sand", + depth_top = 1, + node_filler = "default:sand", + depth_filler = 2, + node_stone = "default:sandstone", + --node_water_top = "", + --depth_water_top = , + --node_water = "", + --node_river_water = "", + y_min = 5, + y_max = 5, + heat_point = 60, + humidity_point = 35, }) minetest.register_biome({ @@ -520,32 +587,53 @@ function default.register_biomes() node_top = "default:sand", depth_top = 1, node_filler = "default:sand", - depth_filler = 2, + depth_filler = 3, node_stone = "default:sandstone", --node_water_top = "", --depth_water_top = , --node_water = "", + --node_river_water = "", y_min = -112, - y_max = 5, - heat_point = 70, - humidity_point = 30, + y_max = 4, + heat_point = 60, + humidity_point = 35, }) + minetest.register_biome({ name = "deciduous_forest", --node_dust = "", node_top = "default:dirt_with_grass", depth_top = 1, node_filler = "default:dirt", - depth_filler = 2, + depth_filler = 3, --node_stone = "", --node_water_top = "", --depth_water_top = , --node_water = "", - y_min = 6, + --node_river_water = "", + y_min = 1, y_max = 31000, - heat_point = 70, - humidity_point = 70, + heat_point = 60, + humidity_point = 65, + }) + + minetest.register_biome({ + name = "deciduous_forest_swamp", + --node_dust = "", + node_top = "default:dirt", + 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 = -3, + y_max = 0, + heat_point = 60, + humidity_point = 65, }) minetest.register_biome({ @@ -554,15 +642,16 @@ function default.register_biomes() node_top = "default:sand", depth_top = 1, node_filler = "default:sand", - depth_filler = 2, + depth_filler = 3, --node_stone = "", --node_water_top = "", --depth_water_top = , --node_water = "", + --node_river_water = "", y_min = -112, - y_max = 5, - heat_point = 70, - humidity_point = 70, + y_max = -4, + heat_point = 60, + humidity_point = 65, }) -- Hot @@ -578,10 +667,11 @@ function default.register_biomes() --node_water_top = "", --depth_water_top = , --node_water = "", - y_min = 1, + --node_river_water = "", + y_min = 5, y_max = 31000, - heat_point = 95, - humidity_point = 10, + heat_point = 85, + humidity_point = 20, }) minetest.register_biome({ @@ -590,17 +680,19 @@ function default.register_biomes() node_top = "default:sand", depth_top = 1, node_filler = "default:sand", - depth_filler = 2, + depth_filler = 3, node_stone = "default:desert_stone", --node_water_top = "", --depth_water_top = , --node_water = "", + --node_river_water = "", y_min = -112, - y_max = 0, - heat_point = 95, - humidity_point = 10, + y_max = 4, + heat_point = 85, + humidity_point = 20, }) + minetest.register_biome({ name = "savanna", --node_dust = "", @@ -612,9 +704,28 @@ function default.register_biomes() --node_water_top = "", --depth_water_top = , --node_water = "", - y_min = 5, + --node_river_water = "", + y_min = 1, y_max = 31000, - heat_point = 95, + heat_point = 85, + humidity_point = 50, + }) + + minetest.register_biome({ + name = "savanna_swamp", + --node_dust = "", + node_top = "default:dirt", + 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 = -3, + y_max = 0, + heat_point = 85, humidity_point = 50, }) @@ -624,32 +735,35 @@ function default.register_biomes() node_top = "default:sand", depth_top = 1, node_filler = "default:sand", - depth_filler = 2, + depth_filler = 3, --node_stone = "", --node_water_top = "", --depth_water_top = , --node_water = "", + --node_river_water = "", y_min = -112, - y_max = 4, - heat_point = 95, + y_max = -4, + heat_point = 85, humidity_point = 50, }) + minetest.register_biome({ name = "rainforest", --node_dust = "", node_top = "default:dirt_with_grass", depth_top = 1, node_filler = "default:dirt", - depth_filler = 2, + depth_filler = 3, --node_stone = "", --node_water_top = "", --depth_water_top = , --node_water = "", + --node_river_water = "", y_min = 1, y_max = 31000, - heat_point = 95, - humidity_point = 90, + heat_point = 85, + humidity_point = 80, }) minetest.register_biome({ @@ -658,15 +772,16 @@ function default.register_biomes() node_top = "default:dirt", depth_top = 1, node_filler = "default:dirt", - depth_filler = 2, + depth_filler = 3, --node_stone = "", --node_water_top = "", --depth_water_top = , --node_water = "", - y_min = 0, + --node_river_water = "", + y_min = -3, y_max = 0, - heat_point = 95, - humidity_point = 90, + heat_point = 85, + humidity_point = 80, }) minetest.register_biome({ @@ -675,15 +790,16 @@ function default.register_biomes() node_top = "default:sand", depth_top = 1, node_filler = "default:sand", - depth_filler = 2, + depth_filler = 3, --node_stone = "", --node_water_top = "", --depth_water_top = , --node_water = "", + --node_river_water = "", y_min = -112, - y_max = -1, - heat_point = 95, - humidity_point = 90, + y_max = -4, + heat_point = 85, + humidity_point = 80, }) -- Underground @@ -692,13 +808,14 @@ function default.register_biomes() name = "underground", --node_dust = "", --node_top = "", - depth_top = 0, + --depth_top = , --node_filler = "", - depth_filler = -4, + --depth_filler = , --node_stone = "", --node_water_top = "", --depth_water_top = , --node_water = "", + --node_river_water = "", y_min = -31000, y_max = -113, heat_point = 50, @@ -721,7 +838,7 @@ function default.register_mgv6_decorations() minetest.register_decoration({ deco_type = "simple", place_on = {"default:dirt_with_grass"}, - sidelen = 8, + sidelen = 16, noise_params = { offset = -0.3, scale = 0.7, @@ -734,7 +851,7 @@ function default.register_mgv6_decorations() y_max = 1, decoration = "default:papyrus", height = 2, - height_max = 4, + height_max = 4, spawn_by = "default:water_source", num_spawn_by = 1, }) @@ -811,38 +928,36 @@ local function register_grass_decoration(offset, scale, length) noise_params = { offset = offset, scale = scale, - spread = {x=200, y=200, z=200}, + spread = {x = 200, y = 200, z = 200}, seed = 329, octaves = 3, persist = 0.6 }, - biomes = { - "stone_grassland", "stone_grassland_ocean", - "sandstone_grassland", "sandstone_grassland_ocean", - "deciduous_forest", "deciduous_forest_ocean", - "coniferous_forest", "coniferous_forest_ocean", - }, - y_min = 5, + 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 function register_dry_grass_decoration(length) +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 = 0.04, - scale = 0.02, - spread = {x=200, y=200, z=200}, + offset = offset, + scale = scale, + spread = {x = 200, y = 200, z = 200}, seed = 329, octaves = 3, persist = 0.6 }, biomes = {"savanna"}, - y_min = 5, + y_min = 1, y_max = 31000, decoration = "default:dry_grass_"..length, }) @@ -860,13 +975,13 @@ function default.register_decorations() noise_params = { offset = 0.04, scale = 0.02, - spread = {x=250, y=250, z=250}, + spread = {x = 250, y = 250, z = 250}, seed = 2, octaves = 3, persist = 0.66 }, biomes = {"deciduous_forest"}, - y_min = 6, + y_min = 1, y_max = 31000, schematic = minetest.get_modpath("default").."/schematics/apple_tree.mts", flags = "place_center_x, place_center_z", @@ -884,18 +999,19 @@ function default.register_decorations() y_max = 31000, schematic = minetest.get_modpath("default").."/schematics/jungle_tree.mts", flags = "place_center_x, place_center_z", + rotation = "random", }) - -- Taiga and temperate forest pine tree + -- Taiga and temperate coniferous forest pine tree minetest.register_decoration({ deco_type = "schematic", - place_on = {"default:snowblock", "default:dirt_with_grass"}, + 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}, + spread = {x = 250, y = 250, z = 250}, seed = 2, octaves = 3, persist = 0.66 @@ -912,17 +1028,17 @@ function default.register_decorations() minetest.register_decoration({ deco_type = "schematic", place_on = {"default:dirt_with_dry_grass"}, - sidelen = 80, + sidelen = 16, noise_params = { - offset = 0.001, - scale = 0.0015, - spread = {x=250, y=250, z=250}, + offset = 0, + scale = 0.002, + spread = {x = 250, y = 250, z = 250}, seed = 2, octaves = 3, persist = 0.66 }, biomes = {"savanna"}, - y_min = 6, + y_min = 1, y_max = 31000, schematic = minetest.get_modpath("default").."/schematics/acacia_tree.mts", flags = "place_center_x, place_center_z", @@ -934,17 +1050,17 @@ function default.register_decorations() minetest.register_decoration({ deco_type = "schematic", place_on = {"default:desert_sand"}, - sidelen = 80, + sidelen = 16, noise_params = { - offset = -0.0005, - scale = 0.0015, - spread = {x=200, y=200, z=200}, + offset = -0.0003, + scale = 0.0009, + spread = {x = 200, y = 200, z = 200}, seed = 230, octaves = 3, persist = 0.6 }, biomes = {"desert"}, - y_min = 2, + y_min = 5, y_max = 31000, schematic = minetest.get_modpath("default").."/schematics/large_cactus.mts", flags = "place_center_x", @@ -956,38 +1072,38 @@ function default.register_decorations() minetest.register_decoration({ deco_type = "simple", place_on = {"default:desert_sand"}, - sidelen = 80, + sidelen = 16, noise_params = { - offset = -0.0005, - scale = 0.0015, - spread = {x=200, y=200, z=200}, + offset = -0.0003, + scale = 0.0009, + spread = {x = 200, y = 200, z = 200}, seed = 230, octaves = 3, persist = 0.6 }, biomes = {"desert"}, - y_min = 2, + y_min = 5, y_max = 31000, decoration = "default:cactus", height = 2, - height_max = 5, + height_max = 5, }) -- Papyrus minetest.register_decoration({ deco_type = "schematic", - place_on = {"default:sand"}, + place_on = {"default:dirt"}, sidelen = 16, noise_params = { offset = -0.3, scale = 0.7, - spread = {x=200, y=200, z=200}, + spread = {x = 200, y = 200, z = 200}, seed = 354, octaves = 3, persist = 0.7 }, - biomes = {"savanna_ocean", "desert_ocean"}, + biomes = {"savanna_swamp"}, y_min = 0, y_max = 0, schematic = minetest.get_modpath("default").."/schematics/papyrus.mts", @@ -1003,11 +1119,11 @@ function default.register_decorations() -- Dry grasses - register_dry_grass_decoration(5) - register_dry_grass_decoration(4) - register_dry_grass_decoration(3) - register_dry_grass_decoration(2) - register_dry_grass_decoration(1) + 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) -- Junglegrass @@ -1031,7 +1147,7 @@ function default.register_decorations() noise_params = { offset = 0, scale = 0.02, - spread = {x=200, y=200, z=200}, + spread = {x = 200, y = 200, z = 200}, seed = 329, octaves = 3, persist = 0.6 diff --git a/mods/default/nodes.lua b/mods/default/nodes.lua index 2b70fff1..aecbd357 100644 --- a/mods/default/nodes.lua +++ b/mods/default/nodes.lua @@ -1,5 +1,15 @@ -- mods/default/nodes.lua + +--[[ Node name convention: + +Although many node names are in combined-word form, the required form for new +node names is words separated by underscores. If both forms are used in written +language (for example pinewood and pine wood) the underscore form should be used. + +--]] + + --[[ Index: Stone @@ -27,8 +37,8 @@ Soft / Non-Stone default:dirt default:dirt_with_grass -default:dirt_with_dry_grass default:dirt_with_grass_footsteps +default:dirt_with_dry_grass default:dirt_with_snow default:sand @@ -58,8 +68,8 @@ default:junglewood default:jungleleaves default:junglesapling -default:pinetree -default:pinewood +default:pine_tree +default:pine_wood default:pine_needles default:pine_sapling @@ -133,7 +143,9 @@ default:chest_locked default:bookshelf default:sign_wall + default:ladder + default:fence_wood default:glass @@ -160,7 +172,7 @@ default:nyancat_rainbow minetest.register_node("default:stone", { description = "Stone", tiles = {"default_stone.png"}, - groups = {cracky=3, stone=1}, + groups = {cracky = 3, stone = 1}, drop = 'default:cobble', legacy_mineral = true, sounds = default.node_sound_stone_defaults(), @@ -170,7 +182,7 @@ minetest.register_node("default:cobble", { description = "Cobblestone", tiles = {"default_cobble.png"}, is_ground_content = false, - groups = {cracky=3, stone=2}, + groups = {cracky = 3, stone = 2}, sounds = default.node_sound_stone_defaults(), }) @@ -178,7 +190,7 @@ minetest.register_node("default:stonebrick", { description = "Stone Brick", tiles = {"default_stone_brick.png"}, is_ground_content = false, - groups = {cracky=2, stone=1}, + groups = {cracky = 2, stone = 1}, sounds = default.node_sound_stone_defaults(), }) @@ -186,16 +198,15 @@ minetest.register_node("default:mossycobble", { description = "Mossy Cobblestone", tiles = {"default_mossycobble.png"}, is_ground_content = false, - groups = {cracky=3, stone=1}, + groups = {cracky = 3, stone = 1}, sounds = default.node_sound_stone_defaults(), }) - minetest.register_node("default:desert_stone", { description = "Desert Stone", tiles = {"default_desert_stone.png"}, - groups = {cracky=3, stone=1}, + groups = {cracky = 3, stone = 1}, drop = 'default:desert_cobble', legacy_mineral = true, sounds = default.node_sound_stone_defaults(), @@ -205,7 +216,7 @@ minetest.register_node("default:desert_cobble", { description = "Desert Cobblestone", tiles = {"default_desert_cobble.png"}, is_ground_content = false, - groups = {cracky=3, stone=2}, + groups = {cracky = 3, stone = 2}, sounds = default.node_sound_stone_defaults(), }) @@ -213,16 +224,15 @@ minetest.register_node("default:desert_stonebrick", { description = "Desert Stone Brick", tiles = {"default_desert_stone_brick.png"}, is_ground_content = false, - groups = {cracky=2, stone=1}, + groups = {cracky = 2, stone = 1}, sounds = default.node_sound_stone_defaults(), }) - minetest.register_node("default:sandstone", { description = "Sandstone", tiles = {"default_sandstone.png"}, - groups = {crumbly=2,cracky=3}, + groups = {crumbly = 2, cracky = 3}, sounds = default.node_sound_stone_defaults(), }) @@ -230,17 +240,16 @@ minetest.register_node("default:sandstonebrick", { description = "Sandstone Brick", tiles = {"default_sandstone_brick.png"}, is_ground_content = false, - groups = {cracky=2}, + groups = {cracky = 2}, 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}, + groups = {cracky = 1, level = 2}, }) minetest.register_node("default:obsidianbrick", { @@ -248,7 +257,7 @@ minetest.register_node("default:obsidianbrick", { tiles = {"default_obsidian_brick.png"}, is_ground_content = false, sounds = default.node_sound_stone_defaults(), - groups = {cracky=1,level=2}, + groups = {cracky = 1, level = 2}, }) -- @@ -258,17 +267,31 @@ minetest.register_node("default:obsidianbrick", { minetest.register_node("default:dirt", { description = "Dirt", tiles = {"default_dirt.png"}, - groups = {crumbly=3,soil=1}, + groups = {crumbly = 3, soil = 1}, sounds = default.node_sound_dirt_defaults(), }) minetest.register_node("default:dirt_with_grass", { description = "Dirt with Grass", - tiles = {"default_grass.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"}, - groups = {crumbly=3,soil=1}, + tiles = {"default_grass.png", "default_dirt.png", + {name = "default_dirt.png^default_grass_side.png", + tileable_vertical = false}}, + groups = {crumbly = 3, soil = 1}, drop = 'default:dirt', sounds = default.node_sound_dirt_defaults({ - footstep = {name="default_grass_footstep", gain=0.25}, + footstep = {name = "default_grass_footstep", gain = 0.25}, + }), +}) + +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}, }), }) @@ -276,8 +299,8 @@ minetest.register_node("default:dirt_with_dry_grass", { description = "Dirt with Dry Grass", tiles = {"default_dry_grass.png", "default_dirt.png", - "default_dirt.png^default_dry_grass_side.png" - }, + {name = "default_dirt.png^default_dry_grass_side.png", + tileable_vertical = false}}, groups = {crumbly = 3, soil = 1}, drop = 'default:dirt', sounds = default.node_sound_dirt_defaults({ @@ -285,66 +308,54 @@ minetest.register_node("default:dirt_with_dry_grass", { }), }) -minetest.register_node("default:dirt_with_grass_footsteps", { - description = "Dirt with Grass and Footsteps", - tiles = {"default_grass_footsteps.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"}, - 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_snow", { description = "Dirt with Snow", - tiles = {"default_snow.png", "default_dirt.png", "default_dirt.png^default_snow_side.png"}, - groups = {crumbly=3,soil=1}, + tiles = {"default_snow.png", "default_dirt.png", + {name = "default_dirt.png^default_snow_side.png", + tileable_vertical = false}}, + groups = {crumbly = 3, soil = 1}, drop = 'default:dirt', sounds = default.node_sound_dirt_defaults({ - footstep = {name="default_snow_footstep", gain=0.25}, + footstep = {name = "default_snow_footstep", gain = 0.25}, }), }) - minetest.register_node("default:sand", { description = "Sand", tiles = {"default_sand.png"}, - groups = {crumbly=3, falling_node=1, 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, falling_node=1, sand=1}, + groups = {crumbly = 3, falling_node = 1, sand = 1}, sounds = default.node_sound_sand_defaults(), }) - minetest.register_node("default:gravel", { description = "Gravel", tiles = {"default_gravel.png"}, - groups = {crumbly=2, falling_node=1}, + groups = {crumbly = 2, falling_node = 1}, sounds = default.node_sound_dirt_defaults({ - footstep = {name="default_gravel_footstep", gain=0.5}, - dug = {name="default_gravel_footstep", gain=1.0}, + footstep = {name = "default_gravel_footstep", gain = 0.5}, + dug = {name = "default_gravel_footstep", gain = 1.0}, }), }) - minetest.register_node("default:clay", { description = "Clay", tiles = {"default_clay.png"}, - groups = {crumbly=3}, + groups = {crumbly = 3}, drop = 'default:clay_lump 4', sounds = default.node_sound_dirt_defaults(), }) - minetest.register_node("default:snow", { description = "Snow", tiles = {"default_snow.png"}, @@ -359,7 +370,7 @@ minetest.register_node("default:snow", { {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5}, }, }, - groups = {crumbly = 3, falling_node = 1}, + groups = {crumbly = 3, falling_node = 1, puts_out_fire = 1}, sounds = default.node_sound_dirt_defaults({ footstep = {name = "default_snow_footstep", gain = 0.25}, dug = {name = "default_snow_footstep", gain = 0.75}, @@ -373,25 +384,23 @@ minetest.register_node("default:snow", { end, }) - minetest.register_node("default:snowblock", { description = "Snow Block", tiles = {"default_snow.png"}, - groups = {crumbly=3}, + groups = {crumbly = 3, puts_out_fire = 1}, sounds = default.node_sound_dirt_defaults({ - footstep = {name="default_snow_footstep", gain=0.25}, - dug = {name="default_snow_footstep", gain=0.75}, + footstep = {name = "default_snow_footstep", gain = 0.25}, + dug = {name = "default_snow_footstep", gain = 0.75}, }), }) - minetest.register_node("default:ice", { description = "Ice", tiles = {"default_ice.png"}, is_ground_content = false, paramtype = "light", - groups = {cracky=3}, + groups = {cracky = 3, puts_out_fire = 1}, sounds = default.node_sound_glass_defaults(), }) @@ -404,7 +413,7 @@ minetest.register_node("default:tree", { tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"}, paramtype2 = "facedir", is_ground_content = false, - groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2}, + groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, sounds = default.node_sound_wood_defaults(), on_place = minetest.rotate_node @@ -414,7 +423,7 @@ minetest.register_node("default:wood", { description = "Wooden Planks", tiles = {"default_wood.png"}, is_ground_content = false, - groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1}, + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1}, sounds = default.node_sound_wood_defaults(), }) @@ -432,7 +441,8 @@ minetest.register_node("default:sapling", { type = "fixed", fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3} }, - groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,sapling=1}, + groups = {snappy = 2, dig_immediate = 3, flammable = 2, + attached_node = 1, sapling = 1}, sounds = default.node_sound_leaves_defaults(), }) @@ -445,7 +455,7 @@ minetest.register_node("default:leaves", { special_tiles = {"default_leaves_simple.png"}, paramtype = "light", is_ground_content = false, - groups = {snappy=3, leafdecay=3, flammable=2, leaves=1}, + groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1}, drop = { max_items = 1, items = { @@ -480,25 +490,26 @@ minetest.register_node("default:apple", { type = "fixed", fixed = {-0.2, -0.5, -0.2, 0.2, 0, 0.2} }, - groups = {fleshy=3,dig_immediate=3,flammable=2,leafdecay=3,leafdecay_drop=1}, + groups = {fleshy = 3, dig_immediate = 3, flammable = 2, + leafdecay = 3, leafdecay_drop = 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 end, }) - minetest.register_node("default:jungletree", { description = "Jungle Tree", - tiles = {"default_jungletree_top.png", "default_jungletree_top.png", "default_jungletree.png"}, + tiles = {"default_jungletree_top.png", "default_jungletree_top.png", + "default_jungletree.png"}, paramtype2 = "facedir", is_ground_content = false, - groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2}, + groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, sounds = default.node_sound_wood_defaults(), on_place = minetest.rotate_node @@ -508,7 +519,7 @@ minetest.register_node("default:junglewood", { description = "Junglewood Planks", tiles = {"default_junglewood.png"}, is_ground_content = false, - groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1}, + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1}, sounds = default.node_sound_wood_defaults(), }) @@ -521,20 +532,12 @@ minetest.register_node("default:jungleleaves", { special_tiles = {"default_jungleleaves_simple.png"}, paramtype = "light", is_ground_content = false, - groups = {snappy=3, leafdecay=3, flammable=2, leaves=1}, + groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1}, drop = { max_items = 1, items = { - { - -- player will get sapling with 1/20 chance - items = {'default:junglesapling'}, - rarity = 20, - }, - { - -- player will get leaves only if he get no saplings, - -- this is because max_items is 1 - items = {'default:jungleleaves'}, - } + {items = {'default:junglesapling'}, rarity = 20}, + {items = {'default:jungleleaves'}} } }, sounds = default.node_sound_leaves_defaults(), @@ -556,19 +559,16 @@ minetest.register_node("default:junglesapling", { type = "fixed", fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3} }, - groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,sapling=1}, + groups = {snappy = 2, dig_immediate = 3, flammable = 2, + attached_node = 1, sapling = 1}, sounds = default.node_sound_leaves_defaults(), }) - -minetest.register_node("default:pinetree", { +minetest.register_node("default:pine_tree", { description = "Pine Tree", - tiles = { - "default_pinetree_top.png", - "default_pinetree_top.png", - "default_pinetree.png" - }, + tiles = {"default_pine_tree_top.png", "default_pine_tree_top.png", + "default_pine_tree.png"}, paramtype2 = "facedir", is_ground_content = false, groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, @@ -577,9 +577,9 @@ minetest.register_node("default:pinetree", { on_place = minetest.rotate_node }) -minetest.register_node("default:pinewood", { - description = "Pinewood Planks", - tiles = {"default_pinewood.png"}, +minetest.register_node("default:pine_wood", { + description = "Pine Wood Planks", + tiles = {"default_pine_wood.png"}, is_ground_content = false, groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1}, sounds = default.node_sound_wood_defaults(), @@ -620,23 +620,16 @@ minetest.register_node("default:pine_sapling", { type = "fixed", fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3} }, - groups = { - snappy = 2, - dig_immediate = 3, - flammable = 2, - attached_node = 1, - sapling = 1 - }, + groups = {snappy = 2, dig_immediate = 3, flammable = 2, + attached_node = 1, sapling = 1}, sounds = default.node_sound_leaves_defaults(), }) + minetest.register_node("default:acacia_tree", { description = "Acacia Tree", - tiles = { - "default_acacia_tree_top.png", - "default_acacia_tree_top.png", - "default_acacia_tree.png" - }, + tiles = {"default_acacia_tree_top.png", "default_acacia_tree_top.png", + "default_acacia_tree.png"}, paramtype2 = "facedir", is_ground_content = false, groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, @@ -658,6 +651,7 @@ minetest.register_node("default:acacia_leaves", { drawtype = "allfaces_optional", visual_scale = 1.3, tiles = {"default_acacia_leaves.png"}, + waving = 1, paramtype = "light", is_ground_content = false, groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1}, @@ -687,13 +681,8 @@ minetest.register_node("default:acacia_sapling", { type = "fixed", fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3} }, - groups = { - snappy = 2, - dig_immediate = 3, - flammable = 2, - attached_node = 1, - sapling = 1 - }, + groups = {snappy = 2, dig_immediate = 3, flammable = 2, + attached_node = 1, sapling = 1}, sounds = default.node_sound_leaves_defaults(), }) @@ -704,7 +693,7 @@ minetest.register_node("default:acacia_sapling", { minetest.register_node("default:stone_with_coal", { description = "Coal Ore", tiles = {"default_stone.png^default_mineral_coal.png"}, - groups = {cracky=3}, + groups = {cracky = 3}, drop = 'default:coal_lump', sounds = default.node_sound_stone_defaults(), }) @@ -713,16 +702,15 @@ minetest.register_node("default:coalblock", { description = "Coal Block", tiles = {"default_coal_block.png"}, is_ground_content = false, - groups = {cracky=3}, + groups = {cracky = 3}, sounds = default.node_sound_stone_defaults(), }) - minetest.register_node("default:stone_with_iron", { description = "Iron Ore", tiles = {"default_stone.png^default_mineral_iron.png"}, - groups = {cracky=2}, + groups = {cracky = 2}, drop = 'default:iron_lump', sounds = default.node_sound_stone_defaults(), }) @@ -731,16 +719,15 @@ minetest.register_node("default:steelblock", { description = "Steel Block", tiles = {"default_steel_block.png"}, is_ground_content = false, - groups = {cracky=1,level=2}, + groups = {cracky = 1, level = 2}, sounds = default.node_sound_stone_defaults(), }) - minetest.register_node("default:stone_with_copper", { description = "Copper Ore", tiles = {"default_stone.png^default_mineral_copper.png"}, - groups = {cracky=2}, + groups = {cracky = 2}, drop = 'default:copper_lump', sounds = default.node_sound_stone_defaults(), }) @@ -749,7 +736,7 @@ minetest.register_node("default:copperblock", { description = "Copper Block", tiles = {"default_copper_block.png"}, is_ground_content = false, - groups = {cracky=1,level=2}, + groups = {cracky = 1, level = 2}, sounds = default.node_sound_stone_defaults(), }) @@ -757,20 +744,17 @@ minetest.register_node("default:bronzeblock", { description = "Bronze Block", tiles = {"default_bronze_block.png"}, is_ground_content = false, - groups = {cracky=1,level=2}, + groups = {cracky = 1, level = 2}, sounds = default.node_sound_stone_defaults(), }) - minetest.register_node("default:stone_with_mese", { description = "Mese Ore", tiles = {"default_stone.png^default_mineral_mese.png"}, - paramtype = "light", groups = {cracky = 1}, drop = "default:mese_crystal", sounds = default.node_sound_stone_defaults(), - light_source = 1, }) minetest.register_node("default:mese", { @@ -783,12 +767,10 @@ minetest.register_node("default:mese", { }) - - minetest.register_node("default:stone_with_gold", { description = "Gold Ore", tiles = {"default_stone.png^default_mineral_gold.png"}, - groups = {cracky=2}, + groups = {cracky = 2}, drop = "default:gold_lump", sounds = default.node_sound_stone_defaults(), }) @@ -797,16 +779,15 @@ minetest.register_node("default:goldblock", { description = "Gold Block", tiles = {"default_gold_block.png"}, is_ground_content = false, - groups = {cracky=1}, + groups = {cracky = 1}, sounds = default.node_sound_stone_defaults(), }) - minetest.register_node("default:stone_with_diamond", { description = "Diamond Ore", tiles = {"default_stone.png^default_mineral_diamond.png"}, - groups = {cracky=1}, + groups = {cracky = 1}, drop = "default:diamond", sounds = default.node_sound_stone_defaults(), }) @@ -815,7 +796,7 @@ minetest.register_node("default:diamondblock", { description = "Diamond Block", tiles = {"default_diamond_block.png"}, is_ground_content = false, - groups = {cracky=1,level=3}, + groups = {cracky = 1, level = 3}, sounds = default.node_sound_stone_defaults(), }) @@ -825,9 +806,10 @@ minetest.register_node("default:diamondblock", { minetest.register_node("default:cactus", { description = "Cactus", - tiles = {"default_cactus_top.png", "default_cactus_top.png", "default_cactus_side.png"}, + tiles = {"default_cactus_top.png", "default_cactus_top.png", + "default_cactus_side.png"}, paramtype2 = "facedir", - groups = {snappy=1,choppy=3,flammable=2}, + groups = {snappy = 1, choppy = 3, flammable = 2}, sounds = default.node_sound_wood_defaults(), on_place = minetest.rotate_node, @@ -849,7 +831,7 @@ minetest.register_node("default:papyrus", { type = "fixed", fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} }, - groups = {snappy=3,flammable=2}, + groups = {snappy = 3, flammable = 2}, sounds = default.node_sound_leaves_defaults(), after_dig_node = function(pos, node, metadata, digger) @@ -869,7 +851,7 @@ minetest.register_node("default:dry_shrub", { sunlight_propagates = true, walkable = false, buildable_to = true, - groups = {snappy=3,flammable=3,attached_node=1}, + groups = {snappy = 3, flammable = 3, attached_node = 1}, sounds = default.node_sound_leaves_defaults(), selection_box = { type = "fixed", @@ -889,7 +871,7 @@ minetest.register_node("default:junglegrass", { sunlight_propagates = true, walkable = false, buildable_to = true, - groups = {snappy=3,flammable=2,flora=1,attached_node=1}, + groups = {snappy = 3, flammable = 2, flora = 1, attached_node = 1}, sounds = default.node_sound_leaves_defaults(), selection_box = { type = "fixed", @@ -897,6 +879,7 @@ minetest.register_node("default:junglegrass", { }, }) + minetest.register_node("default:grass_1", { description = "Grass", drawtype = "plantlike", @@ -909,7 +892,7 @@ minetest.register_node("default:grass_1", { sunlight_propagates = true, walkable = false, buildable_to = true, - groups = {snappy=3,flammable=3,flora=1,attached_node=1}, + groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1}, sounds = default.node_sound_leaves_defaults(), selection_box = { type = "fixed", @@ -918,26 +901,28 @@ minetest.register_node("default:grass_1", { on_place = function(itemstack, placer, pointed_thing) -- place a random grass node - local stack = ItemStack("default:grass_"..math.random(1,5)) + 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())) + return ItemStack("default:grass_1 " .. + itemstack:get_count() - (1 - ret:get_count())) end, }) -for i=2,5 do - minetest.register_node("default:grass_"..i, { +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", + 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,flammable=3,flora=1,attached_node=1,not_in_creative_inventory=1}, + groups = {snappy = 3, flammable = 3, flora = 1, + attached_node = 1, not_in_creative_inventory = 1}, sounds = default.node_sound_leaves_defaults(), selection_box = { type = "fixed", @@ -946,6 +931,7 @@ for i=2,5 do }) end + minetest.register_node("default:dry_grass_1", { description = "Dry Grass", drawtype = "plantlike", @@ -957,7 +943,7 @@ minetest.register_node("default:dry_grass_1", { sunlight_propagates = true, walkable = false, buildable_to = true, - groups = {snappy=3,flammable=3,flora=1,attached_node=1}, + groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1}, sounds = default.node_sound_leaves_defaults(), selection_box = { type = "fixed", @@ -966,25 +952,27 @@ minetest.register_node("default:dry_grass_1", { on_place = function(itemstack, placer, pointed_thing) -- place a random dry grass node - local stack = ItemStack("default:dry_grass_"..math.random(1,5)) + 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())) + 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, { +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", + 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}, + groups = {snappy = 3, flammable = 3, flora = 1, + attached_node = 1, not_in_creative_inventory=1}, drop = "default:dry_grass_1", sounds = default.node_sound_leaves_defaults(), selection_box = { @@ -1039,8 +1027,8 @@ minetest.register_node("default:water_source", { liquid_alternative_flowing = "default:water_flowing", liquid_alternative_source = "default:water_source", liquid_viscosity = 1, - post_effect_color = {a=120, r=30, g=60, b=90}, - groups = {water=3, liquid=3, puts_out_fire=1}, + post_effect_color = {a = 103, r = 30, g = 60, b = 90}, + groups = {water = 3, liquid = 3, puts_out_fire = 1}, }) minetest.register_node("default:water_flowing", { @@ -1084,8 +1072,9 @@ minetest.register_node("default:water_flowing", { liquid_alternative_flowing = "default:water_flowing", liquid_alternative_source = "default:water_source", liquid_viscosity = 1, - post_effect_color = {a=120, r=30, g=60, b=90}, - groups = {water=3, liquid=3, puts_out_fire=1, not_in_creative_inventory=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}, }) @@ -1131,8 +1120,8 @@ minetest.register_node("default:river_water_source", { liquid_viscosity = 1, liquid_renewable = false, liquid_range = 2, - post_effect_color = {a=120, r=30, g=76, b=90}, - groups = {water=3, liquid=3, puts_out_fire=1}, + post_effect_color = {a = 103, r = 30, g = 76, b = 90}, + groups = {water = 3, liquid = 3, puts_out_fire = 1}, }) minetest.register_node("default:river_water_flowing", { @@ -1178,12 +1167,12 @@ minetest.register_node("default:river_water_flowing", { liquid_viscosity = 1, liquid_renewable = false, liquid_range = 2, - post_effect_color = {a=120, r=30, g=76, b=90}, - groups = {water=3, liquid=3, puts_out_fire=1, not_in_creative_inventory=1}, + 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}, }) - minetest.register_node("default:lava_source", { description = "Lava Source", inventory_image = minetest.inventorycube("default_lava.png"), @@ -1227,8 +1216,8 @@ minetest.register_node("default:lava_source", { liquid_viscosity = 7, liquid_renewable = false, damage_per_second = 4 * 2, - post_effect_color = {a=192, r=255, g=64, b=0}, - groups = {lava=3, liquid=2, hot=3, igniter=1}, + post_effect_color = {a = 191, r = 255, g = 64, b = 0}, + groups = {lava = 3, liquid = 2, hot = 3, igniter = 1}, }) minetest.register_node("default:lava_flowing", { @@ -1274,8 +1263,9 @@ minetest.register_node("default:lava_flowing", { liquid_viscosity = 7, liquid_renewable = false, damage_per_second = 4 * 2, - post_effect_color = {a=192, r=255, g=64, b=0}, - groups = {lava=3, liquid=2, hot=3, igniter=1, not_in_creative_inventory=1}, + post_effect_color = {a = 191, r = 255, g = 64, b = 0}, + groups = {lava = 3, liquid = 2, hot = 3, igniter = 1, + not_in_creative_inventory = 1}, }) -- @@ -1324,41 +1314,40 @@ minetest.register_node("default:torch", { light_source = default.LIGHT_MAX - 1, selection_box = { type = "wallmounted", - wall_top = {-0.1, 0.5-0.6, -0.1, 0.1, 0.5, 0.1}, - wall_bottom = {-0.1, -0.5, -0.1, 0.1, -0.5+0.6, 0.1}, - wall_side = {-0.5, -0.3, -0.1, -0.5+0.3, 0.3, 0.1}, + wall_top = {-0.1, 0.5 - 0.6, -0.1, 0.1, 0.5, 0.1}, + wall_bottom = {-0.1, -0.5, -0.1, 0.1, -0.5 + 0.6, 0.1}, + wall_side = {-0.5, -0.3, -0.1, -0.5 + 0.3, 0.3, 0.1}, }, - groups = {choppy=2,dig_immediate=3,flammable=1,attached_node=1}, + groups = {choppy = 2, dig_immediate = 3, flammable = 1, attached_node = 1}, legacy_wallmounted = true, sounds = default.node_sound_defaults(), }) - local chest_formspec = - "size[8,9]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "list[current_name;main;0,0.3;8,4;]".. - "list[current_player;main;0,4.85;8,1;]".. - "list[current_player;main;0,6.08;8,3;8]".. - "listring[current_name;main]".. - "listring[current_player;main]".. + "size[8,9]" .. + default.gui_bg .. + default.gui_bg_img .. + default.gui_slots .. + "list[current_name;main;0,0.3;8,4;]" .. + "list[current_player;main;0,4.85;8,1;]" .. + "list[current_player;main;0,6.08;8,3;8]" .. + "listring[current_name;main]" .. + "listring[current_player;main]" .. default.get_hotbar_bg(0,4.85) local function get_locked_chest_formspec(pos) - local spos = pos.x .. "," .. pos.y .. "," ..pos.z + local spos = pos.x .. "," .. pos.y .. "," .. pos.z local formspec = - "size[8,9]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "list[nodemeta:".. spos .. ";main;0,0.3;8,4;]".. - "list[current_player;main;0,4.85;8,1;]".. - "list[current_player;main;0,6.08;8,3;8]".. - "listring[nodemeta:".. spos .. ";main]".. - "listring[current_player;main]".. + "size[8,9]" .. + default.gui_bg .. + default.gui_bg_img .. + default.gui_slots .. + "list[nodemeta:" .. spos .. ";main;0,0.3;8,4;]" .. + "list[current_player;main;0,4.85;8,1;]" .. + "list[current_player;main;0,6.08;8,3;8]" .. + "listring[nodemeta:" .. spos .. ";main]" .. + "listring[current_player;main]" .. default.get_hotbar_bg(0,4.85) return formspec end @@ -1375,7 +1364,7 @@ minetest.register_node("default:chest", { tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png", "default_chest_side.png", "default_chest_side.png", "default_chest_front.png"}, paramtype2 = "facedir", - groups = {choppy=2,oddly_breakable_by_hand=2}, + groups = {choppy = 2, oddly_breakable_by_hand = 2}, legacy_facedir_simple = true, is_ground_content = false, sounds = default.node_sound_wood_defaults(), @@ -1392,28 +1381,27 @@ minetest.register_node("default:chest", { local inv = meta:get_inventory() return inv:is_empty("main") 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 chest at "..minetest.pos_to_string(pos)) + 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 chest at " .. minetest.pos_to_string(pos)) end, on_metadata_inventory_put = function(pos, listname, index, stack, player) - minetest.log("action", player:get_player_name().. - " moves stuff to chest at "..minetest.pos_to_string(pos)) + minetest.log("action", player:get_player_name() .. + " moves stuff to chest at " .. minetest.pos_to_string(pos)) end, on_metadata_inventory_take = function(pos, listname, index, stack, player) - minetest.log("action", player:get_player_name().. - " takes stuff from chest at "..minetest.pos_to_string(pos)) + minetest.log("action", player:get_player_name() .. + " takes stuff from chest at " .. minetest.pos_to_string(pos)) end, }) - - minetest.register_node("default:chest_locked", { description = "Locked Chest", tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png", "default_chest_side.png", "default_chest_side.png", "default_chest_lock.png"}, paramtype2 = "facedir", - groups = {choppy=2,oddly_breakable_by_hand=2}, + groups = {choppy = 2, oddly_breakable_by_hand = 2}, legacy_facedir_simple = true, is_ground_content = false, sounds = default.node_sound_wood_defaults(), @@ -1421,22 +1409,23 @@ minetest.register_node("default:chest_locked", { after_place_node = function(pos, placer) local meta = minetest.get_meta(pos) meta:set_string("owner", placer:get_player_name() or "") - meta:set_string("infotext", "Locked Chest (owned by ".. - meta:get_string("owner")..")") + meta:set_string("infotext", "Locked Chest (owned by " .. + meta:get_string("owner") .. ")") end, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("infotext", "Locked Chest") meta:set_string("owner", "") local inv = meta:get_inventory() - inv:set_size("main", 8*4) + inv:set_size("main", 8 * 4) end, can_dig = function(pos,player) local meta = minetest.get_meta(pos); local inv = meta:get_inventory() return inv:is_empty("main") and has_locked_chest_privilege(meta, player) end, - allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + allow_metadata_inventory_move = function(pos, from_list, from_index, + to_list, to_index, count, player) local meta = minetest.get_meta(pos) if not has_locked_chest_privilege(meta, player) then return 0 @@ -1458,12 +1447,12 @@ minetest.register_node("default:chest_locked", { return stack:get_count() end, on_metadata_inventory_put = function(pos, listname, index, stack, player) - minetest.log("action", player:get_player_name().. - " moves stuff to locked chest at "..minetest.pos_to_string(pos)) + minetest.log("action", player:get_player_name() .. + " moves stuff to locked chest at " .. minetest.pos_to_string(pos)) end, on_metadata_inventory_take = function(pos, listname, index, stack, player) - minetest.log("action", player:get_player_name().. - " takes stuff from locked chest at "..minetest.pos_to_string(pos)) + minetest.log("action", player:get_player_name() .. + " takes stuff from locked chest at " .. minetest.pos_to_string(pos)) end, on_rightclick = function(pos, node, clicker) local meta = minetest.get_meta(pos) @@ -1479,31 +1468,30 @@ minetest.register_node("default:chest_locked", { }) - local bookshelf_formspec = - "size[8,7;]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "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]".. + "size[8,7;]" .. + default.gui_bg .. + default.gui_bg_img .. + default.gui_slots .. + "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) minetest.register_node("default:bookshelf", { description = "Bookshelf", tiles = {"default_wood.png", "default_wood.png", "default_bookshelf.png"}, is_ground_content = false, - groups = {choppy=3,oddly_breakable_by_hand=2,flammable=3}, + 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) meta:set_string("formspec", bookshelf_formspec) local inv = meta:get_inventory() - inv:set_size("books", 8*2) + inv:set_size("books", 8 * 2) end, can_dig = function(pos,player) local meta = minetest.get_meta(pos); @@ -1525,7 +1513,8 @@ minetest.register_node("default:bookshelf", { end end, - allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + allow_metadata_inventory_move = function(pos, from_list, from_index, + to_list, to_index, count, player) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() local stack = inv:get_stack(from_list, from_index) @@ -1540,22 +1529,22 @@ minetest.register_node("default:bookshelf", { end 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)) + 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)) end, on_metadata_inventory_put = function(pos, listname, index, stack, player) - minetest.log("action", player:get_player_name().. - " moves stuff to bookshelf at "..minetest.pos_to_string(pos)) + minetest.log("action", player:get_player_name() .. + " moves stuff to bookshelf at " .. minetest.pos_to_string(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)) + minetest.log("action", player:get_player_name() .. + " takes stuff from bookshelf at " .. minetest.pos_to_string(pos)) end, }) - minetest.register_node("default:sign_wall", { description = "Sign", drawtype = "nodebox", @@ -1573,7 +1562,7 @@ minetest.register_node("default:sign_wall", { 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 = {choppy=2,dig_immediate=2,attached_node=1}, + groups = {choppy = 2, dig_immediate = 2, attached_node = 1}, legacy_wallmounted = true, sounds = default.node_sound_defaults(), @@ -1591,13 +1580,14 @@ minetest.register_node("default:sign_wall", { end local meta = minetest.get_meta(pos) if not fields.text then return end - minetest.log("action", (sender:get_player_name() or "").." wrote \""..fields.text.. - "\" to sign at "..minetest.pos_to_string(pos)) + minetest.log("action", (sender:get_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..'"') + meta:set_string("infotext", '"' .. fields.text .. '"') end, }) + minetest.register_node("default:ladder", { description = "Ladder", drawtype = "signlike", @@ -1616,12 +1606,14 @@ minetest.register_node("default:ladder", { --wall_bottom = = --wall_side = = }, - groups = {choppy=2,oddly_breakable_by_hand=3,flammable=2}, + groups = {choppy = 2, oddly_breakable_by_hand = 3, flammable = 2}, legacy_wallmounted = true, sounds = default.node_sound_wood_defaults(), }) -local fence_texture = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126" + +local fence_texture = + "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126" minetest.register_node("default:fence_wood", { description = "Wooden Fence", drawtype = "fencelike", @@ -1635,12 +1627,11 @@ minetest.register_node("default:fence_wood", { type = "fixed", fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7}, }, - groups = {choppy=2,oddly_breakable_by_hand=2,flammable=2}, + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, sounds = default.node_sound_wood_defaults(), }) - minetest.register_node("default:glass", { description = "Glass", drawtype = "glasslike_framed_optional", @@ -1649,27 +1640,28 @@ minetest.register_node("default:glass", { paramtype = "light", sunlight_propagates = true, is_ground_content = false, - groups = {cracky=3,oddly_breakable_by_hand=3}, + groups = {cracky = 3, oddly_breakable_by_hand = 3}, sounds = default.node_sound_glass_defaults(), }) minetest.register_node("default:obsidian_glass", { description = "Obsidian Glass", - drawtype = "glasslike", - tiles = {"default_obsidian_glass.png"}, + drawtype = "glasslike_framed_optional", + tiles = {"default_obsidian_glass.png", "default_obsidian_glass_detail.png"}, + inventory_image = minetest.inventorycube("default_obsidian_glass.png"), paramtype = "light", is_ground_content = false, sunlight_propagates = true, sounds = default.node_sound_glass_defaults(), - groups = {cracky=3,oddly_breakable_by_hand=3}, + groups = {cracky = 3, oddly_breakable_by_hand = 3}, }) - minetest.register_node("default:rail", { description = "Rail", drawtype = "raillike", - tiles = {"default_rail.png", "default_rail_curved.png", "default_rail_t_junction.png", "default_rail_crossing.png"}, + tiles = {"default_rail.png", "default_rail_curved.png", + "default_rail_t_junction.png", "default_rail_crossing.png"}, inventory_image = "default_rail.png", wield_image = "default_rail.png", paramtype = "light", @@ -1681,16 +1673,16 @@ minetest.register_node("default:rail", { -- but how to specify the dimensions for curved and sideways rails? fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2}, }, - groups = {bendy=2,dig_immediate=2,attached_node=1,connect_to_raillike=minetest.raillike_group("rail")}, + groups = {bendy = 2, dig_immediate = 2, attached_node = 1, + connect_to_raillike = minetest.raillike_group("rail")}, }) - minetest.register_node("default:brick", { description = "Brick Block", tiles = {"default_brick.png"}, is_ground_content = false, - groups = {cracky=3}, + groups = {cracky = 3}, sounds = default.node_sound_stone_defaults(), }) @@ -1716,7 +1708,7 @@ minetest.register_node("default:cloud", { tiles = {"default_cloud.png"}, is_ground_content = false, sounds = default.node_sound_defaults(), - groups = {not_in_creative_inventory=1}, + groups = {not_in_creative_inventory = 1}, }) minetest.register_node("default:nyancat", { @@ -1724,7 +1716,7 @@ minetest.register_node("default:nyancat", { tiles = {"default_nc_side.png", "default_nc_side.png", "default_nc_side.png", "default_nc_side.png", "default_nc_back.png", "default_nc_front.png"}, paramtype2 = "facedir", - groups = {cracky=2}, + groups = {cracky = 2}, is_ground_content = false, legacy_facedir_simple = true, sounds = default.node_sound_defaults(), @@ -1737,7 +1729,7 @@ minetest.register_node("default:nyancat_rainbow", { "default_nc_rb.png", "default_nc_rb.png" }, paramtype2 = "facedir", - groups = {cracky=2}, + groups = {cracky = 2}, is_ground_content = false, sounds = default.node_sound_defaults(), }) diff --git a/mods/default/schematics/acacia_tree.mts b/mods/default/schematics/acacia_tree.mts index 986c022d..ec7d5f9a 100644 Binary files a/mods/default/schematics/acacia_tree.mts and b/mods/default/schematics/acacia_tree.mts differ diff --git a/mods/default/schematics/acacia_tree_from_sapling.mts b/mods/default/schematics/acacia_tree_from_sapling.mts new file mode 100644 index 00000000..23e8e4b3 Binary files /dev/null and b/mods/default/schematics/acacia_tree_from_sapling.mts differ diff --git a/mods/default/schematics/apple_tree.mts b/mods/default/schematics/apple_tree.mts index a75fa106..540295a8 100644 Binary files a/mods/default/schematics/apple_tree.mts and b/mods/default/schematics/apple_tree.mts differ diff --git a/mods/default/schematics/apple_tree_from_sapling.mts b/mods/default/schematics/apple_tree_from_sapling.mts new file mode 100644 index 00000000..8753f2a9 Binary files /dev/null and b/mods/default/schematics/apple_tree_from_sapling.mts differ diff --git a/mods/default/schematics/jungle_tree_from_sapling.mts b/mods/default/schematics/jungle_tree_from_sapling.mts new file mode 100644 index 00000000..babaa45f Binary files /dev/null and b/mods/default/schematics/jungle_tree_from_sapling.mts differ diff --git a/mods/default/schematics/large_cactus.mts b/mods/default/schematics/large_cactus.mts index b71077b3..43555b96 100644 Binary files a/mods/default/schematics/large_cactus.mts and b/mods/default/schematics/large_cactus.mts differ diff --git a/mods/default/schematics/pine_tree.mts b/mods/default/schematics/pine_tree.mts index 3f4eeb09..576a2dfb 100644 Binary files a/mods/default/schematics/pine_tree.mts and b/mods/default/schematics/pine_tree.mts differ diff --git a/mods/default/schematics/pine_tree_from_sapling.mts b/mods/default/schematics/pine_tree_from_sapling.mts new file mode 100644 index 00000000..629c5da0 Binary files /dev/null and b/mods/default/schematics/pine_tree_from_sapling.mts differ diff --git a/mods/default/textures/default_book_written.png b/mods/default/textures/default_book_written.png new file mode 100644 index 00000000..d843e5f6 Binary files /dev/null and b/mods/default/textures/default_book_written.png differ diff --git a/mods/default/textures/default_cactus_side_normal.png b/mods/default/textures/default_cactus_side_normal.png new file mode 100644 index 00000000..278f7234 Binary files /dev/null and b/mods/default/textures/default_cactus_side_normal.png differ diff --git a/mods/default/textures/default_cactus_top_normal.png b/mods/default/textures/default_cactus_top_normal.png new file mode 100644 index 00000000..ba361ba0 Binary files /dev/null and b/mods/default/textures/default_cactus_top_normal.png differ diff --git a/mods/default/textures/default_desert_stone_brick.png b/mods/default/textures/default_desert_stone_brick.png index cc0f04a3..42d9f277 100644 Binary files a/mods/default/textures/default_desert_stone_brick.png and b/mods/default/textures/default_desert_stone_brick.png differ diff --git a/mods/default/textures/default_desert_stone_brick_normal.png b/mods/default/textures/default_desert_stone_brick_normal.png new file mode 100644 index 00000000..9ef5865b Binary files /dev/null and b/mods/default/textures/default_desert_stone_brick_normal.png differ diff --git a/mods/default/textures/default_dirt_normal.png b/mods/default/textures/default_dirt_normal.png new file mode 100644 index 00000000..e12e9416 Binary files /dev/null and b/mods/default/textures/default_dirt_normal.png differ diff --git a/mods/default/textures/default_dry_grass_normal.png b/mods/default/textures/default_dry_grass_normal.png new file mode 100644 index 00000000..e6b16c11 Binary files /dev/null and b/mods/default/textures/default_dry_grass_normal.png differ diff --git a/mods/default/textures/default_dry_grass_side_normal.png b/mods/default/textures/default_dry_grass_side_normal.png new file mode 100644 index 00000000..22518708 Binary files /dev/null and b/mods/default/textures/default_dry_grass_side_normal.png differ diff --git a/mods/default/textures/default_footprint.png b/mods/default/textures/default_footprint.png new file mode 100644 index 00000000..41d95463 Binary files /dev/null and b/mods/default/textures/default_footprint.png differ diff --git a/mods/default/textures/default_grass.png b/mods/default/textures/default_grass.png index 7c17c6f0..7c5a8b82 100644 Binary files a/mods/default/textures/default_grass.png and b/mods/default/textures/default_grass.png differ diff --git a/mods/default/textures/default_grass_1.png b/mods/default/textures/default_grass_1.png index 50529302..5ed8388b 100644 Binary files a/mods/default/textures/default_grass_1.png and b/mods/default/textures/default_grass_1.png differ diff --git a/mods/default/textures/default_grass_2.png b/mods/default/textures/default_grass_2.png index 9d99a6a4..0ffa8fc2 100644 Binary files a/mods/default/textures/default_grass_2.png and b/mods/default/textures/default_grass_2.png differ diff --git a/mods/default/textures/default_grass_3.png b/mods/default/textures/default_grass_3.png index 4833df44..101fefaa 100644 Binary files a/mods/default/textures/default_grass_3.png and b/mods/default/textures/default_grass_3.png differ diff --git a/mods/default/textures/default_grass_4.png b/mods/default/textures/default_grass_4.png index 1496fb15..72c721af 100644 Binary files a/mods/default/textures/default_grass_4.png and b/mods/default/textures/default_grass_4.png differ diff --git a/mods/default/textures/default_grass_5.png b/mods/default/textures/default_grass_5.png index a2125358..7fd68388 100644 Binary files a/mods/default/textures/default_grass_5.png and b/mods/default/textures/default_grass_5.png differ diff --git a/mods/default/textures/default_grass_footsteps.png b/mods/default/textures/default_grass_footsteps.png deleted file mode 100644 index 3741a0bc..00000000 Binary files a/mods/default/textures/default_grass_footsteps.png and /dev/null differ diff --git a/mods/default/textures/default_grass_normal.png b/mods/default/textures/default_grass_normal.png new file mode 100644 index 00000000..e6b16c11 Binary files /dev/null and b/mods/default/textures/default_grass_normal.png differ diff --git a/mods/default/textures/default_grass_side.png b/mods/default/textures/default_grass_side.png index 87ae3ca0..d6c57c7a 100644 Binary files a/mods/default/textures/default_grass_side.png and b/mods/default/textures/default_grass_side.png differ diff --git a/mods/default/textures/default_grass_side_normal.png b/mods/default/textures/default_grass_side_normal.png new file mode 100644 index 00000000..22518708 Binary files /dev/null and b/mods/default/textures/default_grass_side_normal.png differ diff --git a/mods/default/textures/default_jungletree_normal.png b/mods/default/textures/default_jungletree_normal.png new file mode 100644 index 00000000..d535e862 Binary files /dev/null and b/mods/default/textures/default_jungletree_normal.png differ diff --git a/mods/default/textures/default_jungletree_top.png b/mods/default/textures/default_jungletree_top.png index e3a3ccc5..62cd7814 100644 Binary files a/mods/default/textures/default_jungletree_top.png and b/mods/default/textures/default_jungletree_top.png differ diff --git a/mods/default/textures/default_jungletree_top_normal.png b/mods/default/textures/default_jungletree_top_normal.png new file mode 100644 index 00000000..b31162eb Binary files /dev/null and b/mods/default/textures/default_jungletree_top_normal.png differ diff --git a/mods/default/textures/default_junglewood.png b/mods/default/textures/default_junglewood.png index 6198d26b..8d17917b 100644 Binary files a/mods/default/textures/default_junglewood.png and b/mods/default/textures/default_junglewood.png differ diff --git a/mods/default/textures/default_junglewood_normal.png b/mods/default/textures/default_junglewood_normal.png new file mode 100644 index 00000000..5d45d7b5 Binary files /dev/null and b/mods/default/textures/default_junglewood_normal.png differ diff --git a/mods/default/textures/default_mineral_mese.png b/mods/default/textures/default_mineral_mese.png index 566d379a..6952670a 100644 Binary files a/mods/default/textures/default_mineral_mese.png and b/mods/default/textures/default_mineral_mese.png differ diff --git a/mods/default/textures/default_obsidian_glass_detail.png b/mods/default/textures/default_obsidian_glass_detail.png new file mode 100644 index 00000000..a8bbec98 Binary files /dev/null and b/mods/default/textures/default_obsidian_glass_detail.png differ diff --git a/mods/default/textures/default_pinetree.png b/mods/default/textures/default_pine_tree.png similarity index 100% rename from mods/default/textures/default_pinetree.png rename to mods/default/textures/default_pine_tree.png diff --git a/mods/default/textures/default_pinetree_top.png b/mods/default/textures/default_pine_tree_top.png similarity index 100% rename from mods/default/textures/default_pinetree_top.png rename to mods/default/textures/default_pine_tree_top.png diff --git a/mods/default/textures/default_pinewood.png b/mods/default/textures/default_pine_wood.png similarity index 100% rename from mods/default/textures/default_pinewood.png rename to mods/default/textures/default_pine_wood.png diff --git a/mods/default/textures/default_stone_brick.png b/mods/default/textures/default_stone_brick.png index c254cc61..be949ab6 100644 Binary files a/mods/default/textures/default_stone_brick.png and b/mods/default/textures/default_stone_brick.png differ diff --git a/mods/default/textures/default_tnt_bottom.png b/mods/default/textures/default_tnt_bottom.png deleted file mode 100644 index 4eda0603..00000000 Binary files a/mods/default/textures/default_tnt_bottom.png and /dev/null differ diff --git a/mods/default/textures/default_tnt_side.png b/mods/default/textures/default_tnt_side.png deleted file mode 100644 index 947f862d..00000000 Binary files a/mods/default/textures/default_tnt_side.png and /dev/null differ diff --git a/mods/default/textures/default_tnt_top.png b/mods/default/textures/default_tnt_top.png deleted file mode 100644 index 473c8fdc..00000000 Binary files a/mods/default/textures/default_tnt_top.png and /dev/null differ diff --git a/mods/default/textures/default_torch.png b/mods/default/textures/default_torch.png deleted file mode 100644 index e21aac33..00000000 Binary files a/mods/default/textures/default_torch.png and /dev/null differ diff --git a/mods/default/textures/default_torch_on_ceiling.png b/mods/default/textures/default_torch_on_ceiling.png deleted file mode 100644 index 89f41f5b..00000000 Binary files a/mods/default/textures/default_torch_on_ceiling.png and /dev/null differ diff --git a/mods/default/textures/default_tree_normal.png b/mods/default/textures/default_tree_normal.png new file mode 100644 index 00000000..4616a0a8 Binary files /dev/null and b/mods/default/textures/default_tree_normal.png differ diff --git a/mods/default/textures/default_tree_top_normal.png b/mods/default/textures/default_tree_top_normal.png new file mode 100644 index 00000000..b31162eb Binary files /dev/null and b/mods/default/textures/default_tree_top_normal.png differ diff --git a/mods/default/textures/default_wood_normal.png b/mods/default/textures/default_wood_normal.png new file mode 100644 index 00000000..5d45d7b5 Binary files /dev/null and b/mods/default/textures/default_wood_normal.png differ diff --git a/mods/default/trees.lua b/mods/default/trees.lua index b5b20ec5..51a7a2e6 100644 --- a/mods/default/trees.lua +++ b/mods/default/trees.lua @@ -1,10 +1,12 @@ -- --- Grow trees +-- Grow trees from saplings -- +-- 'Can grow' function + local random = math.random -local function can_grow(pos) +function default.can_grow(pos) local node_under = minetest.get_node_or_nil({x = pos.x, y = pos.y - 1, z = pos.z}) if not node_under then return false @@ -14,84 +16,65 @@ local function can_grow(pos) if is_soil == 0 then return false end + local light_level = minetest.get_node_light(pos) + if not light_level or light_level < 13 then + return false + end return true end --- Sapling ABMs + +-- Sapling ABM minetest.register_abm({ - nodenames = {"default:sapling"}, + nodenames = {"default:sapling", "default:junglesapling", + "default:pine_sapling", "default:acacia_sapling"}, interval = 10, chance = 50, action = function(pos, node) - if not can_grow(pos) then + if not default.can_grow(pos) then return end - minetest.log("action", "A sapling grows into a tree at ".. - minetest.pos_to_string(pos)) - if minetest.get_mapgen_params().mgname == "v6" then - default.grow_tree(pos, random(1, 4) == 1) - else - default.grow_new_apple_tree(pos) + local mapgen = minetest.get_mapgen_params().mgname + if node.name == "default:sapling" then + minetest.log("action", "A sapling grows into a tree at ".. + minetest.pos_to_string(pos)) + if mapgen == "v6" then + default.grow_tree(pos, random(1, 4) == 1) + else + default.grow_new_apple_tree(pos) + end + elseif node.name == "default:junglesapling" then + minetest.log("action", "A jungle sapling grows into a tree at ".. + minetest.pos_to_string(pos)) + if mapgen == "v6" then + default.grow_jungle_tree(pos) + else + default.grow_new_jungle_tree(pos) + end + elseif node.name == "default:pine_sapling" then + minetest.log("action", "A pine sapling grows into a tree at ".. + minetest.pos_to_string(pos)) + if mapgen == "v6" then + default.grow_pine_tree(pos) + else + default.grow_new_pine_tree(pos) + end + elseif node.name == "default:acacia_sapling" then + minetest.log("action", "An acacia sapling grows into a tree at ".. + minetest.pos_to_string(pos)) + default.grow_new_acacia_tree(pos) end end }) -minetest.register_abm({ - nodenames = {"default:junglesapling"}, - interval = 11, - chance = 50, - action = function(pos, node) - if not can_grow(pos) then - return - end - minetest.log("action", "A jungle sapling grows into a tree at ".. - minetest.pos_to_string(pos)) - if minetest.get_mapgen_params().mgname == "v6" then - default.grow_jungle_tree(pos) - else - default.grow_new_jungle_tree(pos) - end - end -}) +-- +-- Tree generation +-- -minetest.register_abm({ - nodenames = {"default:pine_sapling"}, - interval = 12, - chance = 50, - action = function(pos, node) - if not can_grow(pos) then - return - end - - minetest.log("action", "A pine sapling grows into a tree at ".. - minetest.pos_to_string(pos)) - if minetest.get_mapgen_params().mgname == "v6" then - default.grow_pine_tree(pos) - else - default.grow_new_pine_tree(pos) - end - end -}) - -minetest.register_abm({ - nodenames = {"default:acacia_sapling"}, - interval = 13, - chance = 50, - action = function(pos, node) - if not can_grow(pos) then - return - end - - minetest.log("action", "An acacia sapling grows into a tree at ".. - minetest.pos_to_string(pos)) - default.grow_new_acacia_tree(pos) - end -}) - --- Appletree, jungletree function +-- Apple tree and jungle tree trunk and leaves function local function add_trunk_and_leaves(data, a, pos, tree_cid, leaves_cid, height, size, iters, is_apple_tree) @@ -150,7 +133,8 @@ local function add_trunk_and_leaves(data, a, pos, tree_cid, leaves_cid, end end --- Appletree + +-- Apple tree function default.grow_tree(pos, is_apple_tree, bad) --[[ @@ -182,7 +166,8 @@ function default.grow_tree(pos, is_apple_tree, bad) vm:update_map() end --- Jungletree + +-- Jungle tree function default.grow_jungle_tree(pos, bad) --[[ @@ -233,7 +218,8 @@ function default.grow_jungle_tree(pos, bad) vm:update_map() end --- Pinetree from mg mapgen mod, design by sfan5, pointy top added by paramat + +-- Pine tree from mg mapgen mod, design by sfan5, pointy top added by paramat local function add_pine_needles(data, vi, c_air, c_ignore, c_snow, c_pine_needles) local node_id = data[vi] @@ -255,7 +241,7 @@ function default.grow_pine_tree(pos) local c_air = minetest.get_content_id("air") local c_ignore = minetest.get_content_id("ignore") - local c_pinetree = minetest.get_content_id("default:pinetree") + local c_pine_tree = minetest.get_content_id("default:pine_tree") local c_pine_needles = minetest.get_content_id("default:pine_needles") local c_snow = minetest.get_content_id("default:snow") local c_snowblock = minetest.get_content_id("default:snowblock") @@ -359,12 +345,13 @@ function default.grow_pine_tree(pos) end -- Trunk - data[a:index(x, y, z)] = c_pinetree -- Force-place lowest trunk node to replace sapling + data[a:index(x, y, z)] = c_pine_tree -- Force-place lowest trunk node to replace sapling for yy = y + 1, maxy do local vi = a:index(x, yy, z) local node_id = data[vi] - if node_id == c_air or node_id == c_ignore or node_id == c_pine_needles then - data[vi] = c_pinetree + if node_id == c_air or node_id == c_ignore or + node_id == c_pine_needles or node_id == c_snow then + data[vi] = c_pine_tree end end @@ -373,34 +360,38 @@ function default.grow_pine_tree(pos) vm:update_map() end --- New tree + +-- New apple tree function default.grow_new_apple_tree(pos) - local path = minetest.get_modpath("default") .. "/schematics/apple_tree.mts" + 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}, path, 0, nil, false) end + -- New jungle tree function default.grow_new_jungle_tree(pos) - local path = minetest.get_modpath("default") .. "/schematics/jungle_tree.mts" + local path = minetest.get_modpath("default") .. "/schematics/jungle_tree_from_sapling.mts" minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2}, path, 0, nil, false) end + -- New pine tree function default.grow_new_pine_tree(pos) - local path = minetest.get_modpath("default") .. "/schematics/pine_tree.mts" + local path = minetest.get_modpath("default") .. "/schematics/pine_tree_from_sapling.mts" minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2}, path, 0, nil, false) end + -- New acacia tree function default.grow_new_acacia_tree(pos) - local path = minetest.get_modpath("default") .. "/schematics/acacia_tree.mts" + local path = minetest.get_modpath("default") .. "/schematics/acacia_tree_from_sapling.mts" minetest.place_schematic({x = pos.x - 4, y = pos.y - 1, z = pos.z - 4}, path, random, nil, false) end diff --git a/mods/doors/README.txt b/mods/doors/README.txt index 146af8ed..5ae63caf 100644 --- a/mods/doors/README.txt +++ b/mods/doors/README.txt @@ -1,5 +1,5 @@ -Minetest 0.4 mod: doors -======================= +Minetest Game mod: doors +======================== version: 1.3 License of source code: diff --git a/mods/doors/init.lua b/mods/doors/init.lua index a5535654..6a5ee24f 100644 --- a/mods/doors/init.lua +++ b/mods/doors/init.lua @@ -129,7 +129,7 @@ function doors.register_door(name, def) local function on_rightclick(pos, dir, check_name, replace, replace_dir, params) pos.y = pos.y+dir - if not minetest.get_node(pos).name == check_name then + if minetest.get_node(pos).name ~= check_name then return end local p2 = minetest.get_node(pos).param2 diff --git a/mods/dye/README.txt b/mods/dye/README.txt index d414c2cc..b1035419 100644 --- a/mods/dye/README.txt +++ b/mods/dye/README.txt @@ -1,4 +1,4 @@ -Minetest 0.4 mod: dye +Minetest Game mod: dye ====================== See init.lua for documentation. diff --git a/mods/farming/API.txt b/mods/farming/API.txt deleted file mode 100644 index 171c3c38..00000000 --- a/mods/farming/API.txt +++ /dev/null @@ -1,28 +0,0 @@ -farming.register_hoe(name, hoe definition) - -> Register a new hoe, see [hoe definition] - -farming.register_plant(name, Plant definition) - -> Register a new growing plant, see [Plant definition] - -Hoe Definition -{ - description = "", -- Description for tooltip - inventory_image = "unknown_item.png", -- Image to be used as wield- and inventory image - max_uses = 30, -- Uses until destroyed - material = "", -- Material for recipes - recipe = { -- Craft recipe, if material isn't used - {"air", "air", "air"}, - {"", "group:stick"}, - {"", "group:stick"}, - } -} - -Plant definition -{ - description = "", -- Description of seed item - inventory_image = "unknown_item.png", -- Image to be used as seed's wield- and inventory image - steps = 8, -- How many steps the plant has to grow, until it can be harvested - ^ Always provide a plant texture for each step, format: modname_plantname_i.png (i = stepnumber) - minlight = 13, -- Minimum light to grow - maxlight = default.LIGHT_MAX -- Maximum light to grow -} \ No newline at end of file diff --git a/mods/farming/README.txt b/mods/farming/README.txt index 67246957..143cf382 100644 --- a/mods/farming/README.txt +++ b/mods/farming/README.txt @@ -1,5 +1,5 @@ -Minetest 0.4 mod: farming -========================= +Minetest Game mod: farming +========================== License of source code: ----------------------- @@ -45,4 +45,4 @@ Created by Gambit (License: WTFPL): farming_cotton_*.png farming_flour.png farming_cotton_seed.png - farming_wheat_seed.png \ No newline at end of file + farming_wheat_seed.png diff --git a/mods/farming/api.lua b/mods/farming/api.lua index 4b6f5617..7123cbc1 100644 --- a/mods/farming/api.lua +++ b/mods/farming/api.lua @@ -38,6 +38,16 @@ farming.hoe_on_use = function(itemstack, user, pointed_thing, uses) return end + if minetest.is_protected(pt.under, user:get_player_name()) then + minetest.record_protection_violation(pt.under, user:get_player_name()) + return + end + if minetest.is_protected(pt.above, user:get_player_name()) then + minetest.record_protection_violation(pt.above, user:get_player_name()) + return + end + + -- turn the node into soil, wear out item and play sound minetest.set_node(pt.under, {name = regN[under.name].soil.dry}) minetest.sound_play("default_dig_crumbly", { @@ -123,6 +133,16 @@ farming.place_seed = function(itemstack, placer, pointed_thing, plantname) local under = minetest.get_node(pt.under) local above = minetest.get_node(pt.above) + if minetest.is_protected(pt.under, placer:get_player_name()) then + minetest.record_protection_violation(pt.under, placer:get_player_name()) + return + end + if minetest.is_protected(pt.above, placer:get_player_name()) then + minetest.record_protection_violation(pt.above, placer:get_player_name()) + return + end + + -- return if any of the nodes is not registered if not minetest.registered_nodes[under.name] then return diff --git a/mods/fire/README.txt b/mods/fire/README.txt index fdbce15f..bf143e5c 100644 --- a/mods/fire/README.txt +++ b/mods/fire/README.txt @@ -1,5 +1,5 @@ -Minetest 0.4 mod: fire -====================== +Minetest Game mod: fire +======================= License of source code: ----------------------- diff --git a/mods/fire/init.lua b/mods/fire/init.lua index 20b1dd21..fc55b8dd 100644 --- a/mods/fire/init.lua +++ b/mods/fire/init.lua @@ -1,21 +1,35 @@ -- minetest/fire/init.lua +-- Global namespace for functions + fire = {} + +-- Register flame nodes + minetest.register_node("fire:basic_flame", { - description = "Fire", + description = "Basic Flame", drawtype = "firelike", - tiles = {{ - name="fire_basic_flame_animated.png", - animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1}, - }}, + tiles = { + { + name = "fire_basic_flame_animated.png", + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 1 + }, + }, + }, inventory_image = "fire_basic_flame.png", + paramtype = "light", light_source = 14, - groups = {igniter=2,dig_immediate=3}, - drop = '', walkable = false, buildable_to = true, + sunlight_propagates = true, damage_per_second = 4, + groups = {igniter = 2, dig_immediate = 3}, + drop = "", on_construct = function(pos) minetest.after(0, fire.on_flame_add_at, pos) @@ -25,48 +39,86 @@ minetest.register_node("fire:basic_flame", { minetest.after(0, fire.on_flame_remove_at, pos) end, - -- unaffected by explosions - on_blast = function() end, + on_blast = function() + end, -- unaffected by explosions }) -fire.D = 6 --- key: position hash of low corner of area --- value: {handle=sound handle, name=sound name} -fire.sounds = {} +minetest.register_node("fire:permanent_flame", { + description = "Permanent Flame", + drawtype = "firelike", + tiles = { + { + name = "fire_basic_flame_animated.png", + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 1 + }, + }, + }, + inventory_image = "fire_basic_flame.png", + paramtype = "light", + light_source = 14, + walkable = false, + buildable_to = true, + sunlight_propagates = true, + damage_per_second = 4, + groups = {igniter = 2, dig_immediate = 3}, + drop = "", + + on_blast = function() + end, +}) + + +-- Get sound area of position + +fire.D = 6 -- size of sound areas function fire.get_area_p0p1(pos) local p0 = { - x=math.floor(pos.x/fire.D)*fire.D, - y=math.floor(pos.y/fire.D)*fire.D, - z=math.floor(pos.z/fire.D)*fire.D, + x = math.floor(pos.x / fire.D) * fire.D, + y = math.floor(pos.y / fire.D) * fire.D, + z = math.floor(pos.z / fire.D) * fire.D, } local p1 = { - x=p0.x+fire.D-1, - y=p0.y+fire.D-1, - z=p0.z+fire.D-1 + x = p0.x + fire.D - 1, + y = p0.y + fire.D - 1, + z = p0.z + fire.D - 1 } return p0, p1 end + +-- Fire sounds table +-- key: position hash of low corner of area +-- value: {handle=sound handle, name=sound name} +fire.sounds = {} + + +-- Update fire sounds in sound area of position + function fire.update_sounds_around(pos) local p0, p1 = fire.get_area_p0p1(pos) - local cp = {x=(p0.x+p1.x)/2, y=(p0.y+p1.y)/2, z=(p0.z+p1.z)/2} + local cp = {x = (p0.x + p1.x) / 2, y = (p0.y + p1.y) / 2, z = (p0.z + p1.z) / 2} local flames_p = minetest.find_nodes_in_area(p0, p1, {"fire:basic_flame"}) --print("number of flames at "..minetest.pos_to_string(p0).."/" -- ..minetest.pos_to_string(p1)..": "..#flames_p) local should_have_sound = (#flames_p > 0) local wanted_sound = nil if #flames_p >= 9 then - wanted_sound = {name="fire_large", gain=1.5} + wanted_sound = {name = "fire_large", gain = 0.7} elseif #flames_p > 0 then - wanted_sound = {name="fire_small", gain=1.5} + wanted_sound = {name = "fire_small", gain = 0.9} end local p0_hash = minetest.hash_node_position(p0) local sound = fire.sounds[p0_hash] if not sound then if should_have_sound then fire.sounds[p0_hash] = { - handle = minetest.sound_play(wanted_sound, {pos=cp, max_hear_distance = 16, loop=true}), + handle = minetest.sound_play(wanted_sound, + {pos = cp, max_hear_distance = 16, loop = true}), name = wanted_sound.name, } end @@ -77,53 +129,127 @@ function fire.update_sounds_around(pos) elseif sound.name ~= wanted_sound.name then minetest.sound_stop(sound.handle) fire.sounds[p0_hash] = { - handle = minetest.sound_play(wanted_sound, {pos=cp, max_hear_distance = 16, loop=true}), + handle = minetest.sound_play(wanted_sound, + {pos = cp, max_hear_distance = 16, loop = true}), name = wanted_sound.name, } end end end + +-- Update fire sounds on flame node construct or destruct + function fire.on_flame_add_at(pos) fire.update_sounds_around(pos) end + function fire.on_flame_remove_at(pos) fire.update_sounds_around(pos) end + +-- Return positions for flames around a burning node + function fire.find_pos_for_flame_around(pos) return minetest.find_node_near(pos, 1, {"air"}) end + +-- Detect nearby extinguishing nodes + function fire.flame_should_extinguish(pos) - if minetest.setting_getbool("disable_fire") then return true end - --return minetest.find_node_near(pos, 1, {"group:puts_out_fire"}) - local p0 = {x=pos.x-2, y=pos.y, z=pos.z-2} - local p1 = {x=pos.x+2, y=pos.y, z=pos.z+2} - local ps = minetest.find_nodes_in_area(p0, p1, {"group:puts_out_fire"}) - return (#ps ~= 0) + return minetest.find_node_near(pos, 1, {"group:puts_out_fire"}) end --- Ignite neighboring nodes + +-- Extinguish all flames quickly with water, snow, ice + minetest.register_abm({ - nodenames = {"group:flammable"}, - neighbors = {"group:igniter"}, - interval = 5, + nodenames = {"fire:basic_flame", "fire:permanent_flame"}, + neighbors = {"group:puts_out_fire"}, + interval = 3, chance = 2, + catch_up = false, action = function(p0, node, _, _) - -- If there is water or stuff like that around flame, don't ignite - if fire.flame_should_extinguish(p0) then - return - end - local p = fire.find_pos_for_flame_around(p0) - if p then - minetest.set_node(p, {name="fire:basic_flame"}) - end + minetest.remove_node(p0) + minetest.sound_play("fire_extinguish_flame", + {pos = p0, max_hear_distance = 16, gain = 0.25}) end, }) + +-- Enable the following ABMs according to 'disable fire' setting + +if minetest.setting_getbool("disable_fire") then + + -- Remove basic flames only + + minetest.register_abm({ + nodenames = {"fire:basic_flame"}, + interval = 7, + chance = 2, + catch_up = false, + action = function(p0, node, _, _) + minetest.remove_node(p0) + end, + }) + +else + + -- Ignite neighboring nodes, add basic flames + + minetest.register_abm({ + nodenames = {"group:flammable"}, + neighbors = {"group:igniter"}, + interval = 7, + chance = 16, + catch_up = false, + action = function(p0, node, _, _) + -- If there is water or stuff like that around node, don't ignite + if fire.flame_should_extinguish(p0) then + return + end + local p = fire.find_pos_for_flame_around(p0) + if p then + minetest.set_node(p, {name = "fire:basic_flame"}) + end + end, + }) + + -- Remove basic flames and flammable nodes + + minetest.register_abm({ + nodenames = {"fire:basic_flame"}, + interval = 5, + chance = 16, + catch_up = false, + action = function(p0, node, _, _) + -- If there are no flammable nodes around flame, remove flame + if not minetest.find_node_near(p0, 1, {"group:flammable"}) then + minetest.remove_node(p0) + return + end + if math.random(1, 4) == 1 then + -- remove flammable nodes around flame + local p = minetest.find_node_near(p0, 1, {"group:flammable"}) + if p then + minetest.remove_node(p) + nodeupdate(p) + end + end + end, + }) + +end + + -- Rarely ignite things from far + +--[[ Currently disabled to reduce the chance of uncontrollable spreading + fires that disrupt servers. Also for less lua processing load. + minetest.register_abm({ nodenames = {"group:igniter"}, neighbors = {"air"}, @@ -143,47 +269,9 @@ minetest.register_abm({ end local p2 = fire.find_pos_for_flame_around(p) if p2 then - minetest.set_node(p2, {name="fire:basic_flame"}) + minetest.set_node(p2, {name = "fire:basic_flame"}) end end end, }) - --- Remove flammable nodes and flame -minetest.register_abm({ - nodenames = {"fire:basic_flame"}, - interval = 3, - chance = 2, - action = function(p0, node, _, _) - -- If there is water or stuff like that around flame, remove flame - if fire.flame_should_extinguish(p0) then - minetest.remove_node(p0) - return - end - -- Make the following things rarer - if math.random(1,3) == 1 then - return - end - -- If there are no flammable nodes around flame, remove flame - if not minetest.find_node_near(p0, 1, {"group:flammable"}) then - minetest.remove_node(p0) - return - end - if math.random(1,4) == 1 then - -- remove a flammable node around flame - local p = minetest.find_node_near(p0, 1, {"group:flammable"}) - if p then - -- If there is water or stuff like that around flame, don't remove - if fire.flame_should_extinguish(p0) then - return - end - minetest.remove_node(p) - nodeupdate(p) - end - else - -- remove flame - minetest.remove_node(p0) - end - end, -}) - +--]] diff --git a/mods/fire/sounds/fire_extinguish_flame.1.ogg b/mods/fire/sounds/fire_extinguish_flame.1.ogg new file mode 100644 index 00000000..42506ddf Binary files /dev/null and b/mods/fire/sounds/fire_extinguish_flame.1.ogg differ diff --git a/mods/fire/sounds/fire_extinguish_flame.2.ogg b/mods/fire/sounds/fire_extinguish_flame.2.ogg new file mode 100644 index 00000000..2747ab81 Binary files /dev/null and b/mods/fire/sounds/fire_extinguish_flame.2.ogg differ diff --git a/mods/fire/sounds/fire_extinguish_flame.3.ogg b/mods/fire/sounds/fire_extinguish_flame.3.ogg new file mode 100644 index 00000000..8baeac32 Binary files /dev/null and b/mods/fire/sounds/fire_extinguish_flame.3.ogg differ diff --git a/mods/flowers/README.txt b/mods/flowers/README.txt index f83abcda..ebd4a21f 100644 --- a/mods/flowers/README.txt +++ b/mods/flowers/README.txt @@ -1,5 +1,5 @@ -Minetest 0.4 mod: flowers -========================= +Minetest Game mod: flowers +========================== License of source code: ----------------------- @@ -16,7 +16,8 @@ License of media (textures and sounds) WTFPL Gambit (WTFPL): - flowers_mushroom_*.png + flowers_mushroom_*.png + flowers_waterlily.png DanDuncombe (WTFPL): - flowers_spores_*.png + flowers_spores_*.png diff --git a/mods/flowers/init.lua b/mods/flowers/init.lua index 07507332..dd8e031d 100644 --- a/mods/flowers/init.lua +++ b/mods/flowers/init.lua @@ -1,21 +1,29 @@ -- Minetest 0.4 mod: default -- See README.txt for licensing and other information. + -- Namespace for functions + flowers = {} -- Map Generation + dofile(minetest.get_modpath("flowers") .. "/mapgen.lua") +-- +-- Flowers +-- + -- Aliases for original flowers mod -minetest.register_alias("flowers:flower_dandelion_white", "flowers:dandelion_white") -minetest.register_alias("flowers:flower_dandelion_yellow", "flowers:dandelion_yellow") -minetest.register_alias("flowers:flower_geranium", "flowers:geranium") + minetest.register_alias("flowers:flower_rose", "flowers:rose") minetest.register_alias("flowers:flower_tulip", "flowers:tulip") +minetest.register_alias("flowers:flower_dandelion_yellow", "flowers:dandelion_yellow") +minetest.register_alias("flowers:flower_geranium", "flowers:geranium") minetest.register_alias("flowers:flower_viola", "flowers:viola") +minetest.register_alias("flowers:flower_dandelion_white", "flowers:dandelion_white") -- Flower registration @@ -31,12 +39,14 @@ local function add_simple_flower(name, desc, box, f_groups) minetest.register_node("flowers:" .. name, { description = desc, drawtype = "plantlike", + waving = 1, tiles = {"flowers_" .. name .. ".png"}, inventory_image = "flowers_" .. name .. ".png", wield_image = "flowers_" .. name .. ".png", sunlight_propagates = true, paramtype = "light", walkable = false, + buildable_to = true, stack_max = 99, groups = f_groups, sounds = default.node_sound_leaves_defaults(), @@ -61,88 +71,6 @@ for _,item in pairs(flowers.datas) do end --- Mushrooms - -local mushrooms_datas = { - {"brown", 2}, - {"red", -6} -} - -for _, m in pairs(mushrooms_datas) do - local name, nut = m[1], m[2] - - -- Register mushrooms - - minetest.register_node("flowers:mushroom_" .. name, { - description = string.sub(string.upper(name), 0, 1) .. - string.sub(name, 2) .. " Mushroom", - tiles = {"flowers_mushroom_" .. name .. ".png"}, - inventory_image = "flowers_mushroom_" .. name .. ".png", - wield_image = "flowers_mushroom_" .. name .. ".png", - drawtype = "plantlike", - paramtype = "light", - sunlight_propagates = true, - walkable = false, - buildable_to = true, - groups = {snappy = 3, flammable = 3, attached_node = 1}, - drop = { - items = { - {items = {"flowers:spores_" .. name}, rarity = 2,}, - {items = {"flowers:spores_" .. name}, rarity = 2,}, - {items = {"flowers:spores_" .. name}, rarity = 2,}, - {items = {"flowers:mushroom_" .. name},}, - }, - }, - sounds = default.node_sound_leaves_defaults(), - on_use = minetest.item_eat(nut), - selection_box = { - type = "fixed", - fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3} - } - }) - - -- Register spores - - minetest.register_node("flowers:spores_" .. name, { - description = string.sub(string.upper(name), 0, 1) .. - string.sub(name, 2) .. " Mushroom Spores", - drawtype = "signlike", - tiles = {"flowers_spores_" .. name .. ".png"}, - inventory_image = "flowers_spores_" .. name .. ".png", - wield_image = "flowers_spores_" .. name .. ".png", - paramtype = "light", - paramtype2 = "wallmounted", - sunlight_propagates = true, - walkable = false, - buildable_to = true, - selection_box = { - type = "wallmounted", - }, - groups = {dig_immediate = 3, attached_node = 1}, - }) - - -- Register growth ABMs - - minetest.register_abm({ - nodenames = {"flowers:spores_" .. name}, - interval = 14, - chance = 25, - action = function(pos, node) - local node_under = minetest.get_node_or_nil({x = pos.x, - y = pos.y - 1, z = pos.z}) - if not node_under then - return - end - if minetest.get_item_group(node_under.name, "soil") ~= 0 and - minetest.get_node_light(pos, nil) <= 13 then - minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, - {name = "flowers:mushroom_" .. name}) - end - end - }) -end - - -- Flower spread minetest.register_abm({ @@ -159,23 +87,23 @@ minetest.register_abm({ elseif under.name ~= "default:dirt_with_grass" then return end - + local light = minetest.get_node_light(pos) if not light or light < 13 then return end - + local pos0 = {x = pos.x - 4, y = pos.y - 4, z = pos.z - 4} local pos1 = {x = pos.x + 4, y = pos.y + 4, z = pos.z + 4} if #minetest.find_nodes_in_area(pos0, pos1, "group:flora_block") > 0 then return end - + local flowers = minetest.find_nodes_in_area(pos0, pos1, "group:flora") if #flowers > 3 then return end - + local seedling = minetest.find_nodes_in_area(pos0, pos1, "default:dirt_with_grass") if #seedling > 0 then seedling = seedling[math.random(#seedling)] @@ -190,3 +118,133 @@ minetest.register_abm({ end end, }) + + +-- +-- Mushrooms +-- + +minetest.register_node("flowers:mushroom_red", { + description = "Red Mushroom", + tiles = {"flowers_mushroom_red.png"}, + inventory_image = "flowers_mushroom_red.png", + wield_image = "flowers_mushroom_red.png", + drawtype = "plantlike", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + groups = {snappy = 3, flammable = 3, attached_node = 1}, + sounds = default.node_sound_leaves_defaults(), + on_use = minetest.item_eat(-5), + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3} + } +}) + +minetest.register_node("flowers:mushroom_brown", { + description = "Brown Mushroom", + tiles = {"flowers_mushroom_brown.png"}, + inventory_image = "flowers_mushroom_brown.png", + wield_image = "flowers_mushroom_brown.png", + drawtype = "plantlike", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + groups = {snappy = 3, flammable = 3, attached_node = 1}, + sounds = default.node_sound_leaves_defaults(), + on_use = minetest.item_eat(1), + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3} + } +}) + +-- mushroom spread and death +minetest.register_abm({ + nodenames = {"flowers:mushroom_brown", "flowers:mushroom_red"}, + interval = 11, + chance = 50, + action = function(pos, node) + if minetest.get_node_light(pos, nil) == 15 then + minetest.remove_node(pos) + end + local random = { + x = pos.x + math.random(-2,2), + y = pos.y + math.random(-1,1), + z = pos.z + math.random(-2,2) + } + local random_node = minetest.get_node_or_nil(random) + if not random_node then + return + end + if random_node.name ~= "air" then + return + end + local node_under = minetest.get_node_or_nil({x = random.x, + y = random.y - 1, z = random.z}) + if not node_under then + return + end + if minetest.get_item_group(node_under.name, "soil") ~= 0 and + minetest.get_node_light(pos, nil) <= 9 and + minetest.get_node_light(random, nil) <= 9 then + minetest.set_node(random, {name = node.name}) + end + end +}) + +-- these old mushroom related nodes can be simplified now +minetest.register_alias("flowers:mushroom_spores_brown", "flowers:mushroom_brown") +minetest.register_alias("flowers:mushroom_spores_red", "flowers:mushroom_red") +minetest.register_alias("flowers:mushroom_fertile_brown", "flowers:mushroom_brown") +minetest.register_alias("flowers:mushroom_fertile_red", "flowers:mushroom_red") + + +-- +-- Waterlily +-- + +minetest.register_node("flowers:waterlily", { + description = "Waterlily", + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + tiles = {"flowers_waterlily.png"}, + inventory_image = "flowers_waterlily.png", + wield_image = "flowers_waterlily.png", + liquids_pointable = true, + walkable = false, + buildable_to = true, + groups = {snappy = 3, flower = 1}, + sounds = default.node_sound_leaves_defaults(), + node_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, -0.46875, 0.5} + }, + selection_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5} + }, + + after_place_node = function(pos, placer, itemstack, pointed_thing) + local find_water = minetest.find_nodes_in_area({x = pos.x - 1, y = pos.y, z = pos.z - 1}, + {x = pos.x + 1, y = pos.y, z = pos.z + 1}, "default:water_source") + local find_river_water = minetest.find_nodes_in_area({x = pos.x - 1, y = pos.y, z = pos.z - 1}, + {x = pos.x + 1, y = pos.y, z = pos.z + 1}, "default:river_water_source") + if #find_water ~= 0 then + minetest.set_node(pos, {name = "default:water_source"}) + pos.y = pos.y + 1 + minetest.set_node(pos, {name = "flowers:waterlily", param2 = math.random(0, 3)}) + elseif #find_river_water ~= 0 then + minetest.set_node(pos, {name = "default:river_water_source"}) + pos.y = pos.y + 1 + minetest.set_node(pos, {name = "flowers:waterlily", param2 = math.random(0, 3)}) + else + minetest.remove_node(pos) + return true + end + end +}) diff --git a/mods/flowers/mapgen.lua b/mods/flowers/mapgen.lua index 5efea1fe..51525c74 100644 --- a/mods/flowers/mapgen.lua +++ b/mods/flowers/mapgen.lua @@ -1,4 +1,6 @@ +-- -- Mgv6 +-- local function register_mgv6_flower(name) minetest.register_decoration({ @@ -8,7 +10,7 @@ local function register_mgv6_flower(name) noise_params = { offset = 0, scale = 0.006, - spread = {x=100, y=100, z=100}, + spread = {x = 100, y = 100, z = 100}, seed = 436, octaves = 3, persist = 0.6 @@ -26,8 +28,8 @@ local function register_mgv6_mushroom(name) sidelen = 16, noise_params = { offset = 0, - scale = 0.006, - spread = {x=100, y=100, z=100}, + scale = 0.04, + spread = {x = 100, y = 100, z = 100}, seed = 7133, octaves = 3, persist = 0.6 @@ -35,6 +37,28 @@ local function register_mgv6_mushroom(name) y_min = 1, y_max = 30, decoration = "flowers:"..name, + spawn_by = "default:tree", + num_spawn_by = 1, + }) +end + +local function register_mgv6_waterlily() + minetest.register_decoration({ + deco_type = "schematic", + place_on = {"default:dirt"}, + sidelen = 16, + noise_params = { + offset = -0.12, + scale = 0.3, + spread = {x = 100, y = 100, z = 100}, + seed = 33, + octaves = 3, + persist = 0.7 + }, + y_min = 0, + y_max = 0, + schematic = minetest.get_modpath("flowers").."/schematics/waterlily.mts", + rotation = "random", }) end @@ -46,11 +70,16 @@ function flowers.register_mgv6_decorations() register_mgv6_flower("viola") register_mgv6_flower("dandelion_white") - register_mgv6_mushroom("mushroom_brown") - register_mgv6_mushroom("mushroom_red") + register_mgv6_mushroom("mushroom_fertile_brown") + register_mgv6_mushroom("mushroom_fertile_red") + + register_mgv6_waterlily() end --- All other biome API mapgens (not singlenode) + +-- +-- All other biome API mapgens +-- local function register_flower(seed, name) minetest.register_decoration({ @@ -58,20 +87,16 @@ local function register_flower(seed, name) place_on = {"default:dirt_with_grass"}, sidelen = 16, noise_params = { - offset = -0.02, - scale = 0.03, - spread = {x=200, y=200, z=200}, + offset = -0.015, + scale = 0.025, + spread = {x = 200, y = 200, z = 200}, seed = seed, octaves = 3, persist = 0.6 }, - biomes = { - "stone_grassland", - "sandstone_grassland", - "deciduous_forest", - "coniferous_forest", - }, - y_min = 6, + biomes = {"stone_grassland", "sandstone_grassland", + "deciduous_forest", "coniferous_forest"}, + y_min = 1, y_max = 31000, decoration = "flowers:"..name, }) @@ -85,18 +110,39 @@ local function register_mushroom(name) noise_params = { offset = 0, scale = 0.006, - spread = {x=200, y=200, z=200}, - seed = 7133, + spread = {x = 200, y = 200, z = 200}, + seed = 2, octaves = 3, - persist = 0.6 + persist = 0.66 }, biomes = {"deciduous_forest", "coniferous_forest"}, - y_min = 6, + y_min = 1, y_max = 31000, decoration = "flowers:"..name, }) end +local function register_waterlily() + minetest.register_decoration({ + deco_type = "schematic", + place_on = {"default:dirt"}, + sidelen = 16, + noise_params = { + offset = -0.12, + scale = 0.3, + spread = {x = 200, y = 200, z = 200}, + seed = 33, + octaves = 3, + persist = 0.7 + }, + biomes = {"rainforest_swamp", "savanna_swamp", "deciduous_forest_swamp"}, + y_min = 0, + y_max = 0, + schematic = minetest.get_modpath("flowers").."/schematics/waterlily.mts", + rotation = "random", + }) +end + function flowers.register_decorations() register_flower(436, "rose") register_flower(19822, "tulip") @@ -105,11 +151,16 @@ function flowers.register_decorations() register_flower(1133, "viola") register_flower(73133, "dandelion_white") - register_mushroom("mushroom_brown") - register_mushroom("mushroom_red") + register_mushroom("mushroom_fertile_brown") + register_mushroom("mushroom_fertile_red") + + register_waterlily() end + +-- -- 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 diff --git a/mods/flowers/schematics/waterlily.mts b/mods/flowers/schematics/waterlily.mts new file mode 100644 index 00000000..876310cc Binary files /dev/null and b/mods/flowers/schematics/waterlily.mts differ diff --git a/mods/flowers/textures/flowers_spores_brown.png b/mods/flowers/textures/flowers_spores_brown.png deleted file mode 100644 index a0818d23..00000000 Binary files a/mods/flowers/textures/flowers_spores_brown.png and /dev/null differ diff --git a/mods/flowers/textures/flowers_spores_red.png b/mods/flowers/textures/flowers_spores_red.png deleted file mode 100644 index 1f1d3a45..00000000 Binary files a/mods/flowers/textures/flowers_spores_red.png and /dev/null differ diff --git a/mods/flowers/textures/flowers_waterlily.png b/mods/flowers/textures/flowers_waterlily.png new file mode 100644 index 00000000..a92d3b9f Binary files /dev/null and b/mods/flowers/textures/flowers_waterlily.png differ diff --git a/mods/screwdriver/init.lua b/mods/screwdriver/init.lua index 0c77754e..34b4b4a8 100644 --- a/mods/screwdriver/init.lua +++ b/mods/screwdriver/init.lua @@ -35,6 +35,10 @@ local function screwdriver_handler(itemstack, user, pointed_thing, mode) local node = minetest.get_node(pos) local ndef = minetest.registered_nodes[node.name] + -- verify node is facedir (expected to be rotatable) + if ndef.paramtype2 ~= "facedir" then + return + end -- Compute param2 local rotationPart = node.param2 % 32 -- get first 4 bits local preservePart = node.param2 - rotationPart diff --git a/mods/screwdriver/readme.txt b/mods/screwdriver/readme.txt index ced1ff55..bdf109b8 100644 --- a/mods/screwdriver/readme.txt +++ b/mods/screwdriver/readme.txt @@ -1,5 +1,5 @@ -Minetest mod: screwdriver -========================= +Minetest Game mod: screwdriver +============================== License of source code: ----------------------- @@ -18,4 +18,4 @@ Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) http://creativecommons.org/licenses/by-sa/3.0/ Created by Gambit (WTFPL): - screwdriver.png \ No newline at end of file + screwdriver.png diff --git a/mods/stairs/README.txt b/mods/stairs/README.txt index 716a677c..9bd0b213 100644 --- a/mods/stairs/README.txt +++ b/mods/stairs/README.txt @@ -1,4 +1,4 @@ -Minetest 0.4 mod: stairs +Minetest Game mod: stairs ========================= License of source code: diff --git a/mods/stairs/depends.txt b/mods/stairs/depends.txt index 4ad96d51..d77ba253 100644 --- a/mods/stairs/depends.txt +++ b/mods/stairs/depends.txt @@ -1 +1,2 @@ default +farming diff --git a/mods/stairs/init.lua b/mods/stairs/init.lua index 078a3a28..b3e09937 100644 --- a/mods/stairs/init.lua +++ b/mods/stairs/init.lua @@ -1,9 +1,26 @@ -- Minetest 0.4 mod: stairs -- See README.txt for licensing and other information. + +-- Global namespace for functions + stairs = {} + +-- Register aliases for new pine node names + +minetest.register_alias("stairs:stair_pinewood", "stairs:stair_pine_wood") +minetest.register_alias("stairs:slab_pinewood", "stairs:slab_pine_wood") + + +-- Get setting for replace ABM + +local replace = minetest.setting_getbool("enable_stairs_replace_abm") + + +-- Register stairs. -- Node will be called stairs:stair_ + function stairs.register_stair(subname, recipeitem, groups, images, description, sounds) minetest.register_node(":stairs:stair_" .. subname, { description = description, @@ -48,7 +65,7 @@ function stairs.register_stair(subname, recipeitem, groups, images, description, param2 = minetest.dir_to_facedir(dir) end - if p0.y-1 == p1.y then + if p0.y - 1 == p1.y then param2 = param2 + 20 if param2 == 21 then param2 = 23 @@ -62,10 +79,12 @@ function stairs.register_stair(subname, recipeitem, groups, images, description, }) -- for replace ABM - minetest.register_node(":stairs:stair_" .. subname.."upside_down", { - replace_name = "stairs:stair_" .. subname, - groups = {slabs_replace=1}, - }) + if replace then + minetest.register_node(":stairs:stair_" .. subname .. "upside_down", { + replace_name = "stairs:stair_" .. subname, + groups = {slabs_replace = 1}, + }) + end minetest.register_craft({ output = 'stairs:stair_' .. subname .. ' 6', @@ -87,7 +106,10 @@ function stairs.register_stair(subname, recipeitem, groups, images, description, }) end + +-- Register slabs. -- Node will be called stairs:slab_ + function stairs.register_slab(subname, recipeitem, groups, images, description, sounds) minetest.register_node(":stairs:slab_" .. subname, { description = description, @@ -120,7 +142,8 @@ function stairs.register_slab(subname, recipeitem, groups, images, description, local n0_is_upside_down = (n0.name == "stairs:slab_" .. subname and n0.param2 >= 20) - if n0.name == "stairs:slab_" .. subname and not n0_is_upside_down and p0.y+1 == p1.y then + if n0.name == "stairs:slab_" .. subname and not n0_is_upside_down and + p0.y + 1 == p1.y then slabpos = p0 slabnode = n0 elseif n1.name == "stairs:slab_" .. subname then @@ -136,7 +159,8 @@ function stairs.register_slab(subname, recipeitem, groups, images, description, pointed_thing.above = slabpos local success - fakestack, success = minetest.item_place(fakestack, placer, pointed_thing) + fakestack, success = minetest.item_place(fakestack, placer, + pointed_thing) -- If the item was taken from the fake stack, decrement original if success then itemstack:set_count(fakestack:get_count()) @@ -148,7 +172,7 @@ function stairs.register_slab(subname, recipeitem, groups, images, description, end -- Upside down slabs - if p0.y-1 == p1.y then + if p0.y - 1 == p1.y then -- Turn into full block if pointing at a existing slab if n0_is_upside_down then -- Remove the slab at the position of the slab @@ -159,7 +183,8 @@ function stairs.register_slab(subname, recipeitem, groups, images, description, pointed_thing.above = p0 local success - fakestack, success = minetest.item_place(fakestack, placer, pointed_thing) + fakestack, success = minetest.item_place(fakestack, placer, + pointed_thing) -- If the item was taken from the fake stack, decrement original if success then itemstack:set_count(fakestack:get_count()) @@ -175,7 +200,7 @@ function stairs.register_slab(subname, recipeitem, groups, images, description, end -- If pointing at the side of a upside down slab - if n0_is_upside_down and p0.y+1 ~= p1.y then + if n0_is_upside_down and p0.y + 1 ~= p1.y then param2 = 20 end @@ -184,10 +209,12 @@ function stairs.register_slab(subname, recipeitem, groups, images, description, }) -- for replace ABM - minetest.register_node(":stairs:slab_" .. subname.."upside_down", { - replace_name = "stairs:slab_"..subname, - groups = {slabs_replace=1}, - }) + if replace then + minetest.register_node(":stairs:slab_" .. subname .. "upside_down", { + replace_name = "stairs:slab_".. subname, + groups = {slabs_replace = 1}, + }) + end minetest.register_craft({ output = 'stairs:slab_' .. subname .. ' 6', @@ -197,29 +224,41 @@ function stairs.register_slab(subname, recipeitem, groups, images, description, }) end --- Replace old "upside_down" nodes with new param2 versions -minetest.register_abm({ - nodenames = {"group:slabs_replace"}, - interval = 8, - chance = 1, - action = function(pos, node) - node.name = minetest.registered_nodes[node.name].replace_name - node.param2 = node.param2 + 20 - if node.param2 == 21 then - node.param2 = 23 - elseif node.param2 == 23 then - node.param2 = 21 - end - minetest.set_node(pos, node) - end, -}) +-- Optionally replace old "upside_down" nodes with new param2 versions. +-- Disabled by default. + +if replace then + minetest.register_abm({ + nodenames = {"group:slabs_replace"}, + interval = 8, + chance = 1, + action = function(pos, node) + node.name = minetest.registered_nodes[node.name].replace_name + node.param2 = node.param2 + 20 + if node.param2 == 21 then + node.param2 = 23 + elseif node.param2 == 23 then + node.param2 = 21 + end + minetest.set_node(pos, node) + end, + }) +end + + +-- Stair/slab registration function. -- Nodes will be called stairs:{stair,slab}_ -function stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab, sounds) + +function stairs.register_stair_and_slab(subname, recipeitem, groups, images, + desc_stair, desc_slab, sounds) stairs.register_stair(subname, recipeitem, groups, images, desc_stair, sounds) stairs.register_slab(subname, recipeitem, groups, images, desc_slab, sounds) end + +-- Register default stairs and slabs + stairs.register_stair_and_slab("wood", "default:wood", {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3}, {"default_wood.png"}, @@ -234,11 +273,11 @@ stairs.register_stair_and_slab("junglewood", "default:junglewood", "Junglewood Slab", default.node_sound_wood_defaults()) -stairs.register_stair_and_slab("pinewood", "default:pinewood", +stairs.register_stair_and_slab("pine_wood", "default:pine_wood", {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3}, - {"default_pinewood.png"}, - "Pinewood Stair", - "Pinewood Slab", + {"default_pine_wood.png"}, + "Pine Wood Stair", + "Pine Wood Slab", default.node_sound_wood_defaults()) stairs.register_stair_and_slab("acacia_wood", "default:acacia_wood", @@ -290,13 +329,6 @@ stairs.register_stair_and_slab("desert_stonebrick", "default:desert_stonebrick", "Desert Stone Brick Slab", default.node_sound_stone_defaults()) -stairs.register_stair_and_slab("brick", "default:brick", - {cracky = 3}, - {"default_brick.png"}, - "Brick Stair", - "Brick Slab", - default.node_sound_stone_defaults()) - stairs.register_stair_and_slab("sandstone", "default:sandstone", {crumbly = 2, cracky = 2}, {"default_sandstone.png"}, @@ -324,3 +356,45 @@ stairs.register_stair_and_slab("obsidianbrick", "default:obsidianbrick", "Obsidian Brick Stair", "Obsidian Brick Slab", default.node_sound_stone_defaults()) + +stairs.register_stair_and_slab("brick", "default:brick", + {cracky = 3}, + {"default_brick.png"}, + "Brick Stair", + "Brick Slab", + default.node_sound_stone_defaults()) + +stairs.register_stair_and_slab("straw", "farming:straw", + {snappy = 3, flammable = 4}, + {"farming_straw.png"}, + "Straw Stair", + "Straw Slab", + default.node_sound_leaves_defaults()) + +stairs.register_stair_and_slab("steelblock", "default:steelblock", + {cracky = 1, level = 2}, + {"default_steel_block.png"}, + "Steel Block Stair", + "Steel Block Slab", + default.node_sound_stone_defaults()) + +stairs.register_stair_and_slab("copperblock", "default:copperblock", + {cracky = 1, level = 2}, + {"default_copper_block.png"}, + "Copper Block Stair", + "Copper Block Slab", + default.node_sound_stone_defaults()) + +stairs.register_stair_and_slab("bronzeblock", "default:bronzeblock", + {cracky = 1, level = 2}, + {"default_bronze_block.png"}, + "Bronze Block Stair", + "Bronze Block Slab", + default.node_sound_stone_defaults()) + +stairs.register_stair_and_slab("goldblock", "default:goldblock", + {cracky = 1}, + {"default_gold_block.png"}, + "Gold Block Stair", + "Gold Block Slab", + default.node_sound_stone_defaults()) diff --git a/mods/tnt/README.txt b/mods/tnt/README.txt index 90a34677..df98f7e2 100644 --- a/mods/tnt/README.txt +++ b/mods/tnt/README.txt @@ -1,4 +1,5 @@ -=== TNT mod for Minetest === +Minetest Game mod: tnt +====================== by PilzAdam and ShadowNinja Introduction: diff --git a/mods/vessels/README.txt b/mods/vessels/README.txt index 150b501d..d5c3da84 100644 --- a/mods/vessels/README.txt +++ b/mods/vessels/README.txt @@ -1,4 +1,4 @@ -Minetest 0.4 mod: vessels +Minetest Game mod: vessels ========================== Crafts diff --git a/mods/wool/README.txt b/mods/wool/README.txt index 9db13327..f57b6dd3 100644 --- a/mods/wool/README.txt +++ b/mods/wool/README.txt @@ -1,5 +1,5 @@ -Minetest 0.4 mod: wool -====================== +Minetest Game mod: wool +======================= Mostly backward-compatible with jordach's 16-color wool mod. diff --git a/mods/xpanes/README.txt b/mods/xpanes/README.txt index 233978c4..b89e74a2 100644 --- a/mods/xpanes/README.txt +++ b/mods/xpanes/README.txt @@ -1,5 +1,5 @@ -Minetest 0.4.x mod: xpanes -========================== +Minetest Game mod: xpanes +========================= License: -------- diff --git a/mods/xpanes/init.lua b/mods/xpanes/init.lua index 84221d65..ebd1566f 100644 --- a/mods/xpanes/init.lua +++ b/mods/xpanes/init.lua @@ -17,11 +17,7 @@ local function update_pane(pos, name) end local sum = 0 for i, dir in pairs(directions) do - local node = minetest.get_node({ - x = pos.x + dir.x, - y = pos.y + dir.y, - z = pos.z + dir.z - }) + local node = minetest.get_node(vector.add(pos, dir)) local def = minetest.registered_nodes[node.name] local pane_num = def and def.groups.pane or 0 if pane_num > 0 or not def or (def.walkable ~= false and @@ -50,14 +46,13 @@ local function update_nearby(pos, node) name = name:sub(8, underscore_pos - 1) end for i, dir in pairs(directions) do - update_pane({ - x = pos.x + dir.x, - y = pos.y + dir.y, - z = pos.z + dir.z - }, name) + update_pane(vector.add(pos, dir), name) end end +minetest.register_on_placenode(update_nearby) +minetest.register_on_dignode(update_nearby) + local half_boxes = { {0, -0.5, -1/32, 0.5, 0.5, 1/32}, {-1/32, -0.5, 0, 1/32, 0.5, 0.5}, @@ -82,6 +77,18 @@ local sb_full_boxes = { {-0.06, -0.5, -0.5, 0.06, 0.5, 0.5} } +local pane_def_fields = { + drawtype = "airlike", + paramtype = "light", + is_ground_content = false, + sunlight_propagates = true, + walkable = false, + pointable = false, + diggable = false, + buildable_to = true, + air_equivalent = true, +} + function xpanes.register_pane(name, def) for i = 1, 15 do local need = {} @@ -132,6 +139,10 @@ function xpanes.register_pane(name, def) }) end + for k, v in pairs(pane_def_fields) do + def[k] = def[k] or v + end + def.on_construct = function(pos) update_pane(pos, name) end @@ -144,52 +155,29 @@ function xpanes.register_pane(name, def) }) end -minetest.register_on_placenode(update_nearby) -minetest.register_on_dignode(update_nearby) - xpanes.register_pane("pane", { description = "Glass Pane", - tiles = {"xpanes_space.png"}, - drawtype = "airlike", - paramtype = "light", - is_ground_content = false, - sunlight_propagates = true, - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - air_equivalent = true, textures = {"default_glass.png","xpanes_pane_half.png","xpanes_white.png"}, inventory_image = "default_glass.png", wield_image = "default_glass.png", sounds = default.node_sound_glass_defaults(), groups = {snappy=2, cracky=3, oddly_breakable_by_hand=3, pane=1}, recipe = { - {'default:glass', 'default:glass', 'default:glass'}, - {'default:glass', 'default:glass', 'default:glass'} + {"default:glass", "default:glass", "default:glass"}, + {"default:glass", "default:glass", "default:glass"} } }) xpanes.register_pane("bar", { description = "Iron bar", - tiles = {"xpanes_space.png"}, - drawtype = "airlike", - paramtype = "light", - is_ground_content = false, - sunlight_propagates = true, - walkable = false, - pointable = false, - diggable = false, - buildable_to = true, - air_equivalent = true, textures = {"xpanes_bar.png","xpanes_bar.png","xpanes_space.png"}, inventory_image = "xpanes_bar.png", wield_image = "xpanes_bar.png", groups = {snappy=2, cracky=3, oddly_breakable_by_hand=3, pane=1}, sounds = default.node_sound_stone_defaults(), recipe = { - {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, - {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'} + {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}, + {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"} } })