diff --git a/minetestforfun_game/.gitignore b/minetestforfun_game/.gitignore index ba959648..717f5fe0 100755 --- a/minetestforfun_game/.gitignore +++ b/minetestforfun_game/.gitignore @@ -1,7 +1,9 @@ ## Generic ignorable patterns and files *~ .*.swp -*.bak* +*bak* tags *.vim +## Files related to minetest development cycle +*.patch diff --git a/minetestforfun_game/game.conf b/minetestforfun_game/game.conf index cff21a9b..17e7d602 100755 --- a/minetestforfun_game/game.conf +++ b/minetestforfun_game/game.conf @@ -1 +1 @@ -name = MinetestForFun Game \ No newline at end of file +name = MinetestForFun Game diff --git a/minetestforfun_game/game_api.txt b/minetestforfun_game/game_api.txt index 205326da..791a7f92 100755 --- a/minetestforfun_game/game_api.txt +++ b/minetestforfun_game/game_api.txt @@ -23,15 +23,57 @@ The bucket API allows registering new types of buckets for non-default liquids. "bucket_lava.png", -- Bucket texture (for wielditem and inventory_image) "Lava Bucket" -- Bucket description ) - + +Beds API +-------- + beds.register_bed( + "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 + +#Bed definition +--------------- +{ + description = "Simple Bed", + inventory_image = "beds_bed.png", + wield_image = "beds_bed.png", + tiles = { + bottom = {[Tile definition], + ^ the tiles of the bottom part of the bed + }, + top = {[Tile definition], + ^ the tiles of the bottom part of the bed + } + }, + nodebox = { + 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 + {"group:wool", "group:wool", "group:wool"}, + {"group:wood", "group:wood", "group:wood"} + } +} + Doors API --------- -The doors mod allows modders to register custom doors. +The doors mod allows modders to register custom doors and trapdoors. + +doors.register_door(name, def) +^ name: "Door name" +^ def: See [#Door definition] + -> Registers new door + +doors.register_trapdoor(name, def) +^ name: "Trapdoor name" +^ def: See [#Trapdoor definition] + -> Registers new trapdoor - doors.register_door(name, def) - ^ name: "Door name" - ^ def: See [#Door definition] - #Door definition ---------------- { @@ -46,17 +88,34 @@ The doors mod allows modders to register custom doors. node_box_top = regular nodebox, see [Node boxes], OPTIONAL, selection_box_bottom = regular nodebox, see [Node boxes], OPTIONAL, selection_box_top = regular nodebox, see [Node boxes], OPTIONAL, + sound_open_door = sound play for open door, OPTIONAL, + sound_close_door = sound play for close door, OPTIONAL, only_placer_can_open = true/false, ^ If true, only placer can open the door (locked for others) } +#Trapdoor definition +---------------- +{ + tile_front = "doors_trapdoor.png", + ^ the texture for the front and back of the trapdoor + tile_side: "doors_trapdoor_side.png", + ^ the tiles of the four side parts of the trapdoor + 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 +} + Farming API ----------- The farming API allows you to easily register plants and hoes. 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] @@ -66,7 +125,8 @@ farming.register_plant(name, Plant 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 - recipe = { -- Craft recipe + material = "", -- Material for recipes + recipe = { -- Craft recipe, if material isn't used {"air", "air", "air"}, {"", "group:stick"}, {"", "group:stick"}, @@ -79,11 +139,26 @@ farming.register_plant(name, 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 ech step, format: modname_plantname_i.png (i = stepnumber) + ^ 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 } +Screwdriver API +--------------- +The screwdriver API allows you to control a node's behaviour when a screwdriver is used on it. +To use it, add the on_screwdriver function to the node definition. +on_rotate(pos, node, user, mode, new_param2) +^ pos: position of the node that the screwdriver is being used on +^ node: that node +^ user: the player who used the screwdriver +^ 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) +^ 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 @@ -97,7 +172,7 @@ stairs.register_stair(subname, recipeitem, groups, images, description, sounds) -> images: see [Tile definition] -> description: used for the description field in the stair's definition -> sounds: see [#Default sounds] - + stairs.register_slab(subname, recipeitem, groups, images, description, sounds) -> Registers a slabs -> subname: Basically the material name (e.g. cobble) used for the stair name. Nodename pattern: "stairs:stair_subname" @@ -106,19 +181,19 @@ stairs.register_slab(subname, recipeitem, groups, images, description, sounds) -> images: see [Tile definition] -> description: used for the description field in the stair's definition -> sounds: see [#Default sounds] - + stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab, sounds) -> A wrapper for stairs.register_stair and stairs.register_slab -> Uses almost the same arguments as stairs.register_stair -> desc_stair: Description for stair node -> desc_slab: Description for slab node - + Xpanes API ---------- Creates panes that automatically connect to each other xpanes.register_pane(subname, def) - -> subname: used for nodename. Result: "xpanes:subname_{1..16}" + -> subname: used for nodename. Result: "xpanes:subname" and "xpanes:subname_{2..15}" -> def: See [#Pane definition] #Pane definition @@ -132,12 +207,26 @@ xpanes.register_pane(subname, def) ^ See [#Default sounds] recipe = {{"","","","","","","","",""}}, ^ Recipe field only - on_construct = function(pos) - update_pane(pos, "pane") - end, - ^ Required to handle rotation correctly } +Raillike definitions +-------------------- +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" +| tnt:gunpowder_burning | "gunpowder" + +Example: +If you want to add a new rail type and want it to connect with default:rail, +add `connect_to_raillike=minetest.raillike_group("rail")` into the `groups` table +of your node. + + Default sounds -------------- Sounds inside the default table can be used within the sounds field of node definitions. @@ -206,6 +295,7 @@ Model Definition Leafdecay --------- To enable leaf decay for a node, add it to the "leafdecay" group. + The rating of the group determines how far from a node in the group "tree" the node can be without decaying. @@ -278,6 +368,7 @@ minetest.register_craft({ ------------ dye.basecolors ^ Array containing the names of available base colors + dye.excolors ^ Array containing the names of the available extended colors diff --git a/minetestforfun_game/minetest.conf.example b/minetestforfun_game/minetest.conf.example index b98be573..47d03b00 100755 --- a/minetestforfun_game/minetest.conf.example +++ b/minetestforfun_game/minetest.conf.example @@ -21,4 +21,8 @@ #enable_tnt = # The radius of a TNT explosion -#tnt_radius = 3 \ No newline at end of file +#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 diff --git a/minetestforfun_game/mods/boats/init.lua b/minetestforfun_game/mods/boats/init.lua index af10a9c2..3ea3eb1b 100755 --- a/minetestforfun_game/mods/boats/init.lua +++ b/minetestforfun_game/mods/boats/init.lua @@ -1,4 +1,3 @@ - -- -- Helper functions -- @@ -290,6 +289,7 @@ minetest.register_craft({ }, }) + minetest.register_craft({ output = "boats:boat", recipe = { @@ -297,4 +297,3 @@ minetest.register_craft({ {"group:wood", "group:wood", "group:wood"}, }, }) - diff --git a/minetestforfun_game/mods/default/README.txt b/minetestforfun_game/mods/default/README.txt index 9ca52fde..13fdef5f 100755 --- a/minetestforfun_game/mods/default/README.txt +++ b/minetestforfun_game/mods/default/README.txt @@ -58,7 +58,6 @@ 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 @@ -121,12 +120,13 @@ paramat (CC BY-SA 3.0): 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 diff --git a/minetestforfun_game/mods/default/mapgen.lua b/minetestforfun_game/mods/default/mapgen.lua index 49f8d96d..b834efb3 100755 --- a/minetestforfun_game/mods/default/mapgen.lua +++ b/minetestforfun_game/mods/default/mapgen.lua @@ -905,7 +905,7 @@ function default.register_biomes() --node_water_top = "", --depth_water_top = , --node_water = "", - y_min = 1, + y_min = 5, y_max = 31000, heat_point = 95, humidity_point = 10, @@ -923,7 +923,7 @@ function default.register_biomes() --depth_water_top = , --node_water = "", y_min = -112, - y_max = 0, + y_max = 4, heat_point = 95, humidity_point = 10, }) @@ -1292,7 +1292,7 @@ function default.register_decorations() 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", @@ -1314,11 +1314,11 @@ function default.register_decorations() 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 diff --git a/minetestforfun_game/mods/default/nodes.lua b/minetestforfun_game/mods/default/nodes.lua index bb131219..1c8f4606 100755 --- a/minetestforfun_game/mods/default/nodes.lua +++ b/minetestforfun_game/mods/default/nodes.lua @@ -162,6 +162,7 @@ default:chest_locked default:bookshelf default:sign_wall + default:ladder default:ladder_obsidian default:fence_wood @@ -194,7 +195,7 @@ default:nyancat_rainbow minetest.register_node("default:stone", { description = "Stone", tiles = {"default_stone.png"}, - is_ground_content = true, + is_ground_content = false, groups = {cracky = 3, stone = 1}, drop = { items = { @@ -207,7 +208,7 @@ minetest.register_node("default:stone", { minetest.register_node("default:cobble", { description = "Cobblestone", tiles = {"default_cobble.png"}, - is_ground_content = true, + is_ground_content = false, groups = {cracky=3, stone=2}, sounds = default.node_sound_stone_defaults(), }) @@ -224,6 +225,7 @@ minetest.register_node("default:cobble_cooled", { minetest.register_node("default:stonebrick", { description = "Stone Brick", tiles = {"default_stone_brick.png"}, + is_ground_content = false, groups = {cracky = 2, stone = 1}, sounds = default.node_sound_stone_defaults(), }) @@ -231,7 +233,7 @@ minetest.register_node("default:stonebrick", { minetest.register_node("default:mossycobble", { description = "Mossy Cobblestone", tiles = {"default_mossycobble.png"}, - is_ground_content = true, + is_ground_content = false, groups = {cracky=3, stone=1}, drop = { items = { @@ -244,11 +246,10 @@ minetest.register_node("default:mossycobble", { }) - minetest.register_node("default:desert_stone", { description = "Desert Stone", tiles = {"default_desert_stone.png"}, - is_ground_content = true, + legacy_mineral = true, groups = {crumbly = 1, cracky = 3, stone = 1}, drop = { items = { @@ -262,7 +263,7 @@ minetest.register_node("default:desert_stone", { minetest.register_node("default:desert_cobble", { description = "Desert Cobblestone", tiles = {"default_desert_cobble.png"}, - is_ground_content = true, + is_ground_content = false, groups = {cracky = 3, stone = 2}, sounds = default.node_sound_stone_defaults(), }) @@ -271,16 +272,14 @@ 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"}, - is_ground_content = true, groups = {crumbly=1,cracky=3}, sounds = default.node_sound_stone_defaults(), }) @@ -288,19 +287,18 @@ minetest.register_node("default:sandstone", { minetest.register_node("default:sandstonebrick", { description = "Sandstone Brick", tiles = {"default_sandstone_brick.png"}, - is_ground_content = true, + is_ground_content = false, groups = {cracky=2}, sounds = default.node_sound_stone_defaults(), }) - minetest.register_node("default:obsidian", { description = "Obsidian", tiles = {"default_obsidian.png"}, is_ground_content = true, sounds = default.node_sound_stone_defaults(), - groups = {cracky=1,level=2}, + groups = {cracky = 1, level = 2}, }) minetest.register_node("default:obsidian_cooled", { @@ -317,7 +315,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}, }) -- @@ -327,7 +325,6 @@ minetest.register_node("default:obsidianbrick", { minetest.register_node("default:dirt", { description = "Dirt", tiles = {"default_dirt.png"}, - is_ground_content = true, groups = {crumbly=3, soil=1}, drop = { items = { @@ -340,8 +337,9 @@ minetest.register_node("default:dirt", { 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"}, - is_ground_content = true, + tiles = {"default_grass.png", "default_dirt.png", + {name = "default_dirt.png^default_grass_side.png", + tileable_vertical = false}}, groups = {crumbly=3,soil=1}, drop = { items = { @@ -356,11 +354,12 @@ minetest.register_node("default:dirt_with_grass", { minetest.register_node("default:dirt_with_grass_footsteps", { description = "Dirt with Grass and Footsteps", tiles = {"default_grass.png^default_footprint.png", "default_dirt.png", - "default_dirt.png^default_grass_side.png"}, - groups = {crumbly=3,soil=1,not_in_creative_inventory=1}, + {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}, + footstep = {name = "default_grass_footstep", gain = 0.25}, }), }) @@ -368,8 +367,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({ @@ -379,9 +378,10 @@ minetest.register_node("default:dirt_with_dry_grass", { 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"}, - is_ground_content = true, - 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 = { items = { {items = {"default:dirt"}}, @@ -394,39 +394,35 @@ minetest.register_node("default:dirt_with_snow", { }) - minetest.register_node("default:sand", { description = "Sand", tiles = {"default_sand.png"}, + groups = {crumbly = 3, falling_node = 1, sand = 1}, is_ground_content = true, drop = { items = { {items = {"default:sand"}}, }, }, - 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"}, - is_ground_content = true, drop = { items = { {items = {"default:desert_sand"}}, }, }, - 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"}, - is_ground_content = true, groups = {crumbly=2, falling_node=1}, drop = { items = { @@ -440,7 +436,6 @@ minetest.register_node("default:gravel", { }) - minetest.register_node("default:clay", { description = "Clay", tiles = {"default_clay.png"}, @@ -469,7 +464,6 @@ minetest.register_node("default:clay_burned", { }) - minetest.register_node("default:snow", { description = "Snow", tiles = {"default_snow.png"}, @@ -489,7 +483,7 @@ minetest.register_node("default:snow", { {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5}, }, }, - groups = {crumbly=3,falling_node=1, melts = 1, float = 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}, @@ -503,31 +497,26 @@ minetest.register_node("default:snow", { end, }) - minetest.register_node("default:snowblock", { description = "Snow Block", tiles = {"default_snow.png"}, - is_ground_content = true, - freezemelt = "default:water_source", - groups = {crumbly=3, melts = 1}, + 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", drawtype = "glasslike", tiles = {"default_ice.png"}, is_ground_content = true, paramtype = "light", + groups = {cracky = 3, puts_out_fire = 1}, use_texture_alpha = true, - freezemelt = "default:water_source", post_effect_color = {a = 120, r = 120, g = 160, b = 180}, - groups = {cracky = 3, melts = 1}, sounds = default.node_sound_glass_defaults(), }) @@ -540,7 +529,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(), drop = { items = { @@ -555,7 +544,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(), }) @@ -574,7 +563,8 @@ minetest.register_node("default:sapling", { type = "fixed", fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3} }, - groups = {snappy=3,flammable=2,attached_node=1,sapling=1}, + groups = {snappy = 3, flammable=2, + attached_node = 1, sapling = 1}, sounds = default.node_sound_leaves_defaults(), }) @@ -588,7 +578,7 @@ minetest.register_node("default:leaves", { paramtype = "light", walkable = false, 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 = { @@ -623,30 +613,31 @@ 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}, drop = { items = { {items = {"default:jungletree"}}, }, }, - groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2}, sounds = default.node_sound_wood_defaults(), on_place = minetest.rotate_node @@ -656,7 +647,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(), }) @@ -669,7 +660,7 @@ minetest.register_node("default:jungleleaves", { paramtype = "light", is_ground_content = false, walkable = false, - groups = {snappy=3, leafdecay=3, flammable=2, leaves=1}, + groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1}, drop = { max_items = 1, items = { @@ -703,12 +694,12 @@ 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:pine_tree", { description = "Pine Tree", tiles = {"default_pine_tree_top.png", "default_pine_tree_top.png", @@ -770,6 +761,7 @@ minetest.register_node("default:pine_sapling", { 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", @@ -795,6 +787,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}, @@ -924,8 +917,7 @@ minetest.register_node("default:cherry_sapling", { minetest.register_node("default:stone_with_coal", { description = "Coal Ore", tiles = {"default_stone.png^default_mineral_coal.png"}, - is_ground_content = true, - groups = {cracky=3}, + groups = {cracky = 3}, drop = { items = { {items = {"default:cobble"}}, @@ -954,18 +946,16 @@ minetest.register_node("default:desert_stone_with_coal", { minetest.register_node("default:coalblock", { description = "Coal Block", tiles = {"default_coal_block.png"}, - is_ground_content = true, - groups = {cracky=3}, + is_ground_content = false, + 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"}, - is_ground_content = true, - groups = {cracky=3}, + groups = {cracky = 3}, drop = { items = { {items = {"default:cobble"}}, @@ -979,18 +969,17 @@ minetest.register_node("default:stone_with_iron", { minetest.register_node("default:steelblock", { description = "Steel Block", tiles = {"default_steel_block.png"}, - is_ground_content = true, - groups = {cracky=1,level=2, ingot_block = 1}, + is_ground_content = false, + groups = {cracky = 1,level = 2, ingot_block = 1}, sounds = default.node_sound_metal_defaults(), }) - minetest.register_node("default:stone_with_copper", { description = "Copper Ore", tiles = {"default_stone.png^default_mineral_copper.png"}, is_ground_content = true, - groups = {cracky=3}, + groups = {cracky = 3}, drop = { items = { {items = {"default:cobble"}}, @@ -1019,21 +1008,20 @@ minetest.register_node("default:desert_stone_with_copper", { minetest.register_node("default:copperblock", { description = "Copper Block", tiles = {"default_copper_block.png"}, - is_ground_content = true, - groups = {cracky=1,level=2, ingot_block = 1}, + is_ground_content = false, + groups = {cracky = 1, level = 2, ingot_block = 1}, sounds = default.node_sound_metal_defaults(), }) minetest.register_node("default:bronzeblock", { description = "Bronze Block", tiles = {"default_bronze_block.png"}, - is_ground_content = true, - groups = {cracky=1,level=2, ingot_block = 1}, + is_ground_content = false, + groups = {cracky = 1, level = 2, ingot_block = 1}, sounds = default.node_sound_metal_defaults(), }) - minetest.register_node("default:stone_with_mese", { description = "Mese Ore", tiles = {"default_stone.png^default_mineral_mese.png"}, @@ -1092,13 +1080,10 @@ minetest.register_node("default:meze", { minetest.register_alias("default:meze_block", "default:meze") - - minetest.register_node("default:stone_with_gold", { description = "Gold Ore", tiles = {"default_stone.png^default_mineral_gold.png"}, - is_ground_content = true, - groups = {cracky=3}, + groups = {cracky = 3}, drop = { items = { {items = {"default:cobble"}}, @@ -1113,8 +1098,8 @@ minetest.register_node("default:stone_with_gold", { minetest.register_node("default:goldblock", { description = "Gold Block", tiles = {"default_gold_block.png"}, - is_ground_content = true, - groups = {cracky=1, ingot_block = 1}, + is_ground_content = false, + groups = {cracky = 1, ingot_block = 1}, sounds = default.node_sound_metal_defaults(), }) @@ -1123,8 +1108,7 @@ minetest.register_node("default:goldblock", { minetest.register_node("default:stone_with_diamond", { description = "Diamond Ore", tiles = {"default_stone.png^default_mineral_diamond.png"}, - is_ground_content = true, - groups = {cracky=3}, + groups = {cracky = 3}, drop = { items = { {items = {"default:cobble"}}, @@ -1138,8 +1122,8 @@ minetest.register_node("default:stone_with_diamond", { minetest.register_node("default:diamondblock", { description = "Diamond Block", tiles = {"default_diamond_block.png"}, - is_ground_content = true, - groups = {cracky=1,level=3}, + is_ground_content = false, + groups = {cracky = 1, level = 3}, sounds = default.node_sound_metal_defaults(), }) @@ -1164,10 +1148,10 @@ minetest.register_node("default:stone_with_coin", { 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", - is_ground_content = true, - groups = {snappy=1,choppy=3,flammable=2}, + groups = {snappy = 1, choppy = 3, flammable = 2}, drop = { items = { {items = {"default:cactus"}}, @@ -1195,7 +1179,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) @@ -1216,7 +1200,7 @@ minetest.register_node("default:dry_shrub", { walkable = false, is_ground_content = true, 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", @@ -1235,8 +1219,7 @@ minetest.register_node("default:junglegrass", { sunlight_propagates = true, walkable = false, buildable_to = true, - is_ground_content = 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", @@ -1244,6 +1227,7 @@ minetest.register_node("default:junglegrass", { }, }) + minetest.register_node("default:grass_1", { description = "Grass", drawtype = "plantlike", @@ -1257,7 +1241,7 @@ minetest.register_node("default:grass_1", { walkable = false, is_ground_content = true, 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", @@ -1266,27 +1250,29 @@ 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, is_ground_content = 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", @@ -1295,6 +1281,7 @@ for i=2,5 do }) end + minetest.register_node("default:dry_grass_1", { description = "Dry Grass", drawtype = "plantlike", @@ -1306,7 +1293,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", @@ -1315,25 +1302,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 = { @@ -1388,9 +1377,8 @@ minetest.register_node("default:water_source", { liquid_alternative_flowing = "default:water_flowing", liquid_alternative_source = "default:water_source", liquid_viscosity = 1, - freezemelt = "default:ice", post_effect_color = {a = 120, r = 20, g = 60, b = 80}, - groups = {water=3, liquid=3, puts_out_fire=1, freezes = 1}, + groups = {water = 3, liquid = 3, puts_out_fire = 1}, }) minetest.register_node("default:water_flowing", { @@ -1434,9 +1422,9 @@ minetest.register_node("default:water_flowing", { liquid_alternative_flowing = "default:water_flowing", liquid_alternative_source = "default:water_source", liquid_viscosity = 1, - freezemelt = "default:snow", - post_effect_color = {a=120, r=20, g=60, b=80}, - groups = {water=3, liquid=3, puts_out_fire=1, not_in_creative_inventory=1, freezes = 1, melt_around = 1}, + post_effect_color = {a = 120, r = 20, g = 60, b = 80}, + groups = {water = 3, liquid = 3, puts_out_fire = 1, + not_in_creative_inventory=1}, }) minetest.register_node("default:river_water_source", { @@ -1481,8 +1469,8 @@ minetest.register_node("default:river_water_source", { liquid_viscosity = 1, liquid_renewable = false, liquid_range = 2, - post_effect_color = {a=64, r=100, g=100, b=200}, - groups = {water=3, liquid=3, puts_out_fire=1}, + post_effect_color = {a = 64, r = 100, g = 100, b = 200}, + groups = {water = 3, liquid = 3, puts_out_fire = 1}, }) minetest.register_node("default:river_water_flowing", { @@ -1528,8 +1516,9 @@ minetest.register_node("default:river_water_flowing", { liquid_viscosity = 1, liquid_renewable = false, liquid_range = 2, - post_effect_color = {a=64, r=100, g=100, b=200}, - groups = {water=3, liquid=3, puts_out_fire=1, not_in_creative_inventory=1}, + post_effect_color = {a = 64, r = 100, g = 100, b = 200}, + groups = {water = 3, liquid = 3, puts_out_fire = 1, + not_in_creative_inventory = 1}, }) minetest.register_node("default:lava_source", { @@ -1575,8 +1564,8 @@ minetest.register_node("default:lava_source", { liquid_viscosity = 7, liquid_renewable = false, damage_per_second = 4 * 2, - post_effect_color = {a=220, r=250, g=70, b=20}, - groups = {lava=3, liquid=2, hot=3, igniter=1}, + post_effect_color = {a = 220, r = 250, g = 70, b = 20}, + groups = {lava = 3, liquid = 2, hot = 3, igniter = 1}, }) minetest.register_node("default:lava_flowing", { @@ -1622,8 +1611,9 @@ minetest.register_node("default:lava_flowing", { liquid_viscosity = 7, liquid_renewable = false, damage_per_second = 4 * 2, - post_effect_color = {a=220, r=250, g=70, b=20}, - groups = {lava=3, liquid=2, hot=3, igniter=1, not_in_creative_inventory=1}, + post_effect_color = {a = 220, r = 250, g = 70, b = 20}, + groups = {lava = 3, liquid = 2, hot = 3, igniter = 1, + not_in_creative_inventory = 1}, }) minetest.register_node("default:acid_source", { @@ -1806,25 +1796,37 @@ minetest.register_node("default:torch", { wall_bottom = {-0.25, -0.5 , -0.25, 0.25, 0.0625, 0.25}, wall_side = {-0.25, -0.5 , -0.25, -0.5, 0.0625, 0.25}, }, - groups = {choppy=2,dig_immediate=3,flammable=1,attached_node=1, hot = 2}, + groups = {choppy = 2, dig_immediate = 3, flammable = 1, attached_node = 1, + hot = 2}, + legacy_wallmounter = true, sounds = default.node_sound_wood_defaults(), }) local chest_formspec = "size[8,9]".. default.gui_slots .. + default.gui_bg_img .. + default.gui_slots .. "list[current_name;main;0,0.3;8,4;]" .. - "list[current_player;main;0,4.85;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) .. default.get_hotbar_bg(0, 5.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_slots.. + default.gui_bg_img .. + default.gui_slots .. "list[nodemeta:".. spos .. ";main;0,0.3;8,4;]".. "list[current_player;main;0,4.85;8,4;]".. + "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) .. default.get_hotbar_bg(0, 5.85) return formspec @@ -1842,8 +1844,8 @@ 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}, - is_ground_content = false, + groups = {choppy = 2, oddly_breakable_by_hand = 2}, + legacy_facedir_simple = true, sounds = default.node_sound_wood_defaults(), on_construct = function(pos) @@ -1858,17 +1860,18 @@ 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) .. ".") + " 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, }) @@ -1878,29 +1881,30 @@ minetest.register_node("default:chest_locked", { 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}, - is_ground_content = false, + groups = {choppy = 2, oddly_breakable_by_hand = 2}, + legacy_facedir_simple = true, sounds = default.node_sound_wood_defaults(), 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 minetest.log("action", player:get_player_name().. @@ -1938,12 +1942,12 @@ minetest.register_node("default:chest_locked", { " moves stuff in locked 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 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) @@ -1964,8 +1968,13 @@ minetest.register_node("default:chest_locked", { default.bookshelf_formspec = "size[8,7;]" .. default.gui_slots .. - "list[context;books;0, 0.3;8,2;]" .. - "list[current_player;main;0,2.85;8,4;]" .. + 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) .. default.get_hotbar_bg(0, 3.85) @@ -1973,15 +1982,14 @@ minetest.register_node("default:bookshelf", { description = "Bookshelf", tiles = {"default_wood.png", "default_wood.png", "default_bookshelf.png"}, is_ground_content = false, - paramtype2 = "facedir", - 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", default.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); @@ -2003,7 +2011,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) @@ -2018,20 +2027,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", @@ -2049,8 +2060,8 @@ 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}, }, - selection_box = {type = "wallmounted"}, - groups = {choppy=2,dig_immediate=2,attached_node=1}, + legacy_wallmounted = true, + groups = {choppy = 2, dig_immediate = 2, attached_node = 1}, sounds = default.node_sound_wood_defaults(), on_construct = function(pos) @@ -2067,13 +2078,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 = "nodebox", @@ -2090,11 +2102,14 @@ minetest.register_node("default:ladder", { wall_bottom = {-0.375, -0.5, -0.5, 0.375, -0.4375, 0.5}, wall_side = {-0.5, -0.5, -0.375, -0.4375, 0.5, 0.375}, }, - selection_box = {type = "wallmounted"}, - 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" + minetest.register_node("default:ladder_obsidian", { description = "Ladder Obsidian", drawtype = "nodebox", @@ -2130,7 +2145,8 @@ minetest.register_node("default:fence_wood", { type = "fixed", fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7}, }, - groups = {not_in_creative_inventory=1,choppy=2,oddly_breakable_by_hand=2,flammable=2}, + groups = {not_in_creative_inventory = 1, choppy = 2, oddly_breakable_by_hand = 2, + flammable = 2}, sounds = default.node_sound_wood_defaults(), }) @@ -2213,7 +2229,7 @@ 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(), }) @@ -2225,14 +2241,15 @@ minetest.register_node("default:obsidian_glass", { 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", @@ -2244,14 +2261,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=1}, -- //MFF Temporary fix (Mg|06/21/2015) 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}, drop = "default:clay_brick 9", sounds = default.node_sound_stone_defaults(), }) @@ -2279,7 +2298,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", { @@ -2289,7 +2308,7 @@ minetest.register_node("default:nyancat", { paramtype = "light", paramtype2 = "facedir", light_source = default.LIGHT_MAX - 1, - groups = {cracky=2}, + groups = {cracky = 2}, is_ground_content = false, post_effect_color = {a = 128, r= 255, g= 128, b= 255}, sounds = default.node_sound_stone_defaults(), @@ -2304,7 +2323,7 @@ minetest.register_node("default:nyancat_rainbow", { }, paramtype = "light", paramtype2 = "facedir", - groups = {cracky=2}, + groups = {cracky = 2}, light_source = default.LIGHT_MAX - 1, sunlight_propagates = true, walkable = false, diff --git a/minetestforfun_game/mods/default/schematics/acacia_tree_from_sapling.mts b/minetestforfun_game/mods/default/schematics/acacia_tree_from_sapling.mts new file mode 100644 index 00000000..23e8e4b3 Binary files /dev/null and b/minetestforfun_game/mods/default/schematics/acacia_tree_from_sapling.mts differ diff --git a/minetestforfun_game/mods/default/schematics/apple_tree_from_sapling.mts b/minetestforfun_game/mods/default/schematics/apple_tree_from_sapling.mts new file mode 100644 index 00000000..8753f2a9 Binary files /dev/null and b/minetestforfun_game/mods/default/schematics/apple_tree_from_sapling.mts differ diff --git a/minetestforfun_game/mods/default/schematics/jungle_tree_from_sapling.mts b/minetestforfun_game/mods/default/schematics/jungle_tree_from_sapling.mts new file mode 100644 index 00000000..39d46d7c Binary files /dev/null and b/minetestforfun_game/mods/default/schematics/jungle_tree_from_sapling.mts differ diff --git a/minetestforfun_game/mods/default/schematics/papyrus.mts b/minetestforfun_game/mods/default/schematics/papyrus.mts old mode 100755 new mode 100644 index a3b67776..8af4dc2b Binary files a/minetestforfun_game/mods/default/schematics/papyrus.mts and b/minetestforfun_game/mods/default/schematics/papyrus.mts differ diff --git a/minetestforfun_game/mods/default/schematics/pine_tree_from_sapling.mts b/minetestforfun_game/mods/default/schematics/pine_tree_from_sapling.mts new file mode 100644 index 00000000..629c5da0 Binary files /dev/null and b/minetestforfun_game/mods/default/schematics/pine_tree_from_sapling.mts differ diff --git a/minetestforfun_game/mods/default/textures/default_cactus_side_normal.png b/minetestforfun_game/mods/default/textures/default_cactus_side_normal.png new file mode 100644 index 00000000..278f7234 Binary files /dev/null and b/minetestforfun_game/mods/default/textures/default_cactus_side_normal.png differ diff --git a/minetestforfun_game/mods/default/textures/default_cactus_top_normal.png b/minetestforfun_game/mods/default/textures/default_cactus_top_normal.png new file mode 100644 index 00000000..ba361ba0 Binary files /dev/null and b/minetestforfun_game/mods/default/textures/default_cactus_top_normal.png differ diff --git a/minetestforfun_game/mods/default/textures/default_desert_stone_brick_normal.png b/minetestforfun_game/mods/default/textures/default_desert_stone_brick_normal.png new file mode 100644 index 00000000..9ef5865b Binary files /dev/null and b/minetestforfun_game/mods/default/textures/default_desert_stone_brick_normal.png differ diff --git a/minetestforfun_game/mods/default/textures/default_dirt_normal.png b/minetestforfun_game/mods/default/textures/default_dirt_normal.png new file mode 100644 index 00000000..e12e9416 Binary files /dev/null and b/minetestforfun_game/mods/default/textures/default_dirt_normal.png differ diff --git a/minetestforfun_game/mods/default/textures/default_dry_grass_normal.png b/minetestforfun_game/mods/default/textures/default_dry_grass_normal.png new file mode 100644 index 00000000..e6b16c11 Binary files /dev/null and b/minetestforfun_game/mods/default/textures/default_dry_grass_normal.png differ diff --git a/minetestforfun_game/mods/default/textures/default_dry_grass_side_normal.png b/minetestforfun_game/mods/default/textures/default_dry_grass_side_normal.png new file mode 100644 index 00000000..22518708 Binary files /dev/null and b/minetestforfun_game/mods/default/textures/default_dry_grass_side_normal.png differ diff --git a/minetestforfun_game/mods/default/textures/default_grass_normal.png b/minetestforfun_game/mods/default/textures/default_grass_normal.png new file mode 100644 index 00000000..e6b16c11 Binary files /dev/null and b/minetestforfun_game/mods/default/textures/default_grass_normal.png differ diff --git a/minetestforfun_game/mods/default/textures/default_grass_side_normal.png b/minetestforfun_game/mods/default/textures/default_grass_side_normal.png new file mode 100644 index 00000000..22518708 Binary files /dev/null and b/minetestforfun_game/mods/default/textures/default_grass_side_normal.png differ diff --git a/minetestforfun_game/mods/default/textures/default_jungletree_normal.png b/minetestforfun_game/mods/default/textures/default_jungletree_normal.png new file mode 100644 index 00000000..d535e862 Binary files /dev/null and b/minetestforfun_game/mods/default/textures/default_jungletree_normal.png differ diff --git a/minetestforfun_game/mods/default/textures/default_jungletree_top_normal.png b/minetestforfun_game/mods/default/textures/default_jungletree_top_normal.png new file mode 100644 index 00000000..b31162eb Binary files /dev/null and b/minetestforfun_game/mods/default/textures/default_jungletree_top_normal.png differ diff --git a/minetestforfun_game/mods/default/textures/default_junglewood_normal.png b/minetestforfun_game/mods/default/textures/default_junglewood_normal.png new file mode 100644 index 00000000..5d45d7b5 Binary files /dev/null and b/minetestforfun_game/mods/default/textures/default_junglewood_normal.png differ diff --git a/minetestforfun_game/mods/default/textures/default_tree_normal.png b/minetestforfun_game/mods/default/textures/default_tree_normal.png new file mode 100644 index 00000000..4616a0a8 Binary files /dev/null and b/minetestforfun_game/mods/default/textures/default_tree_normal.png differ diff --git a/minetestforfun_game/mods/default/textures/default_tree_top_normal.png b/minetestforfun_game/mods/default/textures/default_tree_top_normal.png new file mode 100644 index 00000000..b31162eb Binary files /dev/null and b/minetestforfun_game/mods/default/textures/default_tree_top_normal.png differ diff --git a/minetestforfun_game/mods/default/textures/default_wood_normal.png b/minetestforfun_game/mods/default/textures/default_wood_normal.png new file mode 100644 index 00000000..5d45d7b5 Binary files /dev/null and b/minetestforfun_game/mods/default/textures/default_wood_normal.png differ diff --git a/minetestforfun_game/mods/default/trees.lua b/minetestforfun_game/mods/default/trees.lua index 08d4d8d8..b1bdd190 100755 --- a/minetestforfun_game/mods/default/trees.lua +++ b/minetestforfun_game/mods/default/trees.lua @@ -36,27 +36,27 @@ minetest.register_abm({ 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 + if mapgen == "v6" then default.grow_tree(pos, random(1, 4) == 1) --- else --- default.grow_new_apple_tree(pos) --- end + 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 + if mapgen == "v6" then default.grow_jungle_tree(pos) --- else --- default.grow_new_jungle_tree(pos) --- end + 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 + if mapgen == "v6" then default.grow_pine_tree(pos) --- else --- default.grow_new_pine_tree(pos) --- end + 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)) @@ -359,7 +359,7 @@ end -- 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 @@ -368,8 +368,8 @@ end -- New jungle tree function default.grow_new_jungle_tree(pos) - local path = minetest.get_modpath("default") .. "/schematics/jungle_tree.mts" - minetest.place_schematic({x = pos.x - 2, y = pos.y, z = pos.z - 2}, + 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 @@ -377,7 +377,7 @@ 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 @@ -386,7 +386,7 @@ 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/minetestforfun_game/mods/farming/carrot.lua b/minetestforfun_game/mods/farming/carrot.lua index 19bb3ec0..77d6a8c5 100755 --- a/minetestforfun_game/mods/farming/carrot.lua +++ b/minetestforfun_game/mods/farming/carrot.lua @@ -172,4 +172,4 @@ minetest.register_node("farming:carrot_8", { not_in_creative_inventory = 1 }, sounds = default.node_sound_leaves_defaults(), -}) \ No newline at end of file +}) diff --git a/minetestforfun_game/mods/farming/grass.lua b/minetestforfun_game/mods/farming/grass.lua index 04a66a80..7f98805c 100755 --- a/minetestforfun_game/mods/farming/grass.lua +++ b/minetestforfun_game/mods/farming/grass.lua @@ -25,4 +25,4 @@ minetest.override_item("default:junglegrass", { {items = {'default:junglegrass'}}, } }, -}) \ No newline at end of file +}) diff --git a/minetestforfun_game/mods/fire/init.lua b/minetestforfun_game/mods/fire/init.lua index 6656e6f8..c4afc35e 100755 --- a/minetestforfun_game/mods/fire/init.lua +++ b/minetestforfun_game/mods/fire/init.lua @@ -1,17 +1,23 @@ -- minetest/fire/init.lua +-- Global namespace for functions + fire = {} + +-- Register flame node + minetest.register_node("fire:basic_flame", { description = "Fire", drawtype = "firelike", tiles = {{ - name="fire_basic_flame_animated.png", - animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1}, + name = "fire_basic_flame_animated.png", + animation = {type = "vertical_frames", + aspect_w = 16, aspect_h = 16, length = 1}, }}, inventory_image = "fire_basic_flame.png", light_source = 14, - groups = {igniter=2,dig_immediate=3,hot=3}, + groups = {igniter = 2, dig_immediate = 3, hot = 3}, drop = '', walkable = false, buildable_to = true, @@ -29,44 +35,55 @@ minetest.register_node("fire:basic_flame", { on_blast = function() end, }) -fire.D = 6 + +-- Fire sounds table -- key: position hash of low corner of area -- value: {handle=sound handle, name=sound name} fire.sounds = {} + +-- Get sound area of position + +-- size of sound areas +fire.D = 6 + 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 + +-- 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 = 1.5} elseif #flames_p > 0 then - wanted_sound = {name="fire_small", gain=1.5} + wanted_sound = {name = "fire_small", gain = 1.5} 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,40 +94,53 @@ 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 p0 = {x = pos.x - 1, y = pos.y, z = pos.z - 1} + local p1 = {x = pos.x + 1, y = pos.y + 1, z = pos.z + 1} local ps = minetest.find_nodes_in_area(p0, p1, {"group:puts_out_fire"}) return (#ps ~= 0) end ---[[-- Ignite neighboring nodes -minetest.register_abm({ + +-- Ignite neighboring nodes + +--[[minetest.register_abm({ nodenames = {"group:flammable"}, neighbors = {"group:igniter"}, - interval = 5, - chance = 2, + interval = 7, + chance = 32, action = function(p0, node, _, _) -- If there is water or stuff like that around flame, don't ignite if fire.flame_should_extinguish(p0) then @@ -118,12 +148,17 @@ minetest.register_abm({ end local p = fire.find_pos_for_flame_around(p0) if p then - minetest.set_node(p, {name="fire:basic_flame"}) + minetest.set_node(p, {name = "fire:basic_flame"}) 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,17 +178,18 @@ 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, + interval = 5, + chance = 16, action = function(p0, node, _, _) -- If there is water or stuff like that around flame, remove flame if fire.flame_should_extinguish(p0) then @@ -161,7 +197,7 @@ minetest.register_abm({ return end -- Make the following things rarer - if math.random(1,3) == 1 then + if math.random(1, 3) == 1 then return end -- If there are no flammable nodes around flame, remove flame @@ -169,7 +205,7 @@ minetest.register_abm({ minetest.remove_node(p0) return end - if math.random(1,4) == 1 then + 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