diff --git a/minetestforfun_game/.gitignore b/minetestforfun_game/.gitignore index 717f5fe0..ef02689c 100755 --- a/minetestforfun_game/.gitignore +++ b/minetestforfun_game/.gitignore @@ -1,9 +1,22 @@ -## Generic ignorable patterns and files -*~ -.*.swp -*bak* -tags -*.vim - ## Files related to minetest development cycle -*.patch +/*.patch +# GNU Patch reject file +*.rej + +## Editors and Development environments +*~ +*.swp +*.bak* +*.orig +# Vim +*.vim +# Kate +.*.kate-swp +.swp.* +# Eclipse (LDT) +.project +.settings/ +.buildpath +.metadata +# Idea IDE +.idea/* diff --git a/minetestforfun_game/game_api.txt b/minetestforfun_game/game_api.txt index d3330e5f..80272a60 100755 --- a/minetestforfun_game/game_api.txt +++ b/minetestforfun_game/game_api.txt @@ -12,22 +12,28 @@ Please note: * [XYZ] refers to a section the Minetest API * [#ABC] refers to a section in this document + * [pos] refers to a position table `{x = -5, y = 0, z = 200}` Bucket API ---------- The bucket API allows registering new types of buckets for non-default liquids. - bucket.register_liquid( "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 + {lava_bucket = 1}, -- groups of the bucket item, OPTIONAL + false -- force-renew, OPTIONAL. Force the liquid source to renew if it has + -- a source neighbour, even if defined as 'liquid_renewable = false'. + -- Needed to avoid creating holes in sloping rivers. ) +The filled bucket item is returned to the player that uses an empty bucket pointing to the given liquid source. +When punching with an empty bucket pointing to an entity or a non-liquid node, the on_punch of the entity or node will be triggered. + Beds API -------- @@ -39,8 +45,8 @@ Beds API * `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 + +### Bed definition { description = "Simple Bed", @@ -61,6 +67,11 @@ Beds API } } +Creative API +------------ + +A global string called `creative.formspec_add` was added which allows mods to add additional formspec elements onto the default creative inventory formspec to be drawn after each update. + Doors API --------- @@ -85,12 +96,12 @@ The doors mod allows modders to register custom doors and trapdoors. * `def` See [#Fence gate definition] `doors.get(pos)` - + * `pos` A position as a table, e.g `{x = 1, y = 1, z = 1}` - * Returns an ObjecRef to a door, or nil if the position does not contain a door - - ###Methods - + * Returns an ObjectRef to a door, or nil if the position does not contain a door + + ### Methods + :open(player) -- Open the door object, returns if door was opened :close(player) -- Close the door object, returns if door was closed :toggle(player) -- Toggle the door state, returns if state was toggled @@ -101,7 +112,7 @@ The doors mod allows modders to register custom doors and trapdoors. has the permissions needed to open this door. If omitted then no permission checks are performed. -###Door definition +### Door definition description = "Door description", inventory_image = "mod_door_inv.png", @@ -113,7 +124,7 @@ The doors mod allows modders to register custom doors and trapdoors. sound_close = sound play for close door, -- optional protected = false, -- If true, only placer can open the door (locked for others) -###Trapdoor definition +### Trapdoor definition description = "Trapdoor description", inventory_image = "mod_trapdoor_inv.png", @@ -125,7 +136,7 @@ The doors mod allows modders to register custom doors and trapdoors. sound_close = sound play for close door, -- optional protected = false, -- If true, only placer can open the door (locked for others) -###Fence gate definition +### Fence gate definition description = "Wooden Fence Gate", texture = "default_wood.png", @@ -135,6 +146,7 @@ The doors mod allows modders to register custom doors and trapdoors. Fence API --------- + Allows creation of new fences with "fencelike" drawtype. `default.register_fence(name, item definition)` @@ -144,7 +156,7 @@ Allows creation of new fences with "fencelike" drawtype. nodedef fields here except drawtype. The fence group will always be added for this node. -###fence definition +### fence definition name = "default:fence_wood", description = "Wooden Fence", @@ -153,8 +165,9 @@ Allows creation of new fences with "fencelike" drawtype. groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, sounds = default.node_sound_wood_defaults(), -#Walls API +Walls API --------- + The walls API allows easy addition of stone auto-connecting wall nodes. walls.register(name, desc, texture, mat, sounds) @@ -175,7 +188,10 @@ The farming API allows you to easily register plants and hoes. `farming.register_plant(name, Plant definition)` * Register a new growing plant, see [#Plant definition] -###Hoe Definition +`farming.registered_plants[name] = definition` + * Table of registered plants, indexed by plant name + +### Hoe Definition { @@ -190,7 +206,7 @@ The farming API allows you to easily register plants and hoes. } } -###Plant definition +### Plant definition { description = "", -- Description of seed item @@ -204,11 +220,135 @@ The farming API allows you to easily register plants and hoes. Fire API -------- +New node def property: + `on_burn(pos)` * Called when fire attempts to remove a burning node. * `pos` Position of the burning node. + `on_ignite(pos, igniter)` + + * Called when Flint and steel (or a mod defined ignitor) is used on a node. + Defining it may prevent the default action (spawning flames) from triggering. + * `pos` Position of the ignited node. + * `igniter` Player that used the tool, when available. + + +Give Initial Stuff API +---------------------- + +`give_initial_stuff.give(player)` + +^ Give initial stuff to "player" + +`give_initial_stuff.add(stack)` + +^ Add item to the initial stuff +^ Stack can be an ItemStack or a item name eg: "default:dirt 99" +^ Can be called after the game has loaded + +`give_initial_stuff.clear()` + +^ Removes all items from the initial stuff +^ Can be called after the game has loaded + +`give_initial_stuff.get_list()` + +^ returns list of item stacks + +`give_initial_stuff.set_list(list)` + +^ List of initial items with numeric indices. + +`give_initial_stuff.add_from_csv(str)` + +^ str is a comma separated list of initial stuff +^ Adds items to the list of items to be given + +Nyancat API +----------- + +`nyancat.place(pos, facedir, length)` + +^ Place a cat at `pos` facing `facedir` with tail length `length` + Only accepts facedir 0-3, if facedir > 3 then it will be interpreted as facedir = 0 + +`nyancat.generate(minp, maxp, seed)` + +^ Called by `minetest.register_on_generated`. To disable nyancat generation, + you can redefine nyancat.generate() to be an empty function + +TNT API +---------- + +`tnt.register_tnt(definition)` + +^ Register a new type of tnt. + + * `name` The name of the node. If no prefix is given `tnt` is used. + * `description` A description for your TNT. + * `radius` The radius within which the TNT can destroy nodes. The default is 3. + * `damage_radius` The radius within which the TNT can damage players and mobs. By default it is twice the `radius`. + * `disable_drops` Disable drops. By default it is set to false. + * `ignore_protection` Don't check `minetest.is_protected` before removing a node. + * `ignore_on_blast` Don't call `on_blast` even if a node has one. + * `tiles` Textures for node + * `side` Side tiles. By default the name of the tnt with a suffix of `_side.png`. + * `top` Top tile. By default the name of the tnt with a suffix of `_top.png`. + * `bottom` Bottom tile. By default the name of the tnt with a suffix of `_bottom.png`. + * `burning` Top tile when lit. By default the name of the tnt with a suffix of `_top_burning_animated.png". + +`tnt.boom(position, definition)` + +^ Create an explosion. + +* `position` The center of explosion. +* `definition` The TNT definion as passed to `tnt.register` + +`tnt.burn(position, [nodename])` + +^ Ignite TNT at position, nodename isn't required unless already known. + + +To make dropping items from node inventories easier, you can use the +following helper function from 'default': + +default.get_inventory_drops(pos, inventory, drops) + +^ Return drops from node inventory "inventory" in drops. + +* `pos` - the node position +* `inventory` - the name of the inventory (string) +* `drops` - an initialized list + +The function returns no values. The drops are returned in the `drops` +parameter, and drops is not reinitialized so you can call it several +times in a row to add more inventory items to it. + + +`on_blast` callbacks: + +Both nodedefs and entitydefs can provide an `on_blast()` callback + +`nodedef.on_blast(pos, intensity)` +^ Allow drop and node removal overriding +* `pos` - node position +* `intensity` - TNT explosion measure. larger or equal to 1.0 +^ Should return a list of drops (e.g. {"default:stone"}) +^ Should perform node removal itself. If callback exists in the nodedef +^ then the TNT code will not destroy this node. + +`entitydef.on_blast(luaobj, damage)` +^ Allow TNT effects on entities to be overridden +* `luaobj` - LuaEntityRef of the entity +* `damage` - suggested HP damage value +^ Should return a list of (bool do_damage, bool do_knockback, table drops) +* `do_damage` - if true then TNT mod wil damage the entity +* `do_knockback` - if true then TNT mod will knock the entity away +* `drops` - a list of drops, e.g. {"wool:red"} + + Screwdriver API --------------- @@ -224,9 +364,33 @@ To use it, add the `on_screwdriver` function to the node definition. * `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 = false` to always disallow rotation * use `on_rotate = screwdriver.rotate_simple` to allow only face rotation + +Sethome API +----------- + +The sethome API adds three global functions to allow mods to read a players home position, +set a players home position and teleport a player to home position. + +`sethome.get(name)` + + * `name` Player who's home position you wish to get + * return value: false if no player home coords exist, position table if true + +`sethome.set(name, pos)` + + * `name` Player who's home position you wish to set + * `pos` Position table containing coords of home position + * return value: false if unable to set and save new home position, otherwise true + +`sethome.go(name)` + + * `name` Player you wish to teleport to their home position + * return value: false if player cannot be sent home, otherwise true + + Stairs API ---------- @@ -237,7 +401,7 @@ delivered with Minetest Game, to keep them compatible with other mods. * Registers a stair. * `subname`: Basically the material name (e.g. cobble) used for the stair name. Nodename pattern: "stairs:stair_subname" - * `recipeitem`: Item used in the craft recipe, e.g. "default:cobble" + * `recipeitem`: Item used in the craft recipe, e.g. "default:cobble", may be `nil` * `groups`: see [Known damage and digging time defining groups] * `images`: see [Tile definition] * `description`: used for the description field in the stair's definition @@ -270,10 +434,10 @@ Creates panes that automatically connect to each other * `subname`: used for nodename. Result: "xpanes:subname" and "xpanes:subname_{2..15}" * `def`: See [#Pane definition] -###Pane definition +### Pane definition { - textures = {"texture_Bottom_top", "texture_left_right", "texture_front_back"}, -- More tiles aren't supported + textures = {"texture for sides", (unused), "texture for top and bottom"}, -- More tiles aren't supported groups = {group = rating}, -- Uses the known node groups, see [Known damage and digging time defining groups] sounds = SoundSpec, -- See [#Default sounds] recipe = {{"","","","","","","","",""}}, -- Recipe field only @@ -310,6 +474,7 @@ Sounds inside the default table can be used within the sounds field of node defi * `default.node_sound_wood_defaults()` * `default.node_sound_leaves_defaults()` * `default.node_sound_glass_defaults()` + * `default.node_sound_metal_defaults()` Default constants ----------------- @@ -356,7 +521,7 @@ default.player_get_animation(player) * Any of the fields of the returned table may be nil. * player: PlayerRef -###Model Definition +### Model Definition { animation_speed = 30, -- Default animation speed, in FPS. @@ -395,7 +560,7 @@ To make recipes that will work with any dye ever made by anybody, define them based on groups. You can select any group of groups, based on your need for amount of colors. -###Color groups +### Color groups Base color groups: @@ -450,7 +615,7 @@ Example of one shapeless recipe using a color group: recipe = {':item_no_color', 'group:basecolor_yellow'}, }) -###Color lists +### Color lists * `dye.basecolors` are an array containing the names of available base colors @@ -465,7 +630,7 @@ Trees * `default.grow_jungle_tree(pos)` * Grows a mgv6 jungletree at pos - * `default.grow_pine_tree(pos)` + * `default.grow_pine_tree(pos)` * Grows a mgv6 pinetree at pos * `default.grow_new_apple_tree(pos)` diff --git a/minetestforfun_game/minetest.conf.example b/minetestforfun_game/minetest.conf.example index ac5b8f68..f5e4e85d 100755 --- a/minetestforfun_game/minetest.conf.example +++ b/minetestforfun_game/minetest.conf.example @@ -5,6 +5,12 @@ # Whether creative mode (fast digging of all blocks, unlimited resources) should be enabled #creative_mode = false +# Sets the behaviour of the inventory items when a player dies. +# "bones": Store all items inside a bone node but drop items if inside protected area +# "drop": Drop all items on the ground +# "keep": Player keeps all items +#bones_mode = "bones" + # The time in seconds after which the bones of a dead player can be looted by everyone # 0 to disable #share_bones_time = 1200 @@ -14,12 +20,13 @@ # 0 to disable. By default it is "share_bones_time" divide by four. #share_bones_time_early = 300 -# Whether standard fire should be disabled ('basic flame' nodes will disappear) -# 'permanent flame' nodes will remain with either setting -#disable_fire = false +# Whether fire should be enabled. If disabled, 'basic flame' nodes will disappear. +# 'permanent flame' nodes will remain with either setting. +#enable_fire = true -# Whether steel tools, torches and cobblestone should be given to new players +# Whether the stuff in initial_stuff should be given to new players #give_initial_stuff = false +#initial_stuff = default:pick_steel,default:axe_steel,default:shovel_steel,default:torch 99,default:cobble 99 # Whether the TNT mod should be enabled #enable_tnt = diff --git a/minetestforfun_game/mods/creative/README.txt b/minetestforfun_game/mods/creative/README.txt index fa735524..82357f30 100755 --- a/minetestforfun_game/mods/creative/README.txt +++ b/minetestforfun_game/mods/creative/README.txt @@ -1,23 +1,12 @@ Minetest Game mod: creative =========================== +See license.txt for license information. -Implements creative mode. - -Switch on by using the "creative_mode" setting. - -Registered items that -- have a description, and -- do not have the group not_in_creative_inventory -are added to the creative inventory. - -License of source code and media files: ---------------------------------------- -Copyright (C) 2012 Perttu Ahola (celeron55) -Copyright (C) 2016 Jean-Patrick G. (kilbith) - -This program is free software. It comes without any warranty, to -the extent permitted by applicable law. You can redistribute it -and/or modify it under the terms of the Do What The Fuck You Want -To Public License, Version 2, as published by Sam Hocevar. See -http://sam.zoy.org/wtfpl/COPYING for more details. +Authors of source code +---------------------- +Originally by Perttu Ahola (celeron55) (MIT) +Jean-Patrick G. (kilbith) (MIT) +Author of media (textures) +-------------------------- +Jean-Patrick G. (kilbith) (CC BY-SA 3.0) diff --git a/minetestforfun_game/mods/creative/init.lua b/minetestforfun_game/mods/creative/init.lua index b02371fd..cebbc2fa 100755 --- a/minetestforfun_game/mods/creative/init.lua +++ b/minetestforfun_game/mods/creative/init.lua @@ -2,19 +2,21 @@ creative = {} local player_inventory = {} +local creative_mode = minetest.setting_getbool("creative_mode") -- Create detached creative inventory after loading all mods -creative.init_creative_inventory = function(player) - local player_name = player:get_player_name() - player_inventory[player_name] = {} - player_inventory[player_name].size = 0 - player_inventory[player_name].filter = "" - player_inventory[player_name].start_i = 1 - player_inventory[player_name].tab_id = 2 +creative.init_creative_inventory = function(owner) + local owner_name = owner:get_player_name() + player_inventory[owner_name] = { + size = 0, + filter = "", + start_i = 1, + tab_id = 2, + } - minetest.create_detached_inventory("creative_" .. player_name, { + minetest.create_detached_inventory("creative_" .. owner_name, { allow_move = function(inv, from_list, from_index, to_list, to_index, count, player) - if minetest.setting_getbool("creative_mode") and not to_list == "main" then + if creative_mode and not to_list == "main" then return count else return 0 @@ -24,7 +26,7 @@ creative.init_creative_inventory = function(player) return 0 end, allow_take = function(inv, listname, index, stack, player) - if minetest.setting_getbool("creative_mode") then + if creative_mode then return -1 else return 0 @@ -44,7 +46,7 @@ creative.init_creative_inventory = function(player) end, }) - creative.update_creative_inventory(player_name) + creative.update_creative_inventory(owner_name) --print("creative inventory size: " .. player_inventory[player_name].size) end @@ -86,7 +88,7 @@ local trash = minetest.create_detached_inventory("creative_trash", { -- Allow the stack to be placed and remove it in on_put() -- This allows the creative inventory to restore the stack allow_put = function(inv, listname, index, stack, player) - if minetest.setting_getbool("creative_mode") then + if creative_mode then return stack:get_count() else return 0 @@ -98,6 +100,8 @@ local trash = minetest.create_detached_inventory("creative_trash", { }) trash:set_size("main", 1) +creative.formspec_add = "" + creative.set_creative_formspec = function(player, start_i) local player_name = player:get_player_name() local inv = player_inventory[player_name] @@ -121,13 +125,15 @@ creative.set_creative_formspec = function(player, start_i) tooltip[creative_clear;Reset] listring[current_player;main] ]] .. - "field[0.3,3.5;2.2,1;creative_filter;;" .. inv.filter .. "]" .. + "field[0.3,3.5;2.2,1;creative_filter;;" .. minetest.formspec_escape(inv.filter) .. "]" .. + "field_close_on_enter[creative_filter;false]" .. "listring[detached:creative_" .. player_name .. ";main]" .. "tabheader[0,0;creative_tabs;Crafting,All,Nodes,Tools,Items;" .. tostring(inv.tab_id) .. ";true;false]" .. "list[detached:creative_" .. player_name .. ";main;0,0;8,3;" .. tostring(start_i) .. "]" .. "table[6.05,3.35;1.15,0.5;pagenum;#FFFF00," .. tostring(pagenum) .. ",#FFFFFF,/ " .. tostring(pagemax) .. "]" .. default.get_hotbar_bg(0,4.7) .. default.gui_bg .. default.gui_bg_img .. default.gui_slots + .. creative.formspec_add ) end @@ -152,7 +158,7 @@ end minetest.register_on_joinplayer(function(player) -- If in creative mode, modify player's inventory forms - if not minetest.setting_getbool("creative_mode") then + if not creative_mode then return end creative.init_creative_inventory(player) @@ -160,13 +166,20 @@ minetest.register_on_joinplayer(function(player) end) minetest.register_on_player_receive_fields(function(player, formname, fields) - if formname ~= "" or not minetest.setting_getbool("creative_mode") then + if formname ~= "" or not creative_mode then return end local player_name = player:get_player_name() local inv = player_inventory[player_name] + -- If creative is turned on mid game + if not inv then + creative.init_creative_inventory(player) + creative.set_creative_formspec(player, 0) + return + end + if fields.quit then if inv.tab_id == 1 then creative.set_crafting_formspec(player) @@ -174,6 +187,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) elseif fields.creative_tabs then local tab = tonumber(fields.creative_tabs) inv.tab_id = tab + player_inventory[player_name].start_i = 1 if tab == 1 then creative.set_crafting_formspec(player) @@ -182,17 +196,18 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) creative.set_creative_formspec(player, 0) end elseif fields.creative_clear then + player_inventory[player_name].start_i = 1 inv.filter = "" creative.update_creative_inventory(player_name) creative.set_creative_formspec(player, 0) - elseif fields.creative_search then + elseif fields.creative_search or + fields.key_enter_field == "creative_filter" then + player_inventory[player_name].start_i = 1 inv.filter = fields.creative_filter:lower() creative.update_creative_inventory(player_name) creative.set_creative_formspec(player, 0) else - local formspec = player:get_inventory_formspec() - local start_i = formspec:match("list%[.-" .. player_name .. ";.-;(%d+)%]") - start_i = tonumber(start_i) or 0 + local start_i = player_inventory[player_name].start_i or 0 if fields.creative_prev then start_i = start_i - 3*8 @@ -209,11 +224,12 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) end end + player_inventory[player_name].start_i = start_i creative.set_creative_formspec(player, start_i) end end) -if minetest.setting_getbool("creative_mode") then +if creative_mode then local digtime = 0.5 local caps = {times = {digtime, digtime, digtime}, uses = 0, maxlevel = 3} diff --git a/minetestforfun_game/mods/creative/license.txt b/minetestforfun_game/mods/creative/license.txt new file mode 100644 index 00000000..4ad1d5ff --- /dev/null +++ b/minetestforfun_game/mods/creative/license.txt @@ -0,0 +1,60 @@ +License of source code +---------------------- + +The MIT License (MIT) +Copyright (C) 2012-2016 Perttu Ahola (celeron55) +Copyright (C) 2015-2016 Jean-Patrick G. (kilbith) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this +software and associated documentation files (the "Software"), to deal in the Software +without restriction, including without limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +For more details: +https://opensource.org/licenses/MIT + + +Licenses of media (textures) +---------------------------- + +Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) +Copyright (C) 2016 Jean-Patrick G. (kilbith) + +You are free to: +Share — copy and redistribute the material in any medium or format. +Adapt — remix, transform, and build upon the material for any purpose, even commercially. +The licensor cannot revoke these freedoms as long as you follow the license terms. + +Under the following terms: + +Attribution — You must give appropriate credit, provide a link to the license, and +indicate if changes were made. You may do so in any reasonable manner, but not in any way +that suggests the licensor endorses you or your use. + +ShareAlike — If you remix, transform, or build upon the material, you must distribute +your contributions under the same license as the original. + +No additional restrictions — You may not apply legal terms or technological measures that +legally restrict others from doing anything the license permits. + +Notices: + +You do not have to comply with the license for elements of the material in the public +domain or where your use is permitted by an applicable exception or limitation. +No warranties are given. The license may not give you all of the permissions necessary +for your intended use. For example, other rights such as publicity, privacy, or moral +rights may limit how you use the material. + +For more details: +http://creativecommons.org/licenses/by-sa/3.0/ diff --git a/minetestforfun_game/mods/creative/textures/creative_trash_icon.png b/minetestforfun_game/mods/creative/textures/creative_trash_icon.png index b624e47e..e789ad63 100644 Binary files a/minetestforfun_game/mods/creative/textures/creative_trash_icon.png and b/minetestforfun_game/mods/creative/textures/creative_trash_icon.png differ diff --git a/minetestforfun_game/mods/default/README.txt b/minetestforfun_game/mods/default/README.txt index 04d34621..d316f08e 100755 --- a/minetestforfun_game/mods/default/README.txt +++ b/minetestforfun_game/mods/default/README.txt @@ -1,28 +1,18 @@ Minetest Game mod: default ========================== +See license.txt for license information. -License of source code: ------------------------ -Copyright (C) 2011-2012 celeron55, Perttu Ahola +Authors of source code +---------------------- +Originally by celeron55, Perttu Ahola (LGPL 2.1) +Various Minetest developers and contributors (LGPL 2.1) -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation; either version 2.1 of the License, or -(at your option) any later version. - -http://www.gnu.org/licenses/lgpl-2.1.html - -License of media (textures and sounds) --------------------------------------- -Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) -http://creativecommons.org/licenses/by-sa/3.0/ - -Authors of media files ------------------------ +Authors of media (textures, models and sounds) +---------------------------------------------- Everything not listed in here: -Copyright (C) 2010-2012 celeron55, Perttu Ahola +celeron55, Perttu Ahola (CC BY-SA 3.0) -Cisoun's WTFPL texture pack: +Cisoun's texture pack (CC BY-SA 3.0): default_jungletree.png default_lava.png default_leaves.png @@ -32,49 +22,45 @@ Cisoun's WTFPL texture pack: default_tree_top.png default_water.png -Cisoun's conifers mod (WTFPL): +Cisoun's conifers mod (CC BY-SA 3.0): default_pine_needles.png -Originating from G4JC's Almost MC Texture Pack: +Originating from G4JC's Almost MC Texture Pack (CC BY-SA 3.0): default_torch.png default_torch_on_ceiling.png default_torch_on_floor.png -VanessaE's animated torches (WTFPL): +VanessaE's animated torches (CC BY-SA 3.0): default_torch_animated.png default_torch_on_ceiling_animated.png default_torch_on_floor_animated.png default_torch_on_floor.png -RealBadAngel's animated water (WTFPL): +RealBadAngel's animated water (CC BY-SA 3.0): default_water_source_animated.png default_water_flowing_animated.png -VanessaE (WTFPL): - default_nc_back.png - default_nc_front.png - default_nc_rb.png - default_nc_side.png +VanessaE (CC BY-SA 3.0): default_desert_sand.png default_desert_stone.png default_sand.png default_mese_crystal.png default_mese_crystal_fragment.png -Calinou (CC BY-SA): +Calinou (CC BY-SA 3.0): default_brick.png default_papyrus.png default_mineral_copper.png default_glass_detail.png default_tool_goldsword.png -MirceaKitsune (WTFPL): +MirceaKitsune (CC BY-SA 3.0): character.x Jordach (CC BY-SA 3.0): character.png -PilzAdam (WTFPL): +PilzAdam (CC BY-SA 3.0): default_jungleleaves.png default_junglesapling.png default_obsidian_glass.png @@ -82,10 +68,10 @@ PilzAdam (WTFPL): default_mineral_gold.png default_snowball.png -jojoa1997 (WTFPL): +jojoa1997 (CC BY-SA 3.0): default_obsidian.png -InfinityProject (WTFPL): +InfinityProject (CC BY-SA 3.0): default_mineral_diamond.png Splizard (CC BY-SA 3.0): @@ -106,10 +92,13 @@ paramat (CC BY-SA 3.0): default_pinetree_top.png default_pinewood.png default_acacia_leaves.png + default_acacia_leaves_simple.png default_acacia_sapling.png default_acacia_tree.png default_acacia_tree_top.png default_acacia_wood.png + default_acacia_bush_stem.png + default_bush_stem.png default_junglewood.png default_jungletree_top.png default_sandstone_brick.png @@ -130,6 +119,7 @@ paramat (CC BY-SA 3.0): default_grass_side.png default_snow_side.png default_mese_block.png + default_silver_sand.png brunob.santos (CC BY-SA 4.0): default_desert_cobble.png @@ -156,6 +146,9 @@ BlockMen (CC BY-SA 3.0): heart.png gui_*.png +Wuzzy (CC BY-SA 3.0): + default_bookshelf_slot.png (based on default_book.png) + sofar (CC BY-SA 3.0): default_book_written.png, based on default_book.png default_aspen_sapling @@ -170,11 +163,12 @@ sofar (WTFPL): Neuromancer (CC BY-SA 2.0): default_cobble.png, based on texture by Brane praefect default_mossycobble.png, based on texture by Brane praefect + Neuromancer (CC BY-SA 3.0): default_dirt.png default_furnace_*.png -Gambit (WTFPL): +Gambit (CC BY-SA 3.0): default_bronze_ingot.png default_copper_ingot.png default_copper_lump.png @@ -188,19 +182,35 @@ Gambit (WTFPL): default_ladder_steel.png default_sign_wall_wood.png default_flint.png + default_snow.png + default_snow_side.png + default_snowball.png -asl97 (WTFPL): +asl97 (CC BY-SA 3.0): default_ice.png KevDoy (CC BY-SA 3.0) heart.png +Pithydon (CC BY-SA 3.0) + default_coral_brown.png + default_coral_orange.png + default_coral_skeleton.png + +Ferk (CC0 1.0) + default_item_smoke.png + default_item_smoke.ogg, based on sound by http://opengameart.org/users/bart + Glass breaking sounds (CC BY 3.0): 1: http://www.freesound.org/people/cmusounddesign/sounds/71947/ 2: http://www.freesound.org/people/Tomlija/sounds/97669/ 3: http://www.freesound.org/people/lsprice/sounds/88808/ -Mito551 (sounds) (CC BY-SA): +sonictechtonic (CC BY 3.0): +https://www.freesound.org/people/sonictechtonic/sounds/241872/ + player_damage.ogg + +Mito551 (sounds) (CC BY-SA 3.0): default_dig_choppy.ogg default_dig_cracky.ogg default_dig_crumbly.1.ogg diff --git a/minetestforfun_game/mods/default/aliases.lua b/minetestforfun_game/mods/default/aliases.lua index 97872d8e..bd6f5925 100755 --- a/minetestforfun_game/mods/default/aliases.lua +++ b/minetestforfun_game/mods/default/aliases.lua @@ -39,8 +39,6 @@ minetest.register_alias("locked_chest", "default:chest_locked") minetest.register_alias("cobble", "default:cobble") minetest.register_alias("mossycobble", "default:mossycobble") minetest.register_alias("steelblock", "default:steelblock") -minetest.register_alias("nyancat", "default:nyancat") -minetest.register_alias("nyancat_rainbow", "default:nyancat_rainbow") minetest.register_alias("sapling", "default:sapling") minetest.register_alias("apple", "default:apple") diff --git a/minetestforfun_game/mods/default/crafting.lua b/minetestforfun_game/mods/default/crafting.lua index 89779149..05924117 100755 --- a/minetestforfun_game/mods/default/crafting.lua +++ b/minetestforfun_game/mods/default/crafting.lua @@ -42,6 +42,20 @@ minetest.register_craft({ } }) +minetest.register_craft({ + output = 'default:wood', + recipe = { + {'default:bush_stem'}, + } +}) + +minetest.register_craft({ + output = 'default:acacia_wood', + recipe = { + {'default:acacia_bush_stem'}, + } +}) + minetest.register_craft({ output = 'default:stick 9', recipe = { @@ -784,6 +798,15 @@ minetest.register_craft({ } }) +minetest.register_craft({ + output = 'default:sandstone_block 9', + recipe = { + {'default:sandstone', 'default:sandstone', 'default:sandstone'}, + {'default:sandstone', 'default:sandstone', 'default:sandstone'}, + {'default:sandstone', 'default:sandstone', 'default:sandstone'}, + } +}) + minetest.register_craft({ output = "default:cactus 2", recipe = { @@ -894,6 +917,15 @@ minetest.register_craft({ } }) +minetest.register_craft({ + output = "default:mese_crystal", + recipe = { + {"default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"}, + {"default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"}, + {"default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"}, + } +}) + minetest.register_craft({ output = "default:sand", recipe = { @@ -955,6 +987,15 @@ minetest.register_craft({ } }) +minetest.register_craft({ + output = 'default:obsidian_block 9', + recipe = { + {'default:obsidian', 'default:obsidian', 'default:obsidian'}, + {'default:obsidian', 'default:obsidian', 'default:obsidian'}, + {'default:obsidian', 'default:obsidian', 'default:obsidian'}, + } +}) + minetest.register_craft({ output = "default:ladder_obsidian 4", recipe = { @@ -1092,6 +1133,22 @@ minetest.register_craft({ recipe = "default:gold_lump", }) + +-- +-- Fuels +-- + +-- Support use of group:tree +minetest.register_craft({ + type = "cooking", + output = "default:gold_ingot", + recipe = "default:gold_lump", +}) + +-- Burn time for all woods are in order of wood density, +-- which is also the order of wood colour darkness: +-- aspen, pine, apple, acacia, jungle + minetest.register_craft({ type = "cooking", output = "default:mithril_ingot", @@ -1121,6 +1178,8 @@ minetest.register_craft({ burntime = 40, }) + +-- Support use of group:wood minetest.register_craft({ type = "fuel", recipe = "group:stick", @@ -1157,6 +1216,8 @@ minetest.register_craft({ burntime = 50, }) + +-- Support use of group:sapling minetest.register_craft({ type = "fuel", recipe = "default:fence_wood", @@ -1181,6 +1242,19 @@ minetest.register_craft({ burntime = 15, }) +minetest.register_craft({ + type = "fuel", + recipe = "default:acacia_sapling", + burntime = 11, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:junglesapling", + burntime = 12, +}) + + minetest.register_craft({ type = "fuel", recipe = "default:fence_aspen_wood", @@ -1211,12 +1285,25 @@ minetest.register_craft({ burntime = 5, }) + minetest.register_craft({ type = "fuel", recipe = "default:sign_wall_wood", burntime = 15, }) +minetest.register_craft({ + type = "fuel", + recipe = "default:bush_stem", + burntime = 7, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:acacia_bush_stem", + burntime = 8, +}) + minetest.register_craft({ type = "fuel", recipe = "default:chest", @@ -1247,6 +1334,18 @@ minetest.register_craft({ burntime = 10, }) +minetest.register_craft({ + type = "fuel", + recipe = "default:chest", + burntime = 30, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:chest_locked", + burntime = 30, +}) + minetest.register_craft({ type = "fuel", recipe = "default:apple", diff --git a/minetestforfun_game/mods/default/craftitems.lua b/minetestforfun_game/mods/default/craftitems.lua index 8b4d1187..260dd9c6 100755 --- a/minetestforfun_game/mods/default/craftitems.lua +++ b/minetestforfun_game/mods/default/craftitems.lua @@ -4,12 +4,13 @@ minetest.register_craftitem("default:stick", { description = "Stick", stack_max = 1000, inventory_image = "default_stick.png", - groups = {stick = 1}, + groups = {stick = 1, flammable = 2}, }) minetest.register_craftitem("default:paper", { description = "Paper", inventory_image = "default_paper.png", + groups = {flammable = 3}, }) local lpp = 14 -- Lines per book's page @@ -106,7 +107,9 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) elseif fields.book_next or fields.book_prev then local data = minetest.deserialize(stack:get_metadata()) - if not data.page then return end + if not data or not data.page then + return + end if fields.book_next then data.page = data.page + 1 @@ -131,14 +134,14 @@ end) minetest.register_craftitem("default:book", { description = "Book", inventory_image = "default_book.png", - groups = {book = 1}, + groups = {book = 1, flammable = 3}, on_use = book_on_use, }) minetest.register_craftitem("default:book_written", { description = "Book With Text", inventory_image = "default_book_written.png", - groups = {book = 1, not_in_creative_inventory = 1}, + groups = {book = 1, not_in_creative_inventory = 1, flammable = 3}, stack_max = 1, on_use = book_on_use, }) @@ -175,7 +178,7 @@ end) minetest.register_craftitem("default:coal_lump", { description = "Coal Lump", inventory_image = "default_coal_lump.png", - groups = {coal = 1} + groups = {coal = 1, flammable = 1} }) minetest.register_craftitem("default:iron_lump", { diff --git a/minetestforfun_game/mods/default/functions.lua b/minetestforfun_game/mods/default/functions.lua index 9138f53d..9cd091b2 100755 --- a/minetestforfun_game/mods/default/functions.lua +++ b/minetestforfun_game/mods/default/functions.lua @@ -95,6 +95,19 @@ function default.node_sound_glass_defaults(table) return table end +function default.node_sound_metal_defaults(table) + table = table or {} + table.footstep = table.footstep or + {name = "default_metal_footstep", gain = 0.5} + table.dig = table.dig or + {name = "default_dig_metal", gain = 0.5} + table.dug = table.dug or + {name = "default_dug_metal", gain = 0.5} + table.place = table.place or + {name = "default_place_node_metal", gain = 0.5} + default.node_sound_defaults(table) + return table +end -- -- Lavacooling @@ -126,6 +139,7 @@ minetest.register_abm({ -- -- optimized helper to put all items in an inventory into a drops list -- + function default.get_inventory_drops(pos, inventory, drops) local inv = minetest.get_meta(pos):get_inventory() local n = #drops @@ -230,6 +244,7 @@ end -- -- Fence registration helper -- + function default.register_fence(name, def) minetest.register_craft({ output = name .. " 4", @@ -287,16 +302,7 @@ end -- Leafdecay -- -default.leafdecay_trunk_cache = {} -default.leafdecay_enable_cache = true --- Spread the load of finding trunks -default.leafdecay_trunk_find_allow_accumulator = 0 - -minetest.register_globalstep(function(dtime) - local finds_per_second = 5000 - default.leafdecay_trunk_find_allow_accumulator = - math.floor(dtime * finds_per_second) -end) +-- Prevent decay of placed leaves default.after_place_leaves = function(pos, placer, itemstack, pointed_thing) if placer and not placer:get_player_control().sneak then @@ -306,85 +312,44 @@ default.after_place_leaves = function(pos, placer, itemstack, pointed_thing) end end +-- Leafdecay ABM + minetest.register_abm({ label = "Leaf decay", nodenames = {"group:leafdecay"}, - neighbors = {"air", "group:liquid"}, - -- A low interval and a high inverse chance spreads the load + neighbors = {"air"}, interval = 2, - chance = 5, + chance = 10, + catch_up = false, - action = function(p0, node, _, _) - --print("leafdecay ABM at "..p0.x..", "..p0.y..", "..p0.z..")") - local do_preserve = false - local d = minetest.registered_nodes[node.name].groups.leafdecay - if not d or d == 0 then - --print("not groups.leafdecay") + action = function(pos, node, _, _) + -- Check if leaf is placed + if node.param2 ~= 0 then return end - local n0 = minetest.get_node(p0) - if n0.param2 ~= 0 then - --print("param2 ~= 0") + + local rad = minetest.registered_nodes[node.name].groups.leafdecay + -- Assume ignore is a trunk, to make this + -- work at the border of a loaded area + if minetest.find_node_near(pos, rad, {"ignore", "group:tree"}) then return end - local p0_hash = nil - if default.leafdecay_enable_cache then - p0_hash = minetest.hash_node_position(p0) - local trunkp = default.leafdecay_trunk_cache[p0_hash] - if trunkp then - local n = minetest.get_node(trunkp) - local reg = minetest.registered_nodes[n.name] - -- Assume ignore is a trunk, to make the thing - -- work at the border of the active area - if n.name == "ignore" or (reg and reg.groups.tree and - reg.groups.tree ~= 0) then - --print("cached trunk still exists") - return - end - --print("cached trunk is invalid") - -- Cache is invalid - table.remove(default.leafdecay_trunk_cache, p0_hash) + -- Drop stuff + local itemstacks = minetest.get_node_drops(node.name) + for _, itemname in ipairs(itemstacks) do + if itemname ~= node.name or + minetest.get_item_group(node.name, "leafdecay_drop") ~= 0 then + local p_drop = { + x = pos.x - 0.5 + math.random(), + y = pos.y - 0.5 + math.random(), + z = pos.z - 0.5 + math.random(), + } + minetest.add_item(p_drop, itemname) end end - if default.leafdecay_trunk_find_allow_accumulator <= 0 then - return - end - default.leafdecay_trunk_find_allow_accumulator = - default.leafdecay_trunk_find_allow_accumulator - 1 - -- Assume ignore is a trunk, to make the thing - -- work at the border of the active area - local p1 - if n0.name == "moretrees:palm_leaves" then - p1 = minetest.find_node_near(p0, d, {"ignore", "moretrees:palm_trunk"}) - else - p1 = minetest.find_node_near(p0, d, {"ignore", "group:tree"}) - end - if p1 then - do_preserve = true - if default.leafdecay_enable_cache then - --print("caching trunk") - -- Cache the trunk - default.leafdecay_trunk_cache[p0_hash] = p1 - end - end - if not do_preserve then - -- Drop stuff other than the node itself - local itemstacks = minetest.get_node_drops(n0.name) - for _, itemname in ipairs(itemstacks) do - if minetest.get_item_group(n0.name, "leafdecay_drop") ~= 0 or - itemname ~= n0.name then - local p_drop = { - x = p0.x - 0.5 + math.random(), - y = p0.y - 0.5 + math.random(), - z = p0.z - 0.5 + math.random(), - } - minetest.add_item(p_drop, itemname) - end - end - -- Remove node - minetest.remove_node(p0) - nodeupdate(p0) - end + -- Remove node + minetest.remove_node(pos) + nodeupdate(pos) end }) @@ -405,39 +370,30 @@ minetest.register_abm({ "default:snow", }, interval = 6, - chance = 67, + chance = 50, catch_up = false, action = function(pos, node) - -- Most likely case, half the time it's too dark for this. + -- Check for darkness: night, shadow or under a light-blocking node + -- Returns if ignore above local above = {x = pos.x, y = pos.y + 1, z = pos.z} if (minetest.get_node_light(above) or 0) < 13 then return end - -- Look for likely neighbors. - local p2 = minetest.find_node_near(pos, 1, {"default:dirt_with_grass", - "default:dirt_with_dry_grass", "default:dirt_with_snow"}) + -- Look for spreading dirt-type neighbours + local p2 = minetest.find_node_near(pos, 1, "group:spreading_dirt_type") if p2 then - -- But the node needs to be under air in this case. - local n2 = minetest.get_node(above) - if n2 and n2.name == "air" then - local n3 = minetest.get_node(p2) - minetest.set_node(pos, {name = n3.name}) - return - end - end - - -- Anything on top? - local n2 = minetest.get_node(above) - if not n2 then + local n3 = minetest.get_node(p2) + minetest.set_node(pos, {name = n3.name}) return end - local name = n2.name - -- Snow check is cheapest, so comes first. + -- Else, any seeding nodes on top? + local name = minetest.get_node(above).name + -- Snow check is cheapest, so comes first if name == "default:snow" then minetest.set_node(pos, {name = "default:dirt_with_snow"}) - -- Most likely case first. + -- Most likely case first elseif minetest.get_item_group(name, "grass") ~= 0 then minetest.set_node(pos, {name = "default:dirt_with_grass"}) elseif minetest.get_item_group(name, "dry_grass") ~= 0 then @@ -446,17 +402,14 @@ minetest.register_abm({ end }) + -- -- Grass and dry grass removed in darkness -- minetest.register_abm({ label = "Grass covered", - nodenames = { - "default:dirt_with_grass", - "default:dirt_with_dry_grass", - "default:dirt_with_snow", - }, + nodenames = {"group:spreading_dirt_type"}, interval = 8, chance = 50, catch_up = false, diff --git a/minetestforfun_game/mods/default/furnace.lua b/minetestforfun_game/mods/default/furnace.lua index b5bca889..cd36f522 100755 --- a/minetestforfun_game/mods/default/furnace.lua +++ b/minetestforfun_game/mods/default/furnace.lua @@ -22,6 +22,8 @@ local function active_formspec(fuel_percent, item_percent) "listring[current_player;main]".. "listring[current_name;src]".. "listring[current_player;main]".. + "listring[current_name;fuel]".. + "listring[current_player;main]".. default.get_hotbar_bg(0, 4.25) return formspec end @@ -42,6 +44,8 @@ local inactive_formspec = "listring[current_player;main]".. "listring[current_name;src]".. "listring[current_player;main]".. + "listring[current_name;fuel]".. + "listring[current_player;main]".. default.get_hotbar_bg(0, 4.25) -- @@ -175,7 +179,11 @@ local function furnace_node_timer(pos, elapsed) local item_percent = 0 if cookable then item_percent = math.floor(src_time / cooked.time * 100) - item_state = item_percent .. "%" + if item_percent > 100 then + item_state = "100% (output full)" + else + item_state = item_percent .. "%" + end else if srclist[1]:is_empty() then item_state = "Empty" diff --git a/minetestforfun_game/mods/default/init.lua b/minetestforfun_game/mods/default/init.lua index b362fc75..08e9efe4 100755 --- a/minetestforfun_game/mods/default/init.lua +++ b/minetestforfun_game/mods/default/init.lua @@ -35,14 +35,17 @@ default.gui_survival_form = "size[8,8.5]".. default.get_hotbar_bg(0,4.25) -- Load files -dofile(minetest.get_modpath("default").."/functions.lua") -dofile(minetest.get_modpath("default").."/trees.lua") -dofile(minetest.get_modpath("default").."/nodes.lua") -dofile(minetest.get_modpath("default").."/furnace.lua") -dofile(minetest.get_modpath("default").."/tools.lua") -dofile(minetest.get_modpath("default").."/craftitems.lua") -dofile(minetest.get_modpath("default").."/crafting.lua") -dofile(minetest.get_modpath("default").."/mapgen.lua") -dofile(minetest.get_modpath("default").."/player.lua") -dofile(minetest.get_modpath("default").."/aliases.lua") -dofile(minetest.get_modpath("default").."/legacy.lua") +local default_path = minetest.get_modpath("default") + +dofile(default_path.."/functions.lua") +dofile(default_path.."/trees.lua") +dofile(default_path.."/nodes.lua") +dofile(default_path.."/furnace.lua") +dofile(default_path.."/tools.lua") +dofile(default_path.."/item_entity.lua") +dofile(default_path.."/craftitems.lua") +dofile(default_path.."/crafting.lua") +dofile(default_path.."/mapgen.lua") +dofile(default_path.."/player.lua") +dofile(default_path.."/aliases.lua") +dofile(default_path.."/legacy.lua") diff --git a/minetestforfun_game/mods/default/item_entity.lua b/minetestforfun_game/mods/default/item_entity.lua new file mode 100644 index 00000000..c34e60e9 --- /dev/null +++ b/minetestforfun_game/mods/default/item_entity.lua @@ -0,0 +1,74 @@ +-- mods/default/item_entity.lua + +local builtin_item = minetest.registered_entities["__builtin:item"] + +local item = { + set_item = function(self, itemstring) + builtin_item.set_item(self, itemstring) + + local stack = ItemStack(itemstring) + local itemdef = minetest.registered_items[stack:get_name()] + if itemdef and itemdef.groups.flammable ~= 0 then + self.flammable = itemdef.groups.flammable + end + end, + + burn_up = function(self) + -- disappear in a smoke puff + self.object:remove() + local p = self.object:getpos() + minetest.sound_play("default_item_smoke", { + pos = p, + max_hear_distance = 8, + }) + minetest.add_particlespawner({ + amount = 3, + time = 0.1, + minpos = {x = p.x - 0.1, y = p.y + 0.1, z = p.z - 0.1 }, + maxpos = {x = p.x + 0.1, y = p.y + 0.2, z = p.z + 0.1 }, + minvel = {x = 0, y = 2.5, z = 0}, + maxvel = {x = 0, y = 2.5, z = 0}, + minacc = {x = -0.15, y = -0.02, z = -0.15}, + maxacc = {x = 0.15, y = -0.01, z = 0.15}, + minexptime = 4, + maxexptime = 6, + minsize = 5, + maxsize = 5, + collisiondetection = true, + texture = "default_item_smoke.png" + }) + end, + + on_step = function(self, dtime) + builtin_item.on_step(self, dtime) + + if self.flammable then + -- flammable, check for igniters + self.ignite_timer = (self.ignite_timer or 0) + dtime + if self.ignite_timer > 10 then + self.ignite_timer = 0 + + local node = minetest.get_node_or_nil(self.object:getpos()) + if not node then + return + end + + -- Immediately burn up flammable items in lava + if minetest.get_item_group(node.name, "lava") > 0 then + self:burn_up() + else + -- otherwise there'll be a chance based on its igniter value + local burn_chance = self.flammable + * minetest.get_item_group(node.name, "igniter") + if burn_chance > 0 and math.random(0, burn_chance) ~= 0 then + self:burn_up() + end + end + end + end + end, +} + +-- set defined item as new __builtin:item, with the old one as fallback table +setmetatable(item, builtin_item) +minetest.register_entity(":__builtin:item", item) diff --git a/minetestforfun_game/mods/default/legacy.lua b/minetestforfun_game/mods/default/legacy.lua index 76fcc8ed..a8c8ad56 100755 --- a/minetestforfun_game/mods/default/legacy.lua +++ b/minetestforfun_game/mods/default/legacy.lua @@ -1,6 +1,6 @@ -- mods/default/legacy.lua --- Horrible crap to support old code registering falling nodes +-- Horrible stuff to support old code registering falling nodes -- Don't use this and never do what this does, it's completely wrong! -- (More specifically, the client and the C++ code doesn't get the group) function default.register_falling_node(nodename, texture) diff --git a/minetestforfun_game/mods/default/license.txt b/minetestforfun_game/mods/default/license.txt new file mode 100644 index 00000000..137923c8 --- /dev/null +++ b/minetestforfun_game/mods/default/license.txt @@ -0,0 +1,171 @@ +License of source code +---------------------- + +GNU Lesser General Public License, version 2.1 +Copyright (C) 2011-2016 celeron55, Perttu Ahola +Copyright (C) 2011-2016 Various Minetest developers and contributors + +This program is free software; you can redistribute it and/or modify it under the terms +of the GNU Lesser General Public License as published by the Free Software Foundation; +either version 2.1 of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; +without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +See the GNU Lesser General Public License for more details: +https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html + + +Licenses of media (textures, models and sounds) +----------------------------------------------- + +Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) +Copyright (C) 2010-2016: + celeron55, Perttu Ahola + Cisoun + G4JC + VanessaE + RealBadAngel + Calinou + MirceaKitsune + Jordach + PilzAdam + jojoa1997 + InfinityProject + Splizard + Zeg9 + paramat + BlockMen + sofar + Neuromancer + Gambit + asl97 + KevDoy + Mito551 + +You are free to: +Share — copy and redistribute the material in any medium or format. +Adapt — remix, transform, and build upon the material for any purpose, even commercially. +The licensor cannot revoke these freedoms as long as you follow the license terms. + +Under the following terms: + +Attribution — You must give appropriate credit, provide a link to the license, and +indicate if changes were made. You may do so in any reasonable manner, but not in any way +that suggests the licensor endorses you or your use. + +ShareAlike — If you remix, transform, or build upon the material, you must distribute +your contributions under the same license as the original. + +No additional restrictions — You may not apply legal terms or technological measures that +legally restrict others from doing anything the license permits. + +Notices: + +You do not have to comply with the license for elements of the material in the public +domain or where your use is permitted by an applicable exception or limitation. +No warranties are given. The license may not give you all of the permissions necessary +for your intended use. For example, other rights such as publicity, privacy, or moral +rights may limit how you use the material. + +For more details: +http://creativecommons.org/licenses/by-sa/3.0/ + +----------------------- + +Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +Copyright (C) 2014-2016 brunob.santos + +You are free to: +Share — copy and redistribute the material in any medium or format. +Adapt — remix, transform, and build upon the material for any purpose, even commercially. +The licensor cannot revoke these freedoms as long as you follow the license terms. + +Under the following terms: + +Attribution — You must give appropriate credit, provide a link to the license, and +indicate if changes were made. You may do so in any reasonable manner, but not in any way +that suggests the licensor endorses you or your use. + +ShareAlike — If you remix, transform, or build upon the material, you must distribute +your contributions under the same license as the original. + +No additional restrictions — You may not apply legal terms or technological measures that +legally restrict others from doing anything the license permits. + +Notices: + +You do not have to comply with the license for elements of the material in the public +domain or where your use is permitted by an applicable exception or limitation. +No warranties are given. The license may not give you all of the permissions necessary +for your intended use. For example, other rights such as publicity, privacy, or moral +rights may limit how you use the material. + +For more details: +http://creativecommons.org/licenses/by-sa/4.0/ + +----------------------- + +Attribution-ShareAlike 2.0 Generic (CC BY-SA 2.0) +Copyright (C) 2014-2016 Neuromancer + + +You are free to: +Share — copy and redistribute the material in any medium or format. +Adapt — remix, transform, and build upon the material for any purpose, even commercially. +The licensor cannot revoke these freedoms as long as you follow the license terms. + +Under the following terms: + +Attribution — You must give appropriate credit, provide a link to the license, and +indicate if changes were made. You may do so in any reasonable manner, but not in any way +that suggests the licensor endorses you or your use. + +ShareAlike — If you remix, transform, or build upon the material, you must distribute +your contributions under the same license as the original. + +No additional restrictions — You may not apply legal terms or technological measures that +legally restrict others from doing anything the license permits. + +Notices: + +You do not have to comply with the license for elements of the material in the public +domain or where your use is permitted by an applicable exception or limitation. +No warranties are given. The license may not give you all of the permissions necessary +for your intended use. For example, other rights such as publicity, privacy, or moral +rights may limit how you use the material. + +For more details: +http://creativecommons.org/licenses/by-sa/2.0/ + +----------------------- + +Attribution 3.0 Unported (CC BY 3.0) +Copyright (C) 2009 cmusounddesign +Copyright (C) 2010 Tomlija +Copyright (C) 2010 lsprice +Copyright (C) 2014 sonictechtonic + +You are free to: +Share — copy and redistribute the material in any medium or format. +Adapt — remix, transform, and build upon the material for any purpose, even commercially. +The licensor cannot revoke these freedoms as long as you follow the license terms. + +Under the following terms: + +Attribution — You must give appropriate credit, provide a link to the license, and +indicate if changes were made. You may do so in any reasonable manner, but not in any way +that suggests the licensor endorses you or your use. + +No additional restrictions — You may not apply legal terms or technological measures that +legally restrict others from doing anything the license permits. + +Notices: + +You do not have to comply with the license for elements of the material in the public +domain or where your use is permitted by an applicable exception or limitation. +No warranties are given. The license may not give you all of the permissions necessary +for your intended use. For example, other rights such as publicity, privacy, or moral +rights may limit how you use the material. + +For more details: +http://creativecommons.org/licenses/by/3.0/ diff --git a/minetestforfun_game/mods/default/mapgen.lua b/minetestforfun_game/mods/default/mapgen.lua index 42b3f971..52fb1eec 100755 --- a/minetestforfun_game/mods/default/mapgen.lua +++ b/minetestforfun_game/mods/default/mapgen.lua @@ -240,8 +240,6 @@ function default.register_ores() y_min = -30000, }) - -- Mese - minetest.register_ore({ ore_type = "scatter", ore = "default:stone_with_mese", @@ -1824,73 +1822,16 @@ function default.register_decorations() end --- --- Generate nyan cats --- - --- All mapgens except singlenode - -function default.make_nyancat(pos, facedir, length) - local tailvec = {x = 0, y = 0, z = 0} - if facedir == 0 then - tailvec.z = 1 - elseif facedir == 1 then - tailvec.x = 1 - elseif facedir == 2 then - tailvec.z = -1 - elseif facedir == 3 then - tailvec.x = -1 - else - facedir = 0 - tailvec.z = 1 - end - local p = {x = pos.x, y = pos.y, z = pos.z} - minetest.set_node(p, {name = "default:nyancat", param2 = facedir}) - for i = 1, length do - p.x = p.x + tailvec.x - p.z = p.z + tailvec.z - minetest.set_node(p, {name = "default:nyancat_rainbow", param2 = facedir}) - end -end - -function default.generate_nyancats(minp, maxp, seed) - local height_min = -19600 - local height_max = 30000 - if maxp.y < height_min or minp.y > height_max then - return - end - local y_min = math.max(minp.y, height_min) - local y_max = math.min(maxp.y, height_max) - local volume = (maxp.x - minp.x + 1) * (y_max - y_min + 1) * (maxp.z - minp.z + 1) - local pr = PseudoRandom(seed + 9324342) - local max_num_nyancats = math.floor(volume / (16 * 16 * 16)) - for i = 1, max_num_nyancats do - if pr:next(0, 1000) == 0 then - local x0 = pr:next(minp.x, maxp.x) - local y0 = pr:next(minp.y, maxp.y) - local z0 = pr:next(minp.z, maxp.z) - local p0 = {x = x0, y = y0, z = z0} - default.make_nyancat(p0, pr:next(0, 3), pr:next(10, 15)) - end - end -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 - -local mg_params = minetest.get_mapgen_params() -if mg_params.mgname == "v6" then +local mg_name = minetest.get_mapgen_setting("mg_name") +if mg_name == "v6" then default.register_ores() default.register_mgv6_decorations() - minetest.register_on_generated(default.generate_nyancats) -elseif mg_params.mgname ~= "singlenode" then +else default.register_biomes() default.register_ores() default.register_decorations() - minetest.register_on_generated(default.generate_nyancats) end diff --git a/minetestforfun_game/mods/default/nodes.lua b/minetestforfun_game/mods/default/nodes.lua index 5ed8ecbb..e3da6d32 100755 --- a/minetestforfun_game/mods/default/nodes.lua +++ b/minetestforfun_game/mods/default/nodes.lua @@ -48,6 +48,7 @@ default:dirt_with_snow default:sand default:desert_sand +default:silver_sand default:gravel @@ -135,8 +136,8 @@ default:diamondblock default:stone_with_coin -Plantlife (non-cubic) ---------------------- +Plantlife +--------- default:cactus default:papyrus @@ -155,6 +156,18 @@ default:dry_grass_3 default:dry_grass_4 default:dry_grass_5 +default:bush_stem +default:bush_leaves +default:acacia_bush_stem +default:acacia_bush_leaves + +Corals +------ + +default:coral_brown +default:coral_orange +default:coral_skeleton + Liquids ------- (1. Source 2. Flowing) @@ -214,8 +227,6 @@ Misc ---- default:cloud -default:nyancat -default:nyancat_rainbow --]] @@ -272,12 +283,6 @@ minetest.register_node("default:mossycobble", { tiles = {"default_mossycobble.png"}, is_ground_content = false, groups = {cracky = 3, stone = 1}, - drop = { - items = { - {items = {"default:mossycobble"}}, - --{items = {"maptools:silver_coin"}, rarity = 64}, - }, - }, sounds = default.node_sound_stone_defaults(), }) @@ -407,7 +412,7 @@ minetest.register_node("default:dirt_with_grass", { tiles = {"default_grass.png", "default_dirt.png", {name = "default_dirt.png^default_grass_side.png", tileable_vertical = false}}, - groups = {crumbly = 3, soil = 1}, + groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1}, drop = 'default:dirt', sounds = default.node_sound_dirt_defaults({ footstep = {name = "default_grass_footstep", gain = 0.25}, @@ -432,7 +437,7 @@ minetest.register_node("default:dirt_with_dry_grass", { "default_dirt.png", {name = "default_dirt.png^default_dry_grass_side.png", tileable_vertical = false}}, - groups = {crumbly = 3, soil = 1}, + groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1}, drop = 'default:dirt', sounds = default.node_sound_dirt_defaults({ footstep = {name = "default_grass_footstep", gain = 0.4}, @@ -444,7 +449,7 @@ minetest.register_node("default:dirt_with_snow", { tiles = {"default_snow.png", "default_dirt.png", {name = "default_dirt.png^default_snow_side.png", tileable_vertical = false}}, - groups = {crumbly = 3, soil = 1}, + groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1}, drop = { items = { {items = {"default:dirt"}}, @@ -460,23 +465,19 @@ 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"}}, - }, - }, sounds = default.node_sound_sand_defaults(), }) minetest.register_node("default:desert_sand", { description = "Desert Sand", tiles = {"default_desert_sand.png"}, - drop = { - items = { - {items = {"default:desert_sand"}}, - }, - }, + groups = {crumbly = 3, falling_node = 1, sand = 1}, + sounds = default.node_sound_sand_defaults(), +}) + +minetest.register_node("default:silver_sand", { + description = "Silver Sand", + tiles = {"default_silver_sand.png"}, groups = {crumbly = 3, falling_node = 1, sand = 1}, sounds = default.node_sound_sand_defaults(), }) @@ -560,6 +561,13 @@ minetest.register_node("default:snowblock", { dug = {name = "default_snow_footstep", gain = 0.2}, dig = {name = "default_snow_footstep", gain = 0.2} }), + + on_construct = function(pos) + pos.y = pos.y - 1 + if minetest.get_node(pos).name == "default:dirt_with_grass" then + minetest.set_node(pos, {name = "default:dirt_with_snow"}) + end + end, }) minetest.register_node("default:ice", { @@ -592,7 +600,7 @@ minetest.register_node("default:wood", { place_param2 = 0, 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 = 2, wood = 1}, sounds = default.node_sound_wood_defaults(), }) @@ -609,7 +617,7 @@ minetest.register_node("default:sapling", { on_timer = default.grow_sapling, selection_box = { type = "fixed", - fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3} + fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16} }, groups = {snappy = 2, dig_immediate = 3, flammable = 2, attached_node = 1, sapling = 1}, @@ -637,7 +645,6 @@ minetest.register_node("default:leaves", { description = "Leaves", drawtype = "allfaces_optional", waving = 1, - visual_scale = 1.3, tiles = {"default_leaves.png"}, special_tiles = {"default_leaves_simple.png"}, paramtype = "light", @@ -675,7 +682,7 @@ minetest.register_node("default:apple", { is_ground_content = false, selection_box = { type = "fixed", - fixed = {-0.2, -0.5, -0.2, 0.2, 0, 0.2} + fixed = {-3 / 16, -7 / 16, -3 / 16, 3 / 16, 4 / 16, 3 / 16} }, groups = {fleshy = 3, dig_immediate = 3, flammable = 2, leafdecay = 3, leafdecay_drop = 1}, @@ -708,7 +715,7 @@ minetest.register_node("default:junglewood", { place_param2 = 0, 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 = 2, wood = 1}, sounds = default.node_sound_wood_defaults(), }) @@ -716,7 +723,6 @@ minetest.register_node("default:jungleleaves", { description = "Jungle Leaves", drawtype = "allfaces_optional", waving = 1, - visual_scale = 1.3, tiles = {"default_jungleleaves.png"}, special_tiles = {"default_jungleleaves_simple.png"}, paramtype = "light", @@ -747,7 +753,7 @@ minetest.register_node("default:junglesapling", { on_timer = default.grow_sapling, selection_box = { type = "fixed", - fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3} + fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16} }, groups = {snappy = 2, dig_immediate = 3, flammable = 2, attached_node = 1, sapling = 1}, @@ -778,7 +784,7 @@ minetest.register_node("default:pine_tree", { "default_pine_tree.png"}, paramtype2 = "facedir", is_ground_content = false, - groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, + groups = {tree = 1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 3}, sounds = default.node_sound_wood_defaults(), on_place = minetest.rotate_node @@ -790,14 +796,13 @@ minetest.register_node("default:pine_wood", { place_param2 = 0, tiles = {"default_pine_wood.png"}, is_ground_content = false, - groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1}, + groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3, wood = 1}, sounds = default.node_sound_wood_defaults(), }) minetest.register_node("default:pine_needles",{ description = "Pine Needles", drawtype = "allfaces_optional", - visual_scale = 1.3, tiles = {"default_pine_needles.png"}, waving = 1, paramtype = "light", @@ -828,9 +833,9 @@ minetest.register_node("default:pine_sapling", { on_timer = default.grow_sapling, selection_box = { type = "fixed", - fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3} + fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16} }, - groups = {snappy = 2, dig_immediate = 3, flammable = 2, + groups = {snappy = 2, dig_immediate = 3, flammable = 3, attached_node = 1, sapling = 1}, sounds = default.node_sound_leaves_defaults(), @@ -871,15 +876,15 @@ minetest.register_node("default:acacia_wood", { place_param2 = 0, tiles = {"default_acacia_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 = 2, wood = 1}, sounds = default.node_sound_wood_defaults(), }) minetest.register_node("default:acacia_leaves", { description = "Acacia Leaves", drawtype = "allfaces_optional", - visual_scale = 1.3, tiles = {"default_acacia_leaves.png"}, + special_tiles = {"default_acacia_leaves_simple.png"}, waving = 1, paramtype = "light", is_ground_content = false, @@ -909,7 +914,7 @@ minetest.register_node("default:acacia_sapling", { on_timer = default.grow_sapling, selection_box = { type = "fixed", - fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3} + fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16} }, groups = {snappy = 2, dig_immediate = 3, flammable = 2, attached_node = 1, sapling = 1}, @@ -939,7 +944,7 @@ minetest.register_node("default:aspen_tree", { "default_aspen_tree.png"}, paramtype2 = "facedir", is_ground_content = false, - groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, + groups = {tree = 1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 3}, sounds = default.node_sound_wood_defaults(), on_place = minetest.rotate_node @@ -951,14 +956,13 @@ minetest.register_node("default:aspen_wood", { place_param2 = 0, tiles = {"default_aspen_wood.png"}, is_ground_content = false, - groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1}, + groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3, wood = 1}, sounds = default.node_sound_wood_defaults(), }) minetest.register_node("default:aspen_leaves", { description = "Aspen Leaves", drawtype = "allfaces_optional", - visual_scale = 1.3, tiles = {"default_aspen_leaves.png"}, waving = 1, paramtype = "light", @@ -986,13 +990,12 @@ minetest.register_node("default:aspen_sapling", { paramtype = "light", sunlight_propagates = true, walkable = false, - is_ground_content = true, on_timer = default.grow_sapling, selection_box = { type = "fixed", - fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3} + fixed = {-3 / 16, -0.5, -3 / 16, 3 / 16, 0.5, 3 / 16} }, - groups = {snappy = 2, dig_immediate = 3, flammable = 2, + groups = {snappy = 2, dig_immediate = 3, flammable = 3, attached_node = 1, sapling = 1}, sounds = default.node_sound_leaves_defaults(), @@ -1163,14 +1166,13 @@ minetest.register_node("default:steelblock", { tiles = {"default_steel_block.png"}, is_ground_content = false, groups = {cracky = 1, level = 2}, - sounds = default.node_sound_stone_defaults(), + 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 = 2}, drop = { items = { @@ -1202,7 +1204,7 @@ minetest.register_node("default:copperblock", { tiles = {"default_copper_block.png"}, is_ground_content = false, groups = {cracky = 1, level = 2}, - sounds = default.node_sound_stone_defaults(), + sounds = default.node_sound_metal_defaults(), }) minetest.register_node("default:bronzeblock", { @@ -1210,7 +1212,7 @@ minetest.register_node("default:bronzeblock", { tiles = {"default_bronze_block.png"}, is_ground_content = false, groups = {cracky = 1, level = 2}, - sounds = default.node_sound_stone_defaults(), + sounds = default.node_sound_metal_defaults(), }) minetest.register_node("default:stone_with_tin", { @@ -1307,13 +1309,6 @@ minetest.register_node("default:mese", { description = "Mese Block", tiles = {"default_mese_block.png"}, paramtype = "light", - is_ground_content = true, - drop = { - items = { - {items = {"default:mese"}}, - -- {items = {"maptools:silver_coin"}, rarity = 32}, - }, - }, groups = {cracky = 1, level = 2}, sounds = default.node_sound_stone_defaults(), light_source = 3, @@ -1363,7 +1358,7 @@ minetest.register_node("default:goldblock", { tiles = {"default_gold_block.png"}, is_ground_content = false, groups = {cracky = 1}, - sounds = default.node_sound_stone_defaults(), + sounds = default.node_sound_metal_defaults(), }) minetest.register_node("default:stone_with_mithril", { @@ -1479,7 +1474,7 @@ minetest.register_node("default:papyrus", { walkable = false, selection_box = { type = "fixed", - fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} + fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16}, }, groups = {snappy = 3, flammable = 2}, sounds = default.node_sound_leaves_defaults(), @@ -1505,7 +1500,7 @@ minetest.register_node("default:dry_shrub", { sounds = default.node_sound_leaves_defaults(), selection_box = { type = "fixed", - fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, + fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 4 / 16, 5 / 16}, }, }) @@ -1521,11 +1516,11 @@ minetest.register_node("default:junglegrass", { sunlight_propagates = true, walkable = false, buildable_to = true, - groups = {snappy = 3, flammable = 2, flora = 1, attached_node = 1, grass = 1}, + groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1, flammable = 1}, sounds = default.node_sound_leaves_defaults(), selection_box = { type = "fixed", - fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, + fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 1.19, 7 / 16}, }, }) @@ -1546,7 +1541,7 @@ minetest.register_node("default:grass_1", { sounds = default.node_sound_leaves_defaults(), selection_box = { type = "fixed", - fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, + fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -5 / 16, 6 / 16}, }, on_place = function(itemstack, placer, pointed_thing) @@ -1571,12 +1566,12 @@ for i = 2, 5 do walkable = false, buildable_to = true, drop = "default:grass_1", - groups = {snappy = 3, flammable = 3, flora = 1, - attached_node = 1, not_in_creative_inventory = 1, grass = 1}, + groups = {snappy = 3, flora = 1, attached_node = 1, + not_in_creative_inventory = 1, grass = 1, flammable = 1}, sounds = default.node_sound_leaves_defaults(), selection_box = { type = "fixed", - fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, + fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -3 / 16, 6 / 16}, }, }) end @@ -1598,7 +1593,7 @@ minetest.register_node("default:dry_grass_1", { sounds = default.node_sound_leaves_defaults(), selection_box = { type = "fixed", - fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, + fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -3 / 16, 6 / 16}, }, on_place = function(itemstack, placer, pointed_thing) @@ -1628,11 +1623,95 @@ for i = 2, 5 do sounds = default.node_sound_leaves_defaults(), selection_box = { type = "fixed", - fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, + fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -1 / 16, 6 / 16}, }, }) end + +minetest.register_node("default:bush_stem", { + description = "Bush Stem", + drawtype = "plantlike", + visual_scale = 1.18, + tiles = {"default_bush_stem.png"}, + inventory_image = "default_bush_stem.png", + wield_image = "default_bush_stem.png", + paramtype = "light", + sunlight_propagates = true, + groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, + sounds = default.node_sound_wood_defaults(), + selection_box = { + type = "fixed", + fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.54, 7 / 16}, + }, +}) + +minetest.register_node("default:bush_leaves", { + description = "Bush Leaves", + drawtype = "allfaces_optional", + waving = 1, + tiles = {"default_leaves_simple.png"}, + paramtype = "light", + groups = {snappy = 3, flammable = 2, leaves = 1}, + sounds = default.node_sound_leaves_defaults(), +}) + +minetest.register_node("default:acacia_bush_stem", { + description = "Acacia Bush Stem", + drawtype = "plantlike", + visual_scale = 1.18, + tiles = {"default_acacia_bush_stem.png"}, + inventory_image = "default_acacia_bush_stem.png", + wield_image = "default_acacia_bush_stem.png", + paramtype = "light", + sunlight_propagates = true, + groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, + sounds = default.node_sound_wood_defaults(), + selection_box = { + type = "fixed", + fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.54, 7 / 16}, + }, +}) + +minetest.register_node("default:acacia_bush_leaves", { + description = "Acacia Bush Leaves", + drawtype = "allfaces_optional", + waving = 1, + tiles = {"default_acacia_leaves_simple.png"}, + paramtype = "light", + groups = {snappy = 3, flammable = 2, leaves = 1}, + sounds = default.node_sound_leaves_defaults(), +}) + + +-- +-- Corals +-- + +minetest.register_node("default:coral_brown", { + description = "Brown Coral", + tiles = {"default_coral_brown.png"}, + groups = {cracky = 3}, + drop = "default:coral_skeleton", + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("default:coral_orange", { + description = "Orange Coral", + tiles = {"default_coral_orange.png"}, + groups = {cracky = 3}, + drop = "default:coral_skeleton", + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("default:coral_skeleton", { + description = "Coral Skeleton", + tiles = {"default_coral_skeleton.png"}, + groups = {cracky = 3}, + sounds = default.node_sound_stone_defaults(), +}) + + -- -- Liquids -- @@ -2102,7 +2181,7 @@ minetest.register_node("default:torch", { groups = {choppy = 2, dig_immediate = 3, flammable = 1, attached_node = 1, hot = 2}, legacy_wallmounted = true, - sounds = default.node_sound_wood_defaults(), + sounds = default.node_sound_defaults(), }) @@ -2137,7 +2216,7 @@ end local function has_locked_chest_privilege(meta, player) local name = "" if player then - if minetest.check_player_privs(player:get_player_name(), {protection_bypass = true}) then + if minetest.check_player_privs(player, "protection_bypass") then return true end name = player:get_player_name() @@ -2281,6 +2360,18 @@ local bookshelf_formspec = "listring[current_player;main]" .. default.get_hotbar_bg(0,2.85) +-- Inventory slots overlay +local bx, by = 0, 0.3 +for i = 1, 16 do + if i == 9 then + bx = 0 + by = by + 1 + end + bookshelf_formspec = bookshelf_formspec .. + "image[" .. bx .. "," .. by .. ";1,1;default_bookshelf_slot.png]" + bx = bx + 1 +end + minetest.register_node("default:bookshelf", { description = "Bookshelf", tiles = {"default_wood.png", "default_wood.png", "default_wood.png", @@ -2353,7 +2444,6 @@ local function register_sign(material, desc, def) --local n = minetest.get_node(pos) local meta = minetest.get_meta(pos) meta:set_string("formspec", "field[text;;${text}]") - meta:set_string("infotext", "\"\"") end, on_receive_fields = function(pos, formname, fields, sender) --print("Sign at "..minetest.pos_to_string(pos).." got "..dump(fields)) @@ -2378,7 +2468,7 @@ register_sign("wood", "Wooden", { }) register_sign("steel", "Steel", { - sounds = default.node_sound_defaults(), + sounds = default.node_sound_metal_defaults(), groups = {cracky = 2, attached_node = 1} }) @@ -2446,12 +2536,14 @@ minetest.register_node("default:ladder_steel", { --wall_side = = }, groups = {cracky = 2}, - sounds = default.node_sound_stone_defaults(), + sounds = default.node_sound_metal_defaults(), }) default.register_fence("default:fence_wood", { description = "Wooden Fence", texture = "default_fence_wood.png", + inventory_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126", + wield_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126", material = "default:wood", groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, sounds = default.node_sound_wood_defaults() @@ -2460,6 +2552,8 @@ default.register_fence("default:fence_wood", { default.register_fence("default:fence_acacia_wood", { description = "Acacia Fence", texture = "default_fence_acacia_wood.png", + inventory_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126", + wield_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126", material = "default:acacia_wood", groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, sounds = default.node_sound_wood_defaults() @@ -2468,6 +2562,8 @@ default.register_fence("default:fence_acacia_wood", { default.register_fence("default:fence_junglewood", { description = "Junglewood Fence", texture = "default_fence_junglewood.png", + inventory_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126", + wield_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126", material = "default:junglewood", groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, sounds = default.node_sound_wood_defaults() @@ -2476,16 +2572,20 @@ default.register_fence("default:fence_junglewood", { default.register_fence("default:fence_pine_wood", { description = "Pine Fence", texture = "default_fence_pine_wood.png", + inventory_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126", + wield_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126", material = "default:pine_wood", - groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3}, sounds = default.node_sound_wood_defaults() }) default.register_fence("default:fence_aspen_wood", { description = "Aspen Fence", texture = "default_fence_aspen_wood.png", + inventory_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126", + wield_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126", material = "default:aspen_wood", - groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3}, sounds = default.node_sound_wood_defaults() }) @@ -2560,7 +2660,7 @@ 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, + groups = {dig_immediate = 2, attached_node = 1, connect_to_raillike = minetest.raillike_group("rail")}, }) @@ -2599,34 +2699,3 @@ minetest.register_node("default:cloud", { sounds = default.node_sound_defaults(), groups = {not_in_creative_inventory = 1}, }) - -minetest.register_node("default:nyancat", { - description = "Nyan Cat", - 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}, - is_ground_content = false, - post_effect_color = {a = 128, r= 255, g= 128, b= 255}, - legacy_facedir_simple = true, - sounds = default.node_sound_defaults(), -}) - -minetest.register_node("default:nyancat_rainbow", { - description = "Nyan Cat Rainbow", - drawtype = "glasslike", - tiles = { - "default_nc_rb.png^[transformR90", "default_nc_rb.png^[transformR90", - "default_nc_rb.png", "default_nc_rb.png" - }, - paramtype = "light", - paramtype2 = "facedir", - groups = {cracky = 2}, - sunlight_propagate = true, - walkable = false, - use_texture_alpha = true, - climbable = true, - is_ground_content = false, - post_effect_color = {a = 128, r= 255, g= 128, b= 255}, - sounds = default.node_sound_defaults(), -}) diff --git a/minetestforfun_game/mods/default/player.lua b/minetestforfun_game/mods/default/player.lua index e4fb2adf..8fb0aca8 100755 --- a/minetestforfun_game/mods/default/player.lua +++ b/minetestforfun_game/mods/default/player.lua @@ -25,7 +25,6 @@ default.player_register_model("character.b3d", { walk = { x=168, y=187, }, mine = { x=189, y=198, }, walk_mine = { x=200, y=219, }, - -- Extra animations (not currently used by the game). sit = { x= 81, y=160, }, }, }) diff --git a/minetestforfun_game/mods/default/schematics/aspen_tree.mts b/minetestforfun_game/mods/default/schematics/aspen_tree.mts index 3bccd4b5..724aae08 100644 Binary files a/minetestforfun_game/mods/default/schematics/aspen_tree.mts and b/minetestforfun_game/mods/default/schematics/aspen_tree.mts differ diff --git a/minetestforfun_game/mods/default/schematics/aspen_tree_from_sapling.mts b/minetestforfun_game/mods/default/schematics/aspen_tree_from_sapling.mts index 6bf0f186..b7ca1619 100644 Binary files a/minetestforfun_game/mods/default/schematics/aspen_tree_from_sapling.mts and b/minetestforfun_game/mods/default/schematics/aspen_tree_from_sapling.mts differ diff --git a/minetestforfun_game/mods/default/sounds/default_dig_metal.ogg b/minetestforfun_game/mods/default/sounds/default_dig_metal.ogg new file mode 100644 index 00000000..0b585097 Binary files /dev/null and b/minetestforfun_game/mods/default/sounds/default_dig_metal.ogg differ diff --git a/minetestforfun_game/mods/default/sounds/default_dug_metal.1.ogg b/minetestforfun_game/mods/default/sounds/default_dug_metal.1.ogg new file mode 100644 index 00000000..5d6cb5b1 Binary files /dev/null and b/minetestforfun_game/mods/default/sounds/default_dug_metal.1.ogg differ diff --git a/minetestforfun_game/mods/default/sounds/default_dug_metal.2.ogg b/minetestforfun_game/mods/default/sounds/default_dug_metal.2.ogg new file mode 100644 index 00000000..63567fc0 Binary files /dev/null and b/minetestforfun_game/mods/default/sounds/default_dug_metal.2.ogg differ diff --git a/minetestforfun_game/mods/default/sounds/default_item_smoke.ogg b/minetestforfun_game/mods/default/sounds/default_item_smoke.ogg new file mode 100644 index 00000000..e1c84078 Binary files /dev/null and b/minetestforfun_game/mods/default/sounds/default_item_smoke.ogg differ diff --git a/minetestforfun_game/mods/default/sounds/default_place_node_metal.1.ogg b/minetestforfun_game/mods/default/sounds/default_place_node_metal.1.ogg new file mode 100644 index 00000000..5da085ea Binary files /dev/null and b/minetestforfun_game/mods/default/sounds/default_place_node_metal.1.ogg differ diff --git a/minetestforfun_game/mods/default/sounds/default_place_node_metal.2.ogg b/minetestforfun_game/mods/default/sounds/default_place_node_metal.2.ogg new file mode 100644 index 00000000..5ee67fcf Binary files /dev/null and b/minetestforfun_game/mods/default/sounds/default_place_node_metal.2.ogg differ diff --git a/minetestforfun_game/mods/default/sounds/player_damage.ogg b/minetestforfun_game/mods/default/sounds/player_damage.ogg new file mode 100644 index 00000000..78880871 Binary files /dev/null and b/minetestforfun_game/mods/default/sounds/player_damage.ogg differ diff --git a/minetestforfun_game/mods/default/textures/default_acacia_bush_stem.png b/minetestforfun_game/mods/default/textures/default_acacia_bush_stem.png new file mode 100644 index 00000000..29039152 Binary files /dev/null and b/minetestforfun_game/mods/default/textures/default_acacia_bush_stem.png differ diff --git a/minetestforfun_game/mods/default/textures/default_acacia_leaves.png b/minetestforfun_game/mods/default/textures/default_acacia_leaves.png index d6507b87..626e1b30 100644 Binary files a/minetestforfun_game/mods/default/textures/default_acacia_leaves.png and b/minetestforfun_game/mods/default/textures/default_acacia_leaves.png differ diff --git a/minetestforfun_game/mods/default/textures/default_acacia_leaves_simple.png b/minetestforfun_game/mods/default/textures/default_acacia_leaves_simple.png new file mode 100644 index 00000000..3c7015bb Binary files /dev/null and b/minetestforfun_game/mods/default/textures/default_acacia_leaves_simple.png differ diff --git a/minetestforfun_game/mods/default/textures/default_bookshelf.png b/minetestforfun_game/mods/default/textures/default_bookshelf.png old mode 100755 new mode 100644 index 3407f758..10d64837 Binary files a/minetestforfun_game/mods/default/textures/default_bookshelf.png and b/minetestforfun_game/mods/default/textures/default_bookshelf.png differ diff --git a/minetestforfun_game/mods/default/textures/default_bookshelf_slot.png b/minetestforfun_game/mods/default/textures/default_bookshelf_slot.png new file mode 100644 index 00000000..31c4eb5e Binary files /dev/null and b/minetestforfun_game/mods/default/textures/default_bookshelf_slot.png differ diff --git a/minetestforfun_game/mods/default/textures/default_bush_stem.png b/minetestforfun_game/mods/default/textures/default_bush_stem.png new file mode 100644 index 00000000..18b615f7 Binary files /dev/null and b/minetestforfun_game/mods/default/textures/default_bush_stem.png differ diff --git a/minetestforfun_game/mods/default/textures/default_coral_brown.png b/minetestforfun_game/mods/default/textures/default_coral_brown.png new file mode 100644 index 00000000..8a775fe0 Binary files /dev/null and b/minetestforfun_game/mods/default/textures/default_coral_brown.png differ diff --git a/minetestforfun_game/mods/default/textures/default_coral_orange.png b/minetestforfun_game/mods/default/textures/default_coral_orange.png new file mode 100644 index 00000000..cefac627 Binary files /dev/null and b/minetestforfun_game/mods/default/textures/default_coral_orange.png differ diff --git a/minetestforfun_game/mods/default/textures/default_coral_skeleton.png b/minetestforfun_game/mods/default/textures/default_coral_skeleton.png new file mode 100644 index 00000000..fa48f151 Binary files /dev/null and b/minetestforfun_game/mods/default/textures/default_coral_skeleton.png differ diff --git a/minetestforfun_game/mods/default/textures/default_item_smoke.png b/minetestforfun_game/mods/default/textures/default_item_smoke.png new file mode 100644 index 00000000..d62fb3b0 Binary files /dev/null and b/minetestforfun_game/mods/default/textures/default_item_smoke.png differ diff --git a/minetestforfun_game/mods/default/textures/default_silver_sand.png b/minetestforfun_game/mods/default/textures/default_silver_sand.png new file mode 100644 index 00000000..d381e883 Binary files /dev/null and b/minetestforfun_game/mods/default/textures/default_silver_sand.png differ diff --git a/minetestforfun_game/mods/default/tools.lua b/minetestforfun_game/mods/default/tools.lua index 9adfd3fc..901dd6fd 100755 --- a/minetestforfun_game/mods/default/tools.lua +++ b/minetestforfun_game/mods/default/tools.lua @@ -32,6 +32,7 @@ minetest.register_tool("default:pick_wood", { }, damage_groups = {fleshy=2}, }, + groups = {flammable = 2}, }) minetest.register_tool("default:pick_stone", { description = "Stone Pickaxe", @@ -167,6 +168,7 @@ minetest.register_tool("default:shovel_wood", { }, damage_groups = {fleshy = 2}, }, + groups = {flammable = 2}, }) minetest.register_tool("default:shovel_stone", { description = "Stone Shovel", @@ -302,6 +304,7 @@ minetest.register_tool("default:axe_wood", { }, damage_groups = {fleshy = 2}, }, + groups = {flammable = 2}, }) minetest.register_tool("default:axe_stone", { description = "Stone Axe", diff --git a/minetestforfun_game/mods/default/trees.lua b/minetestforfun_game/mods/default/trees.lua index abdef39e..ef1e6550 100755 --- a/minetestforfun_game/mods/default/trees.lua +++ b/minetestforfun_game/mods/default/trees.lua @@ -27,10 +27,8 @@ end -- 'is snow nearby' function local function is_snow_nearby(pos) - return #minetest.find_nodes_in_area( - {x = pos.x - 1, y = pos.y - 1, z = pos.z - 1}, - {x = pos.x + 1, y = pos.y + 1, z = pos.z + 1}, - {"default:snow", "default:snowblock", "default:dirt_with_snow"}) > 0 + return minetest.find_node_near(pos, 1, + {"default:snow", "default:snowblock", "default:dirt_with_snow"}) end @@ -43,8 +41,7 @@ function default.grow_sapling(pos) return end - --local mg_name = minetest.get_mapgen_setting("mg_name") --new function in > 0.4.14 stable ??? - local mg_name = minetest.get_mapgen_params().mgname + local mg_name = minetest.get_mapgen_setting("mg_name") local node = minetest.get_node(pos) if node.name == "default:sapling" then minetest.log("action", "A sapling grows into a tree at ".. @@ -429,6 +426,7 @@ function default.grow_new_aspen_tree(pos) path, "0", nil, false) end + -- -- Sapling 'on place' function to check protection of node and resulting tree volume -- @@ -437,12 +435,17 @@ function default.sapling_on_place(itemstack, placer, pointed_thing, sapling_name, minp_relative, maxp_relative, interval) -- Position of sapling local pos = pointed_thing.under - local node = minetest.get_node(pos) - local pdef = minetest.registered_nodes[node.name] + local node = minetest.get_node_or_nil(pos) + local pdef = node and minetest.registered_nodes[node.name] + + if pdef and pdef.on_rightclick and not placer:get_player_control().sneak then + return pdef.on_rightclick(pos, node, placer, itemstack, pointed_thing) + end + if not pdef or not pdef.buildable_to then pos = pointed_thing.above - node = minetest.get_node(pos) - pdef = minetest.registered_nodes[node.name] + node = minetest.get_node_or_nil(pos) + pdef = node and minetest.registered_nodes[node.name] if not pdef or not pdef.buildable_to then return itemstack end diff --git a/minetestforfun_game/mods/doors/README.txt b/minetestforfun_game/mods/doors/README.txt index b1c1363e..9ad7093d 100755 --- a/minetestforfun_game/mods/doors/README.txt +++ b/minetestforfun_game/mods/doors/README.txt @@ -1,62 +1,62 @@ Minetest Game mod: doors ======================== -version: 2.0 +See license.txt for license information. -License of source code: ------------------------ -Copyright (C) 2012 PilzAdam -modified by BlockMen (added sounds, glassdoors[glass, obsidian glass], trapdoor) -Steel trapdoor added by sofar. -Copyright (C) 2016 sofar@foo-projects.org -Re-implemented most of the door algorithms, added meshes, UV wrapped texture +Authors of source code +---------------------- +Originally by PilzAdam (MIT) + +Modified by BlockMen (MIT): Added sounds, glass doors (glass, obsidian glass) and trapdoor. + +Modified by sofar (sofar@foo-projects.org) (MIT): +Added Steel trapdoor. +Re-implemented most of the door algorithms, added meshes, UV wrapped texture. Added doors API to facilitate coding mods accessing and operating doors. -Added Fence Gate model, code, and sounds +Added Fence Gate model, code, and sounds. -This program is free software. It comes without any warranty, to -the extent permitted by applicable law. You can redistribute it -and/or modify it under the terms of the Do What The Fuck You Want -To Public License, Version 2, as published by Sam Hocevar. See -http://sam.zoy.org/wtfpl/COPYING for more details. +Various Minetest developers and contributors (MIT) -License of textures --------------------------------------- -following Textures created by Fernando Zapata (CC BY-SA 3.0): + +Authors of media (textures) +--------------------------- +Following textures created by Fernando Zapata (CC BY-SA 3.0): door_wood.png door_wood_a.png door_wood_a_r.png door_wood_b.png door_wood_b_r.png -following Textures created by BlockMen (WTFPL): +Following textures created by BlockMen (CC BY-SA 3.0): door_trapdoor.png door_obsidian_glass_side.png -following textures created by celeron55 (CC BY-SA 3.0): +Following textures created by celeron55 (CC BY-SA 3.0): door_glass_a.png door_glass_b.png -following Textures created by PenguinDad (CC BY-SA 4.0): +Following textures created by PenguinDad (CC BY-SA 4.0): door_glass.png door_obsidian_glass.png -following textures created by sofar (CC-BY-SA-3.0) +Following textures created by sofar (CC-BY-SA-3.0): doors_trapdoor_steel.png doors_trapdoor_steel_side.png door_trapdoor_side.png - -Obsidian door textures by red-001 based on textures by Pilzadam and BlockMen: WTFPL +Obsidian door textures by red-001 based on textures by Pilzadam and BlockMen (CC BY-SA 3.0): door_obsidian_glass.png -Glass door textures by red-001 based on textures by celeron55: CC BY-SA 3.0 +Glass door textures by red-001 based on textures by celeron55 (CC BY-SA 3.0): door_glass.png -All other textures (created by PilzAdam): WTFPL + +All other textures (created by PilzAdam) (CC BY-SA 3.0): Door textures were converted to the new texture map by sofar, paramat and red-001, under the same license as the originals. -Models: --------------------------------------- + +Authors of media (models) +------------------------- Door 3d models by sofar (CC-BY-SA-3.0) - door_a.obj - door_b.obj @@ -64,18 +64,21 @@ Fence gate models by sofar (CC-BY-SA-3.0) - fencegate_open.obj - fencegate_closed.obj -License of sounds --------------------------------------- + +Authors of media (sounds) +------------------------- Opening-Sound created by CGEffex (CC BY 3.0), modified by BlockMen door_open.ogg Closing-Sound created by bennstir (CC BY 3.0) door_close.ogg fencegate_open.ogg: - http://www.freesound.org/people/mhtaylor67/sounds/126041/ - CC0 + http://www.freesound.org/people/mhtaylor67/sounds/126041/ - (CC0 1.0) fencegate_close.ogg: - http://www.freesound.org/people/BarkersPinhead/sounds/274807/ - CC-BY-3.0 - http://www.freesound.org/people/rivernile7/sounds/249573/ - CC-BY-3.0 -Steel door sounds (open & close (CC-BY-3.0) by HazMatt + http://www.freesound.org/people/BarkersPinhead/sounds/274807/ - (CC-BY-3.0) + http://www.freesound.org/people/rivernile7/sounds/249573/ - (CC-BY-3.0) +Steel door sounds open & close (CC-BY-3.0) by HazMatt - http://www.freesound.org/people/HazMattt/sounds/187283/ doors_steel_door_open.ogg doors_steel_door_close.ogg +doors_glass_door_open.ogg, doors_glass_door_close.ogg: + https://www.freesound.org/people/SkeetMasterFunk69/sounds/235546/ (CC0 1.0) diff --git a/minetestforfun_game/mods/doors/doors3.lua b/minetestforfun_game/mods/doors/doors3.lua new file mode 100644 index 00000000..8c70448c --- /dev/null +++ b/minetestforfun_game/mods/doors/doors3.lua @@ -0,0 +1,359 @@ +local _doors = {} + +_doors.registered_doors3 = {} --MFF doors3 + +-- door 3 nodes +function doors.register3(name, def) + if not name:find(":") then + name = "doors:" .. name + end + + -- replace old doors of this type automatically + minetest.register_lbm({ + name = ":doors:replace_" .. name:gsub(":", "_"), + nodenames = {name.."_b_1", name.."_b_2"}, + action = function(pos, node) + local l = tonumber(node.name:sub(-1)) + local meta = minetest.get_meta(pos) + local h = meta:get_int("right") + 1 + local p2 = node.param2 + local replace = { + { { type = "a", state = 0 }, { type = "a", state = 3 } }, + { { type = "b", state = 1 }, { type = "b", state = 2 } } + } + local new = replace[l][h] + -- retain infotext and doors_owner fields + minetest.swap_node(pos, {name = name .. "_" .. new.type, param2 = p2}) + meta:set_int("state", new.state) + -- properly place doors:hidden at the right spot + local p3 = p2 + if new.state >= 2 then + p3 = (p3 + 3) % 4 + end + if new.state % 2 == 1 then + if new.state >= 2 then + p3 = (p3 + 1) % 4 + else + p3 = (p3 + 3) % 4 + end + end + -- wipe meta on top node as it's unused + minetest.set_node({x = pos.x, y = pos.y + 1, z = pos.z}, + {name = "doors:hidden", param2 = p3}) + minetest.set_node({x = pos.x, y = pos.y + 2, z = pos.z}, + {name = "doors:hidden", param2 = p3}) + end + }) + + minetest.register_craftitem(":" .. name, { + description = def.description, + inventory_image = def.inventory_image, + + on_place = function(itemstack, placer, pointed_thing) + local pos = nil + + if not pointed_thing.type == "node" then + return itemstack + end + + local node = minetest.get_node(pointed_thing.under) + local pdef = minetest.registered_nodes[node.name] + if pdef and pdef.on_rightclick then + return pdef.on_rightclick(pointed_thing.under, + node, placer, itemstack, pointed_thing) + end + + if pdef and pdef.buildable_to then + pos = pointed_thing.under + else + pos = pointed_thing.above + node = minetest.get_node(pos) + pdef = minetest.registered_nodes[node.name] + if not pdef or not pdef.buildable_to then + return itemstack + end + end + + local above = { x = pos.x, y = pos.y + 1, z = pos.z } + if not minetest.registered_nodes[minetest.get_node(above).name].buildable_to then + return itemstack + end + + local above2 = { x = pos.x, y = pos.y + 2, z = pos.z } + if not minetest.registered_nodes[minetest.get_node(above2).name].buildable_to then + return itemstack + end + + local pn = placer:get_player_name() + if minetest.is_protected(pos, pn) or minetest.is_protected(above, pn) or minetest.is_protected(above2, pn) then + return itemstack + end + + local dir = minetest.dir_to_facedir(placer:get_look_dir()) + + local ref = { + { x = -1, y = 0, z = 0 }, + { x = 0, y = 0, z = 1 }, + { x = 1, y = 0, z = 0 }, + { x = 0, y = 0, z = -1 }, + } + + local aside = { + x = pos.x + ref[dir + 1].x, + y = pos.y + ref[dir + 1].y, + z = pos.z + ref[dir + 1].z, + } + + local state = 0 + if minetest.get_item_group(minetest.get_node(aside).name, "door") == 1 then + state = state + 2 + minetest.set_node(pos, {name = name .. "_b", param2 = dir}) + else + minetest.set_node(pos, {name = name .. "_a", param2 = dir}) + end + minetest.set_node(above, { name = "doors:hidden" }) + minetest.set_node(above2, { name = "doors:hidden" }) + + local meta = minetest.get_meta(pos) + meta:set_int("state", state) + + if def.protected then + local pn = placer:get_player_name() + meta:set_string("doors_owner", pn) + meta:set_string("infotext", "Owned by " .. pn) + end + + if not minetest.setting_getbool("creative_mode") then + itemstack:take_item() + end + + on_place_node(pos, minetest.get_node(pos), placer, node, itemstack, pointed_thing) + + return itemstack + end + }) + + local can_dig = function(pos, digger) + if not def.protected then + return true + end + if minetest.check_player_privs(digger:get_player_name(), {protection_bypass = true}) then + return true + end + local meta = minetest.get_meta(pos) + local name = "" + if digger then + name = digger:get_player_name() + end + return meta:get_string("doors_owner") == name + end + + if not def.sounds then + def.sounds = default.node_sound_wood_defaults() + end + + if not def.sound_open then + def.sound_open = "doors_door_open" + end + + if not def.sound_close then + def.sound_close = "doors_door_close" + end + + def.groups.not_in_creative_inventory = 1 + def.groups.door = 1 + def.drop = name + def.door = { + name = name, + sounds = { def.sound_close, def.sound_open }, + } + + def.on_rightclick = function(pos, node, clicker) + _doors.door_toggle(pos, clicker) + end + def.after_dig_node = function(pos, node, meta, digger) + minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z}) + minetest.remove_node({x = pos.x, y = pos.y + 2, z = pos.z}) + nodeupdate({x = pos.x, y = pos.y + 2, z = pos.z}) + end + def.can_dig = function(pos, player) + return can_dig(pos, player) + end + def.on_rotate = function(pos, node, user, mode, new_param2) + return false + end + + if def.protected then + def.on_blast = function() end + else + def.on_blast = function(pos, intensity) + minetest.remove_node(pos) + -- hidden node doesn't get blasted away. + minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z}) + minetest.remove_node({x = pos.x, y = pos.y + 2, z = pos.z}) + return {name} + end + end + + def.on_destruct = function(pos) + minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z}) + minetest.remove_node({x = pos.x, y = pos.y + 2, z = pos.z}) + end + + minetest.register_node(":" .. name .. "_a", { + description = def.description, + visual = "mesh", + mesh = "door3_a.obj", + tiles = def.tiles, + drawtype = "mesh", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + walkable = true, + is_ground_content = false, + buildable_to = false, + drop = def.drop, + groups = def.groups, + sounds = def.sounds, + door = def.door, + on_rightclick = def.on_rightclick, + after_dig_node = def.after_dig_node, + can_dig = def.can_dig, + on_rotate = def.on_rotate, + on_blast = def.on_blast, + on_destruct = def.on_destruct, + selection_box = { + type = "fixed", + fixed = { -1/2,-1/2,-1/2,1/2,2.5,-6/16} + }, + collision_box = { + type = "fixed", + fixed = { -1/2,-1/2,-1/2,1/2,2.5,-6/16} + }, + }) + + minetest.register_node(":" .. name .. "_b", { + description = def.description, + visual = "mesh", + mesh = "door3_b.obj", + tiles = def.tiles, + drawtype = "mesh", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + walkable = true, + is_ground_content = false, + buildable_to = false, + drop = def.drop, + groups = def.groups, + sounds = def.sounds, + door = def.door, + on_rightclick = def.on_rightclick, + after_dig_node = def.after_dig_node, + can_dig = def.can_dig, + on_rotate = def.on_rotate, + on_blast = def.on_blast, + on_destruct = def.on_destruct, + selection_box = { + type = "fixed", + fixed = { -1/2,-1/2,-1/2,1/2,2.5,-6/16} + }, + collision_box = { + type = "fixed", + fixed = { -1/2,-1/2,-1/2,1/2,2.5,-6/16} + }, + }) + + if def.recipe then + minetest.register_craft({ + output = name, + recipe = def.recipe, + }) + end + + _doors.registered_doors3[name .. "_a"] = true + _doors.registered_doors3[name .. "_b"] = true +end + +doors.register3("door3_wood", { + tiles = {{ name = "doors_door3_wood.png", backface_culling = true }}, + description = "Wooden Door 3 Nodes", + inventory_image = "doors3_item_wood.png", + groups = { snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2 }, + recipe = { + {"", "", ""}, + {"", "doors:door_wood", ""}, + {"", "doors:door_wood", ""}, + } +}) + +doors.register3("door3_steel", { + tiles = {{ name = "doors_door3_steel.png", backface_culling = true }}, + description = "Steel Door 3 Nodes", + inventory_image = "doors3_item_steel.png", + protected = true, + groups = { snappy = 1, bendy = 2, cracky = 1, melty = 2, level = 2 }, + sound_open = "doors_steel_door_open", + sound_close = "doors_steel_door_close", + recipe = { + {"", "", ""}, + {"", "doors:door_steel", ""}, + {"", "doors:door_steel", ""}, + } +}) + +doors.register3("door3_glass", { + tiles = { "doors_door3_glass.png"}, + description = "Glass Door 3 Nodes", + inventory_image = "doors3_item_glass.png", + groups = { snappy=1, cracky=1, oddly_breakable_by_hand=3 }, + sounds = default.node_sound_glass_defaults(), + recipe = { + {"", "", ""}, + {"", "doors:door_glass", ""}, + {"", "doors:door_glass", ""}, + } +}) + +doors.register3("door3_obsidian_glass", { + tiles = { "doors_door3_obsidian_glass.png" }, + description = "Obsidian Glass Door 3 Nodes", + inventory_image = "doors3_item_obsidian_glass.png", + groups = { snappy=1, cracky=1, oddly_breakable_by_hand=3 }, + sounds = default.node_sound_glass_defaults(), + recipe = { + {"", "", ""}, + {"", "doors:door_obsidian_glass", ""}, + {"", "doors:door_obsidian_glass", ""}, + }, +}) + + +-- From BFD: Cherry planks doors +doors.register3("door3_cherry", { + tiles = { "doors_door3_cherry.png" }, + description = "Cherry Door 3 Nodes", + inventory_image = "doors3_item_cherry.png", + groups = {choppy=2, oddly_breakable_by_hand=2, flammable=2, door=1}, + sounds = default.node_sound_wood_defaults(), + recipe = { + {"", "", ""}, + {"", "doors:door_cherry", ""}, + {"", "doors:door_cherry", ""}, + }, +}) + +-- doors prison MFF +doors.register3("door3_prison", { + tiles = { "doors_door3_prison.png" }, + description = "Prison Door 3 Nodes", + inventory_image = "doors3_item_prison.png", + groups = {snappy=1,bendy=2,cracky=1,melty=2,level=2,door=1}, + protected = true, + sounds = default.node_sound_stone_defaults(), + recipe = { + {"", "", ""}, + {"", "doors:door_prison", ""}, + {"", "doors:door_prison", ""}, + } +}) diff --git a/minetestforfun_game/mods/doors/init.lua b/minetestforfun_game/mods/doors/init.lua index c6417c3d..fe789d69 100755 --- a/minetestforfun_game/mods/doors/init.lua +++ b/minetestforfun_game/mods/doors/init.lua @@ -1,24 +1,15 @@ - ---[[ - -Copyright (C) 2012 PilzAdam - modified by BlockMen (added sounds, glassdoors[glass, obsidian glass], trapdoor) -Copyright (C) 2015 - Auke Kok - ---]] - -- our API object doors = {} -- private data local _doors = {} _doors.registered_doors = {} -_doors.registered_doors3 = {} --MFF doors3 _doors.registered_trapdoors = {} -- returns an object to a door object or nil function doors.get(pos) - if _doors.registered_doors[minetest.get_node(pos).name] then + local node_name = minetest.get_node(pos).name + if _doors.registered_doors[node_name] then -- A normal upright door return { pos = pos, @@ -26,23 +17,23 @@ function doors.get(pos) if self:state() then return false end - return _doors.door_toggle(self.pos, player) + return _doors.door_toggle(self.pos, nil, player) end, close = function(self, player) if not self:state() then return false end - return _doors.door_toggle(self.pos, player) + return _doors.door_toggle(self.pos, nil, player) end, toggle = function(self, player) - return _doors.door_toggle(self.pos, player) + return _doors.door_toggle(self.pos, nil, player) end, state = function(self) local state = minetest.get_meta(self.pos):get_int("state") return state %2 == 1 end } - elseif _doors.registered_trapdoors[minetest.get_node(pos).name] then + elseif _doors.registered_trapdoors[node_name] then -- A trapdoor return { pos = pos, @@ -50,44 +41,19 @@ function doors.get(pos) if self:state() then return false end - return _doors.trapdoor_toggle(self.pos, player) + return _doors.trapdoor_toggle(self.pos, nil, player) end, close = function(self, player) if not self:state() then return false end - return _doors.trapdoor_toggle(self.pos, player) + return _doors.trapdoor_toggle(self.pos, nil, player) end, toggle = function(self, player) - return _doors.trapdoor_toggle(self.pos, player) + return _doors.trapdoor_toggle(self.pos, nil, player) end, state = function(self) - local name = minetest.get_node(pos).name - return name:sub(-5) == "_open" - end - } - elseif _doors.registered_doors3[minetest.get_node(pos).name] then --MFF doors3 - -- A normal upright door - return { - pos = pos, - open = function(self, player) - if self:state() then - return false - end - return _doors.door_toggle(self.pos, player) - end, - close = function(self, player) - if not self:state() then - return false - end - return _doors.door_toggle(self.pos, player) - end, - toggle = function(self, player) - return _doors.door_toggle(self.pos, player) - end, - state = function(self) - local state = minetest.get_meta(self.pos):get_int("state") - return state %2 == 1 + return minetest.get_node(self.pos).name:sub(-5) == "_open" end } else @@ -130,92 +96,41 @@ minetest.register_node("doors:hidden", { -- table used to aid door opening/closing local transform = { { - { v = "_a", param2 = 3 }, - { v = "_a", param2 = 0 }, - { v = "_a", param2 = 1 }, - { v = "_a", param2 = 2 }, + {v = "_a", param2 = 3}, + {v = "_a", param2 = 0}, + {v = "_a", param2 = 1}, + {v = "_a", param2 = 2}, }, { - { v = "_b", param2 = 1 }, - { v = "_b", param2 = 2 }, - { v = "_b", param2 = 3 }, - { v = "_b", param2 = 0 }, + {v = "_b", param2 = 1}, + {v = "_b", param2 = 2}, + {v = "_b", param2 = 3}, + {v = "_b", param2 = 0}, }, { - { v = "_b", param2 = 1 }, - { v = "_b", param2 = 2 }, - { v = "_b", param2 = 3 }, - { v = "_b", param2 = 0 }, + {v = "_b", param2 = 1}, + {v = "_b", param2 = 2}, + {v = "_b", param2 = 3}, + {v = "_b", param2 = 0}, }, { - { v = "_a", param2 = 3 }, - { v = "_a", param2 = 0 }, - { v = "_a", param2 = 1 }, - { v = "_a", param2 = 2 }, + {v = "_a", param2 = 3}, + {v = "_a", param2 = 0}, + {v = "_a", param2 = 1}, + {v = "_a", param2 = 2}, }, } - -function doors.get_pos(pos, dir, p1, b) - local pos2 = {x=pos.x, y=pos.y, z=pos.z} - if b == "a" then - if p1 == 0 then - if dir == 1 then - pos2.z=pos2.z-1 - elseif dir == 2 then - pos2.x=pos2.x-1 - elseif dir == 3 then - pos2.z=pos2.z+1 - else - pos2.x=pos2.x+1 - end - elseif p1 == 3 then - if dir == 1 then - pos2.x=pos2.x+1 - elseif dir == 2 then - pos2.z=pos2.z-1 - elseif dir == 3 then - pos2.x=pos2.x-1 - else - pos2.z=pos2.z+1 - end - end - else - if p1 == 1 then - if dir == 1 then - pos2.x=pos2.x+1 - elseif dir == 2 then - pos2.z=pos2.z-1 - elseif dir == 3 then - pos2.x=pos2.x-1 - else - pos2.z=pos2.z+1 - end - elseif p1 == 2 then - if dir == 1 then - pos2.z=pos2.z+1 - elseif dir == 2 then - pos2.x=pos2.x+1 - elseif dir == 3 then - pos2.z=pos2.z-1 - else - pos2.x=pos2.x-1 - end - end - end - return pos2 -end - - -function _doors.door_toggle(pos, clicker) +function _doors.door_toggle(pos, node, clicker) local meta = minetest.get_meta(pos) - local def = minetest.registered_nodes[minetest.get_node(pos).name] + node = node or minetest.get_node(pos) + local def = minetest.registered_nodes[node.name] local name = def.door.name local state = meta:get_string("state") if state == "" then -- fix up lvm-placed right-hinged doors, default closed - if minetest.get_node(pos).name:sub(-2) == "_b" then + if node.name:sub(-2) == "_b" then state = 2 else state = 0 @@ -224,7 +139,7 @@ function _doors.door_toggle(pos, clicker) state = tonumber(state) end - if clicker and not minetest.check_player_privs(clicker:get_player_name(), {protection_bypass = true}) then + if clicker and not minetest.check_player_privs(clicker, "protection_bypass") then local owner = meta:get_string("doors_owner") if owner ~= "" then if clicker:get_player_name() ~= owner then @@ -241,7 +156,14 @@ function _doors.door_toggle(pos, clicker) state = state + 1 end - local dir = minetest.get_node(pos).param2 + local dir = node.param2 + if state % 2 == 0 then + minetest.sound_play(def.door.sounds[1], + {pos = pos, gain = 0.3, max_hear_distance = 10}) + else + minetest.sound_play(def.door.sounds[2], + {pos = pos, gain = 0.3, max_hear_distance = 10}) + end minetest.swap_node(pos, { name = name .. transform[state + 1][dir+1].v, @@ -275,24 +197,35 @@ function _doors.door_toggle(pos, clicker) end -local function on_place_node(place_to, newnode, placer, oldnode, itemstack, pointed_thing) +local function on_place_node(place_to, newnode, + placer, oldnode, itemstack, pointed_thing) -- Run script hook - local _, callback - for _, callback in ipairs(core.registered_on_placenodes) do + for _, callback in ipairs(minetest.registered_on_placenodes) do -- Deepcopy pos, node and pointed_thing because callback can modify them local place_to_copy = {x = place_to.x, y = place_to.y, z = place_to.z} - local newnode_copy = {name = newnode.name, param1 = newnode.param1, param2 = newnode.param2} - local oldnode_copy = {name = oldnode.name, param1 = oldnode.param1, param2 = oldnode.param2} + local newnode_copy = + {name = newnode.name, param1 = newnode.param1, param2 = newnode.param2} + local oldnode_copy = + {name = oldnode.name, param1 = oldnode.param1, param2 = oldnode.param2} local pointed_thing_copy = { type = pointed_thing.type, above = vector.new(pointed_thing.above), under = vector.new(pointed_thing.under), ref = pointed_thing.ref, } - callback(place_to_copy, newnode_copy, placer, oldnode_copy, itemstack, pointed_thing_copy) + callback(place_to_copy, newnode_copy, placer, + oldnode_copy, itemstack, pointed_thing_copy) end end +local function can_dig_door(pos, digger) + local digger_name = digger and digger:get_player_name() + if digger_name and minetest.get_player_privs(digger_name).protection_bypass then + return true + end + return minetest.get_meta(pos):get_string("doors_owner") == digger_name +end + function doors.register(name, def) if not name:find(":") then name = "doors:" .. name @@ -308,8 +241,8 @@ function doors.register(name, def) local h = meta:get_int("right") + 1 local p2 = node.param2 local replace = { - { { type = "a", state = 0 }, { type = "a", state = 3 } }, - { { type = "b", state = 1 }, { type = "b", state = 2 } } + {{type = "a", state = 0}, {type = "a", state = 3}}, + {{type = "b", state = 1}, {type = "b", state = 2}} } local new = replace[l][h] -- retain infotext and doors_owner fields @@ -338,7 +271,7 @@ function doors.register(name, def) inventory_image = def.inventory_image, on_place = function(itemstack, placer, pointed_thing) - local pos = nil + local pos if not pointed_thing.type == "node" then return itemstack @@ -362,8 +295,11 @@ function doors.register(name, def) end end - local above = { x = pos.x, y = pos.y + 1, z = pos.z } - if not minetest.registered_nodes[minetest.get_node(above).name].buildable_to then + local above = {x = pos.x, y = pos.y + 1, z = pos.z} + local top_node = minetest.get_node_or_nil(above) + local topdef = top_node and minetest.registered_nodes[top_node.name] + + if not topdef or not topdef.buildable_to then return itemstack end @@ -375,10 +311,10 @@ function doors.register(name, def) local dir = minetest.dir_to_facedir(placer:get_look_dir()) local ref = { - { x = -1, y = 0, z = 0 }, - { x = 0, y = 0, z = 1 }, - { x = 1, y = 0, z = 0 }, - { x = 0, y = 0, z = -1 }, + {x = -1, y = 0, z = 0}, + {x = 0, y = 0, z = 1}, + {x = 1, y = 0, z = 0}, + {x = 0, y = 0, z = -1}, } local aside = { @@ -391,16 +327,16 @@ function doors.register(name, def) if minetest.get_item_group(minetest.get_node(aside).name, "door") == 1 then state = state + 2 minetest.set_node(pos, {name = name .. "_b", param2 = dir}) + minetest.set_node(above, {name = "doors:hidden", param2 = (dir + 3) % 4}) else minetest.set_node(pos, {name = name .. "_a", param2 = dir}) + minetest.set_node(above, {name = "doors:hidden", param2 = dir}) end - minetest.set_node(above, { name = "doors:hidden" }) local meta = minetest.get_meta(pos) meta:set_int("state", state) if def.protected then - local pn = placer:get_player_name() meta:set_string("doors_owner", pn) meta:set_string("infotext", "Owned by " .. pn) end @@ -409,26 +345,21 @@ function doors.register(name, def) itemstack:take_item() end - on_place_node(pos, minetest.get_node(pos), placer, node, itemstack, pointed_thing) + on_place_node(pos, minetest.get_node(pos), + placer, node, itemstack, pointed_thing) return itemstack end }) + def.inventory_image = nil - local can_dig = function(pos, digger) - if not def.protected then - return true - end - if minetest.check_player_privs(digger:get_player_name(), {protection_bypass = true}) then - return true - end - local meta = minetest.get_meta(pos) - local name = "" - if digger then - name = digger:get_player_name() - end - return meta:get_string("doors_owner") == name + if def.recipe then + minetest.register_craft({ + output = name, + recipe = def.recipe, + }) end + def.recipe = nil if not def.sounds then def.sounds = default.node_sound_wood_defaults() @@ -450,21 +381,18 @@ function doors.register(name, def) sounds = { def.sound_close, def.sound_open }, } - def.on_rightclick = function(pos, node, clicker) - _doors.door_toggle(pos, clicker) + def.on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) + _doors.door_toggle(pos, node, clicker) + return itemstack end def.after_dig_node = function(pos, node, meta, digger) minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z}) nodeupdate({x = pos.x, y = pos.y + 1, z = pos.z}) end - def.can_dig = function(pos, player) - return can_dig(pos, player) - end - def.on_rotate = function(pos, node, user, mode, new_param2) - return false - end + def.on_rotate = false if def.protected then + def.can_dig = can_dig_door def.on_blast = function() end else def.on_blast = function(pos, intensity) @@ -479,76 +407,21 @@ function doors.register(name, def) minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z}) end - minetest.register_node(":" .. name .. "_a", { - description = def.description, - visual = "mesh", - mesh = "door_a.obj", - tiles = def.tiles, - drawtype = "mesh", - paramtype = "light", - paramtype2 = "facedir", - sunlight_propagates = true, - walkable = true, - is_ground_content = false, - buildable_to = false, - drop = def.drop, - groups = def.groups, - sounds = def.sounds, - door = def.door, - on_rightclick = def.on_rightclick, - after_dig_node = def.after_dig_node, - can_dig = def.can_dig, - on_rotate = def.on_rotate, - on_blast = def.on_blast, - on_destruct = def.on_destruct, - selection_box = { - type = "fixed", - fixed = { -1/2,-1/2,-1/2,1/2,3/2,-6/16} - }, - collision_box = { - type = "fixed", - fixed = { -1/2,-1/2,-1/2,1/2,3/2,-6/16} - }, - }) + def.drawtype = "mesh" + def.paramtype = "light" + def.paramtype2 = "facedir" + def.sunlight_propagates = true + def.walkable = true + def.is_ground_content = false + def.buildable_to = false + def.selection_box = {type = "fixed", fixed = {-1/2,-1/2,-1/2,1/2,3/2,-6/16}} + def.collision_box = {type = "fixed", fixed = {-1/2,-1/2,-1/2,1/2,3/2,-6/16}} - minetest.register_node(":" .. name .. "_b", { - description = def.description, - visual = "mesh", - mesh = "door_b.obj", - tiles = def.tiles, - drawtype = "mesh", - paramtype = "light", - paramtype2 = "facedir", - sunlight_propagates = true, - walkable = true, - is_ground_content = false, - buildable_to = false, - drop = def.drop, - groups = def.groups, - sounds = def.sounds, - door = def.door, - on_rightclick = def.on_rightclick, - after_dig_node = def.after_dig_node, - can_dig = def.can_dig, - on_rotate = def.on_rotate, - on_blast = def.on_blast, - on_destruct = def.on_destruct, - selection_box = { - type = "fixed", - fixed = { -1/2,-1/2,-1/2,1/2,3/2,-6/16} - }, - collision_box = { - type = "fixed", - fixed = { -1/2,-1/2,-1/2,1/2,3/2,-6/16} - }, - }) + def.mesh = "door_a.obj" + minetest.register_node(":" .. name .. "_a", def) - if def.recipe then - minetest.register_craft({ - output = name, - recipe = def.recipe, - }) - end + def.mesh = "door_b.obj" + minetest.register_node(":" .. name .. "_b", def) _doors.registered_doors[name .. "_a"] = true _doors.registered_doors[name .. "_b"] = true @@ -558,7 +431,7 @@ doors.register("door_wood", { tiles = {{ name = "doors_door_wood.png", backface_culling = true }}, description = "Wooden Door", inventory_image = "doors_item_wood.png", - groups = { snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2 }, + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, recipe = { {"group:wood", "group:wood"}, {"group:wood", "group:wood"}, @@ -567,11 +440,12 @@ doors.register("door_wood", { }) doors.register("door_steel", { - tiles = {{ name = "doors_door_steel.png", backface_culling = true }}, + tiles = {{name = "doors_door_steel.png", backface_culling = true}}, description = "Steel Door", inventory_image = "doors_item_steel.png", protected = true, - groups = { snappy = 1, bendy = 2, cracky = 1, melty = 2, level = 2 }, + groups = {cracky = 1, level = 2}, + sounds = default.node_sound_metal_defaults(), sound_open = "doors_steel_door_open", sound_close = "doors_steel_door_close", recipe = { @@ -582,11 +456,13 @@ doors.register("door_steel", { }) doors.register("door_glass", { - tiles = { "doors_door_glass.png"}, + tiles = {"doors_door_glass.png"}, description = "Glass Door", inventory_image = "doors_item_glass.png", - groups = { snappy=1, cracky=1, oddly_breakable_by_hand=3 }, + groups = {cracky=3, oddly_breakable_by_hand=3}, sounds = default.node_sound_glass_defaults(), + sound_open = "doors_glass_door_open", + sound_close = "doors_glass_door_close", recipe = { {"default:glass", "default:glass"}, {"default:glass", "default:glass"}, @@ -595,11 +471,13 @@ doors.register("door_glass", { }) doors.register("door_obsidian_glass", { - tiles = { "doors_door_obsidian_glass.png" }, + tiles = {"doors_door_obsidian_glass.png"}, description = "Obsidian Glass Door", inventory_image = "doors_item_obsidian_glass.png", - groups = { snappy=1, cracky=1, oddly_breakable_by_hand=3 }, + groups = {cracky=3}, sounds = default.node_sound_glass_defaults(), + sound_open = "doors_glass_door_open", + sound_close = "doors_glass_door_close", recipe = { {"default:obsidian_glass", "default:obsidian_glass"}, {"default:obsidian_glass", "default:obsidian_glass"}, @@ -696,8 +574,9 @@ end ----trapdoor---- -function _doors.trapdoor_toggle(pos, clicker) - if clicker and not minetest.check_player_privs(clicker:get_player_name(), {protection_bypass = true}) then +function _doors.trapdoor_toggle(pos, node, clicker) + node = node or minetest.get_node(pos) + if clicker and not minetest.check_player_privs(clicker, "protection_bypass") then local meta = minetest.get_meta(pos) local owner = meta:get_string("doors_owner") if owner ~= "" then @@ -707,33 +586,32 @@ function _doors.trapdoor_toggle(pos, clicker) end end - local node = minetest.get_node(pos) local def = minetest.registered_nodes[node.name] if string.sub(node.name, -5) == "_open" then - minetest.sound_play(def.sound_close, {pos = pos, gain = 0.3, max_hear_distance = 10}) - minetest.swap_node(pos, {name = string.sub(node.name, 1, string.len(node.name) - 5), param1 = node.param1, param2 = node.param2}) + minetest.sound_play(def.sound_close, + {pos = pos, gain = 0.3, max_hear_distance = 10}) + minetest.swap_node(pos, {name = string.sub(node.name, 1, + string.len(node.name) - 5), param1 = node.param1, param2 = node.param2}) else - minetest.sound_play(def.sound_open, {pos = pos, gain = 0.3, max_hear_distance = 10}) - minetest.swap_node(pos, {name = node.name .. "_open", param1 = node.param1, param2 = node.param2}) + minetest.sound_play(def.sound_open, + {pos = pos, gain = 0.3, max_hear_distance = 10}) + minetest.swap_node(pos, {name = node.name .. "_open", + param1 = node.param1, param2 = node.param2}) end end function doors.register_trapdoor(name, def) + if not name:find(":") then + name = "doors:" .. name + end + local name_closed = name local name_opened = name.."_open" - local function check_player_priv(pos, player) - if not def.protected or minetest.check_player_privs(player:get_player_name(), {protection_bypass = true}) then - return true - end - local meta = minetest.get_meta(pos) - local pn = player:get_player_name() - return meta:get_string("doors_owner") == pn - end - - def.on_rightclick = function(pos, node, clicker) - _doors.trapdoor_toggle(pos, clicker) + def.on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) + _doors.trapdoor_toggle(pos, node, clicker) + return itemstack end -- Common trapdoor configuration @@ -741,9 +619,9 @@ function doors.register_trapdoor(name, def) def.paramtype = "light" def.paramtype2 = "facedir" def.is_ground_content = false - def.can_dig = check_player_priv if def.protected then + def.can_dig = can_dig_door def.after_place_node = function(pos, placer, itemstack, pointed_thing) local pn = placer:get_player_name() local meta = minetest.get_meta(pos) @@ -757,8 +635,7 @@ function doors.register_trapdoor(name, def) else def.on_blast = function(pos, intensity) minetest.remove_node(pos) - minetest.remove_node({ x = pos.x, y = pos.y + 1, z = pos.z}) - return { name } + return {name} end end @@ -785,8 +662,10 @@ function doors.register_trapdoor(name, def) type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, -6/16, 0.5} } - def_closed.tiles = { def.tile_front, def.tile_front, def.tile_side, def.tile_side, - def.tile_side, def.tile_side } + def_closed.tiles = {def.tile_front, + def.tile_front .. '^[transformFY', + def.tile_side, def.tile_side, + def.tile_side, def.tile_side} def_opened.node_box = { type = "fixed", @@ -796,10 +675,11 @@ function doors.register_trapdoor(name, def) type = "fixed", fixed = {-0.5, -0.5, 6/16, 0.5, 0.5, 0.5} } - def_opened.tiles = { def.tile_side, def.tile_side, + def_opened.tiles = {def.tile_side, def.tile_side, def.tile_side .. '^[transform3', def.tile_side .. '^[transform1', - def.tile_front, def.tile_front } + def.tile_front .. '^[transform46', + def.tile_front .. '^[transform6'} def_opened.drop = name_closed def_opened.groups.not_in_creative_inventory = 1 @@ -817,7 +697,7 @@ doors.register_trapdoor("doors:trapdoor", { wield_image = "doors_trapdoor.png", tile_front = "doors_trapdoor.png", tile_side = "doors_trapdoor_side.png", - groups = {snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=2, door=1}, + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, door = 1}, }) doors.register_trapdoor("doors:trapdoor_steel", { @@ -827,9 +707,10 @@ doors.register_trapdoor("doors:trapdoor_steel", { tile_front = "doors_trapdoor_steel.png", tile_side = "doors_trapdoor_steel_side.png", protected = true, + sounds = default.node_sound_metal_defaults(), sound_open = "doors_steel_door_open", sound_close = "doors_steel_door_close", - groups = {snappy=1, bendy=2, cracky=1, melty=2, level=2, door=1}, + groups = {cracky = 1, level = 2, door = 1}, }) minetest.register_craft({ @@ -875,17 +756,16 @@ function doors.register_fencegate(name, def) local fence = { description = def.description, drawtype = "mesh", - tiles = { def.texture }, + tiles = {def.texture}, paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, is_ground_content = false, drop = name .. "_closed", - connect_sides = { "left", "right" }, + connect_sides = {"left", "right"}, groups = def.groups, sounds = def.sounds, - on_rightclick = function(pos, clicker) - local node = minetest.get_node(pos) + on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) local node_def = minetest.registered_nodes[node.name] minetest.swap_node(pos, {name = node_def.gate, param2 = node.param2}) minetest.sound_play(node_def.sound, {pos = pos, gain = 0.3, @@ -920,7 +800,7 @@ function doors.register_fencegate(name, def) fence_open.collision_box = { type = "fixed", fixed = {{-1/2, -1/2, -1/4, -3/8, 1/2, 1/4}, - {-5/8, -3/8, -14/16, -3/8, 3/8, 0}}, + {-1/2, -3/8, -1/2, -3/8, 3/8, 0}}, } minetest.register_node(":" .. name .. "_closed", fence_closed) @@ -960,369 +840,59 @@ doors.register_fencegate("doors:gate_pine_wood", { description = "Pine Fence Gate", texture = "default_pine_wood.png", material = "default:pine_wood", - groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2} + groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3} }) doors.register_fencegate("doors:gate_aspen_wood", { description = "Aspen Fence Gate", texture = "default_aspen_wood.png", material = "default:aspen_wood", - groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2} -}) - --- door 3 nodes -function doors.register3(name, def) - if not name:find(":") then - name = "doors:" .. name - end - - -- replace old doors of this type automatically - minetest.register_lbm({ - name = ":doors:replace_" .. name:gsub(":", "_"), - nodenames = {name.."_b_1", name.."_b_2"}, - action = function(pos, node) - local l = tonumber(node.name:sub(-1)) - local meta = minetest.get_meta(pos) - local h = meta:get_int("right") + 1 - local p2 = node.param2 - local replace = { - { { type = "a", state = 0 }, { type = "a", state = 3 } }, - { { type = "b", state = 1 }, { type = "b", state = 2 } } - } - local new = replace[l][h] - -- retain infotext and doors_owner fields - minetest.swap_node(pos, {name = name .. "_" .. new.type, param2 = p2}) - meta:set_int("state", new.state) - -- properly place doors:hidden at the right spot - local p3 = p2 - if new.state >= 2 then - p3 = (p3 + 3) % 4 - end - if new.state % 2 == 1 then - if new.state >= 2 then - p3 = (p3 + 1) % 4 - else - p3 = (p3 + 3) % 4 - end - end - -- wipe meta on top node as it's unused - minetest.set_node({x = pos.x, y = pos.y + 1, z = pos.z}, - {name = "doors:hidden", param2 = p3}) - minetest.set_node({x = pos.x, y = pos.y + 2, z = pos.z}, - {name = "doors:hidden", param2 = p3}) - end - }) - - minetest.register_craftitem(":" .. name, { - description = def.description, - inventory_image = def.inventory_image, - - on_place = function(itemstack, placer, pointed_thing) - local pos = nil - - if not pointed_thing.type == "node" then - return itemstack - end - - local node = minetest.get_node(pointed_thing.under) - local pdef = minetest.registered_nodes[node.name] - if pdef and pdef.on_rightclick then - return pdef.on_rightclick(pointed_thing.under, - node, placer, itemstack, pointed_thing) - end - - if pdef and pdef.buildable_to then - pos = pointed_thing.under - else - pos = pointed_thing.above - node = minetest.get_node(pos) - pdef = minetest.registered_nodes[node.name] - if not pdef or not pdef.buildable_to then - return itemstack - end - end - - local above = { x = pos.x, y = pos.y + 1, z = pos.z } - if not minetest.registered_nodes[minetest.get_node(above).name].buildable_to then - return itemstack - end - - local above2 = { x = pos.x, y = pos.y + 2, z = pos.z } - if not minetest.registered_nodes[minetest.get_node(above2).name].buildable_to then - return itemstack - end - - local pn = placer:get_player_name() - if minetest.is_protected(pos, pn) or minetest.is_protected(above, pn) or minetest.is_protected(above2, pn) then - return itemstack - end - - local dir = minetest.dir_to_facedir(placer:get_look_dir()) - - local ref = { - { x = -1, y = 0, z = 0 }, - { x = 0, y = 0, z = 1 }, - { x = 1, y = 0, z = 0 }, - { x = 0, y = 0, z = -1 }, - } - - local aside = { - x = pos.x + ref[dir + 1].x, - y = pos.y + ref[dir + 1].y, - z = pos.z + ref[dir + 1].z, - } - - local state = 0 - if minetest.get_item_group(minetest.get_node(aside).name, "door") == 1 then - state = state + 2 - minetest.set_node(pos, {name = name .. "_b", param2 = dir}) - else - minetest.set_node(pos, {name = name .. "_a", param2 = dir}) - end - minetest.set_node(above, { name = "doors:hidden" }) - minetest.set_node(above2, { name = "doors:hidden" }) - - local meta = minetest.get_meta(pos) - meta:set_int("state", state) - - if def.protected then - local pn = placer:get_player_name() - meta:set_string("doors_owner", pn) - meta:set_string("infotext", "Owned by " .. pn) - end - - if not minetest.setting_getbool("creative_mode") then - itemstack:take_item() - end - - on_place_node(pos, minetest.get_node(pos), placer, node, itemstack, pointed_thing) - - return itemstack - end - }) - - local can_dig = function(pos, digger) - if not def.protected then - return true - end - if minetest.check_player_privs(digger:get_player_name(), {protection_bypass = true}) then - return true - end - local meta = minetest.get_meta(pos) - local name = "" - if digger then - name = digger:get_player_name() - end - return meta:get_string("doors_owner") == name - end - - if not def.sounds then - def.sounds = default.node_sound_wood_defaults() - end - - if not def.sound_open then - def.sound_open = "doors_door_open" - end - - if not def.sound_close then - def.sound_close = "doors_door_close" - end - - def.groups.not_in_creative_inventory = 1 - def.groups.door = 1 - def.drop = name - def.door = { - name = name, - sounds = { def.sound_close, def.sound_open }, - } - - def.on_rightclick = function(pos, node, clicker) - _doors.door_toggle(pos, clicker) - end - def.after_dig_node = function(pos, node, meta, digger) - minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z}) - minetest.remove_node({x = pos.x, y = pos.y + 2, z = pos.z}) - nodeupdate({x = pos.x, y = pos.y + 2, z = pos.z}) - end - def.can_dig = function(pos, player) - return can_dig(pos, player) - end - def.on_rotate = function(pos, node, user, mode, new_param2) - return false - end - - if def.protected then - def.on_blast = function() end - else - def.on_blast = function(pos, intensity) - minetest.remove_node(pos) - -- hidden node doesn't get blasted away. - minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z}) - minetest.remove_node({x = pos.x, y = pos.y + 2, z = pos.z}) - return {name} - end - end - - def.on_destruct = function(pos) - minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z}) - minetest.remove_node({x = pos.x, y = pos.y + 2, z = pos.z}) - end - - minetest.register_node(":" .. name .. "_a", { - description = def.description, - visual = "mesh", - mesh = "door3_a.obj", - tiles = def.tiles, - drawtype = "mesh", - paramtype = "light", - paramtype2 = "facedir", - sunlight_propagates = true, - walkable = true, - is_ground_content = false, - buildable_to = false, - drop = def.drop, - groups = def.groups, - sounds = def.sounds, - door = def.door, - on_rightclick = def.on_rightclick, - after_dig_node = def.after_dig_node, - can_dig = def.can_dig, - on_rotate = def.on_rotate, - on_blast = def.on_blast, - on_destruct = def.on_destruct, - selection_box = { - type = "fixed", - fixed = { -1/2,-1/2,-1/2,1/2,2.5,-6/16} - }, - collision_box = { - type = "fixed", - fixed = { -1/2,-1/2,-1/2,1/2,2.5,-6/16} - }, - }) - - minetest.register_node(":" .. name .. "_b", { - description = def.description, - visual = "mesh", - mesh = "door3_b.obj", - tiles = def.tiles, - drawtype = "mesh", - paramtype = "light", - paramtype2 = "facedir", - sunlight_propagates = true, - walkable = true, - is_ground_content = false, - buildable_to = false, - drop = def.drop, - groups = def.groups, - sounds = def.sounds, - door = def.door, - on_rightclick = def.on_rightclick, - after_dig_node = def.after_dig_node, - can_dig = def.can_dig, - on_rotate = def.on_rotate, - on_blast = def.on_blast, - on_destruct = def.on_destruct, - selection_box = { - type = "fixed", - fixed = { -1/2,-1/2,-1/2,1/2,2.5,-6/16} - }, - collision_box = { - type = "fixed", - fixed = { -1/2,-1/2,-1/2,1/2,2.5,-6/16} - }, - }) - - if def.recipe then - minetest.register_craft({ - output = name, - recipe = def.recipe, - }) - end - - _doors.registered_doors3[name .. "_a"] = true - _doors.registered_doors3[name .. "_b"] = true -end - - -doors.register3("door3_wood", { - tiles = {{ name = "doors_door3_wood.png", backface_culling = true }}, - description = "Wooden Door 3 Nodes", - inventory_image = "doors3_item_wood.png", - groups = { snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2 }, - recipe = { - {"", "", ""}, - {"", "doors:door_wood", ""}, - {"", "doors:door_wood", ""}, - } -}) - -doors.register3("door3_steel", { - tiles = {{ name = "doors_door3_steel.png", backface_culling = true }}, - description = "Steel Door 3 Nodes", - inventory_image = "doors3_item_steel.png", - protected = true, - groups = { snappy = 1, bendy = 2, cracky = 1, melty = 2, level = 2 }, - sound_open = "doors_steel_door_open", - sound_close = "doors_steel_door_close", - recipe = { - {"", "", ""}, - {"", "doors:door_steel", ""}, - {"", "doors:door_steel", ""}, - } -}) - -doors.register3("door3_glass", { - tiles = { "doors_door3_glass.png"}, - description = "Glass Door 3 Nodes", - inventory_image = "doors3_item_glass.png", - groups = { snappy=1, cracky=1, oddly_breakable_by_hand=3 }, - sounds = default.node_sound_glass_defaults(), - recipe = { - {"", "", ""}, - {"", "doors:door_glass", ""}, - {"", "doors:door_glass", ""}, - } -}) - -doors.register3("door3_obsidian_glass", { - tiles = { "doors_door3_obsidian_glass.png" }, - description = "Obsidian Glass Door 3 Nodes", - inventory_image = "doors3_item_obsidian_glass.png", - groups = { snappy=1, cracky=1, oddly_breakable_by_hand=3 }, - sounds = default.node_sound_glass_defaults(), - recipe = { - {"", "", ""}, - {"", "doors:door_obsidian_glass", ""}, - {"", "doors:door_obsidian_glass", ""}, - }, + groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3} }) --- From BFD: Cherry planks doors -doors.register3("door3_cherry", { - tiles = { "doors_door3_cherry.png" }, - description = "Cherry Door 3 Nodes", - inventory_image = "doors3_item_cherry.png", - groups = {choppy=2, oddly_breakable_by_hand=2, flammable=2, door=1}, - sounds = default.node_sound_wood_defaults(), - recipe = { - {"", "", ""}, - {"", "doors:door_cherry", ""}, - {"", "doors:door_cherry", ""}, - }, +----fuels---- + +minetest.register_craft({ + type = "fuel", + recipe = "doors:trapdoor", + burntime = 7, }) --- doors prison MFF -doors.register3("door3_prison", { - tiles = { "doors_door3_prison.png" }, - description = "Prison Door 3 Nodes", - inventory_image = "doors3_item_prison.png", - groups = {snappy=1,bendy=2,cracky=1,melty=2,level=2,door=1}, - protected = true, - sounds = default.node_sound_stone_defaults(), - recipe = { - {"", "", ""}, - {"", "doors:door_prison", ""}, - {"", "doors:door_prison", ""}, - } +minetest.register_craft({ + type = "fuel", + recipe = "doors:door_wood", + burntime = 14, }) + +minetest.register_craft({ + type = "fuel", + recipe = "doors:gate_wood_closed", + burntime = 7, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "doors:gate_acacia_wood_closed", + burntime = 8, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "doors:gate_junglewood_closed", + burntime = 9, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "doors:gate_pine_wood_closed", + burntime = 6, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "doors:gate_aspen_wood_closed", + burntime = 5, +}) + +dofile(minetest.get_modpath("doors") .. "/doors3.lua") diff --git a/minetestforfun_game/mods/doors/license.txt b/minetestforfun_game/mods/doors/license.txt new file mode 100644 index 00000000..8ce73c49 --- /dev/null +++ b/minetestforfun_game/mods/doors/license.txt @@ -0,0 +1,164 @@ +License of source code +---------------------- + +The MIT License (MIT) +Copyright (C) 2012-2016 PilzAdam +Copyright (C) 2014-2016 BlockMen +Copyright (C) 2015-2016 sofar (sofar@foo-projects.org) +Copyright (C) 2012-2016 Various Minetest developers and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of this +software and associated documentation files (the "Software"), to deal in the Software +without restriction, including without limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +For more details: +https://opensource.org/licenses/MIT + + +Licenses of media (textures, models and sounds) +----------------------------------------------- + +Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) +Copyright (C) 2011-2016 Fernando Zapata +Copyright (C) 2014-2016 celeron55 +Copyright (C) 2012-2016 PilzAdam +Copyright (C) 2014-2016 BlockMen +Copyright (C) 2015-2016 sofar +Copyright (C) 2016 red-001 +Copyright (C) 2016 paramat + +You are free to: +Share — copy and redistribute the material in any medium or format. +Adapt — remix, transform, and build upon the material for any purpose, even commercially. +The licensor cannot revoke these freedoms as long as you follow the license terms. + +Under the following terms: + +Attribution — You must give appropriate credit, provide a link to the license, and +indicate if changes were made. You may do so in any reasonable manner, but not in any way +that suggests the licensor endorses you or your use. + +ShareAlike — If you remix, transform, or build upon the material, you must distribute +your contributions under the same license as the original. + +No additional restrictions — You may not apply legal terms or technological measures that +legally restrict others from doing anything the license permits. + +Notices: + +You do not have to comply with the license for elements of the material in the public +domain or where your use is permitted by an applicable exception or limitation. +No warranties are given. The license may not give you all of the permissions necessary +for your intended use. For example, other rights such as publicity, privacy, or moral +rights may limit how you use the material. + +For more details: +http://creativecommons.org/licenses/by-sa/3.0/ + +----------------------- + +Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +Copyright (C) 2014-2016 PenguinDad + +You are free to: +Share — copy and redistribute the material in any medium or format. +Adapt — remix, transform, and build upon the material for any purpose, even commercially. +The licensor cannot revoke these freedoms as long as you follow the license terms. + +Under the following terms: + +Attribution — You must give appropriate credit, provide a link to the license, and +indicate if changes were made. You may do so in any reasonable manner, but not in any way +that suggests the licensor endorses you or your use. + +ShareAlike — If you remix, transform, or build upon the material, you must distribute +your contributions under the same license as the original. + +No additional restrictions — You may not apply legal terms or technological measures that +legally restrict others from doing anything the license permits. + +Notices: + +You do not have to comply with the license for elements of the material in the public +domain or where your use is permitted by an applicable exception or limitation. +No warranties are given. The license may not give you all of the permissions necessary +for your intended use. For example, other rights such as publicity, privacy, or moral +rights may limit how you use the material. + +For more details: +http://creativecommons.org/licenses/by-sa/4.0/ + +----------------------- + +Attribution 3.0 Unported (CC BY 3.0) +Copyright (C) 2014 CGEffex +Copyright (C) 2014 bennstir +Copyright (C) 2016 BarkersPinhead +Copyright (C) 2016 rivernile7 +Copyright (C) 2016 HazMatt + +You are free to: +Share — copy and redistribute the material in any medium or format. +Adapt — remix, transform, and build upon the material for any purpose, even commercially. +The licensor cannot revoke these freedoms as long as you follow the license terms. + +Under the following terms: + +Attribution — You must give appropriate credit, provide a link to the license, and +indicate if changes were made. You may do so in any reasonable manner, but not in any way +that suggests the licensor endorses you or your use. + +No additional restrictions — You may not apply legal terms or technological measures that +legally restrict others from doing anything the license permits. + +Notices: + +You do not have to comply with the license for elements of the material in the public +domain or where your use is permitted by an applicable exception or limitation. +No warranties are given. The license may not give you all of the permissions necessary +for your intended use. For example, other rights such as publicity, privacy, or moral +rights may limit how you use the material. + +For more details: +http://creativecommons.org/licenses/by/3.0/ + +----------------------- + +CC0 1.0 Universal (CC0 1.0) Public Domain Dedication +mhtaylor67 +SkeetMasterFunk69 + +No Copyright + +The person who associated a work with this deed has dedicated the work to the public +domain by waiving all of his or her rights to the work worldwide under copyright law, +including all related and neighboring rights, to the extent allowed by law. + +You can copy, modify, distribute and perform the work, even for commercial purposes, all +without asking permission. See Other Information below. + +Other Information + +In no way are the patent or trademark rights of any person affected by CC0, nor are the +rights that other persons may have in the work or in how the work is used, such as +publicity or privacy rights. +Unless expressly stated otherwise, the person who associated a work with this deed makes +no warranties about the work, and disclaims liability for all uses of the work, to the +fullest extent permitted by applicable law. +When using or citing the work, you should not imply endorsement by the author or the +affirmer. + +For more details: +https://creativecommons.org/publicdomain/zero/1.0/ diff --git a/minetestforfun_game/mods/doors/sounds/doors_glass_door_close.ogg b/minetestforfun_game/mods/doors/sounds/doors_glass_door_close.ogg new file mode 100644 index 00000000..b3c13559 Binary files /dev/null and b/minetestforfun_game/mods/doors/sounds/doors_glass_door_close.ogg differ diff --git a/minetestforfun_game/mods/doors/sounds/doors_glass_door_open.ogg b/minetestforfun_game/mods/doors/sounds/doors_glass_door_open.ogg new file mode 100644 index 00000000..66e6812d Binary files /dev/null and b/minetestforfun_game/mods/doors/sounds/doors_glass_door_open.ogg differ diff --git a/minetestforfun_game/mods/dye/README.txt b/minetestforfun_game/mods/dye/README.txt index b1035419..a2fbdd24 100755 --- a/minetestforfun_game/mods/dye/README.txt +++ b/minetestforfun_game/mods/dye/README.txt @@ -1,15 +1,13 @@ Minetest Game mod: dye ====================== - +See license.txt for license information. See init.lua for documentation. -License of source code and media files: ---------------------------------------- -Copyright (C) 2012 Perttu Ahola (celeron55) - -This program is free software. It comes without any warranty, to -the extent permitted by applicable law. You can redistribute it -and/or modify it under the terms of the Do What The Fuck You Want -To Public License, Version 2, as published by Sam Hocevar. See -http://sam.zoy.org/wtfpl/COPYING for more details. +Authors of source code +---------------------- +Originally by Perttu Ahola (celeron55) (MIT) +Various Minetest developers and contributors (MIT) +Authors of media (textures) +--------------------------- +Perttu Ahola (celeron55) (CC BY-SA 3.0) diff --git a/minetestforfun_game/mods/fire/README.txt b/minetestforfun_game/mods/fire/README.txt old mode 100755 new mode 100644 index 14022f03..35affc26 --- a/minetestforfun_game/mods/fire/README.txt +++ b/minetestforfun_game/mods/fire/README.txt @@ -1,36 +1,28 @@ Minetest Game mod: fire ======================= +See license.txt for license information. -License of source code: ------------------------ -Copyright (C) 2012 Perttu Ahola (celeron55) +Authors of source code +---------------------- +Originally by Perttu Ahola (celeron55) (LGPL 2.1) +Various Minetest developers and contributors (LGPL 2.1) -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation; either version 2.1 of the License, or -(at your option) any later version. - -http://www.gnu.org/licenses/lgpl-2.1.html - -License of media (textures and sounds) +Authors of media (textures and sounds) -------------------------------------- -Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) -http://creativecommons.org/licenses/by-sa/3.0/ - -Authors of media files ------------------------ Everything not listed in here: -Copyright (C) 2012 Perttu Ahola (celeron55) - -fire_small.ogg sampled from: - http://www.freesound.org/people/dobroide/sounds/4211/ - -fire_large.ogg sampled from: - http://www.freesound.org/people/Dynamicell/sounds/17548/ +Copyright (C) 2012 Perttu Ahola (celeron55) (CC BY-SA 3.0) fire_basic_flame_animated.png: - Muadtralk + Muadtralk (CC BY-SA 3.0) fire_flint_steel.png - Gambit (WTFPL) + Gambit (CC BY-SA 3.0) +fire_small.ogg sampled from: + http://www.freesound.org/people/dobroide/sounds/4211/ (CC BY 3.0) + +fire_large.ogg sampled from: + http://www.freesound.org/people/Dynamicell/sounds/17548/ (CC BY 3.0) + +fire_flint_and_steel.ogg + https://www.freesound.org/people/Benboncan/sounds/66457/ (CC BY 3.0) diff --git a/minetestforfun_game/mods/fire/depends.txt b/minetestforfun_game/mods/fire/depends.txt new file mode 100644 index 00000000..4ad96d51 --- /dev/null +++ b/minetestforfun_game/mods/fire/depends.txt @@ -0,0 +1 @@ +default diff --git a/minetestforfun_game/mods/fire/init.lua b/minetestforfun_game/mods/fire/init.lua index 5eec568d..2f07b524 100755 --- a/minetestforfun_game/mods/fire/init.lua +++ b/minetestforfun_game/mods/fire/init.lua @@ -28,14 +28,24 @@ minetest.register_node("fire:basic_flame", { sunlight_propagates = true, damage_per_second = 4, groups = {igniter = 2, dig_immediate = 3, not_in_creative_inventory = 1}, + on_timer = function(pos) + local f = minetest.find_node_near(pos, 1, {"group:flammable"}) + if not f then + minetest.remove_node(pos) + return + end + -- restart timer + return true + end, drop = "", on_construct = function(pos) - minetest.after(0, fire.on_flame_add_at, pos) + minetest.get_node_timer(pos):start(math.random(30, 60)) + minetest.after(0, fire.update_sounds_around, pos) end, on_destruct = function(pos) - minetest.after(0, fire.on_flame_remove_at, pos) + minetest.after(0, fire.update_sounds_around, pos) end, on_blast = function() @@ -70,26 +80,37 @@ minetest.register_node("fire:permanent_flame", { end, }) + +-- Flint and steel + minetest.register_tool("fire:flint_and_steel", { description = "Flint and Steel", inventory_image = "fire_flint_steel.png", on_use = function(itemstack, user, pointed_thing) - local player_name = user:get_player_name() local pt = pointed_thing - - if pt.type == "node" and minetest.get_node(pt.above).name == "air" then - itemstack:add_wear(1000) + minetest.sound_play( + "fire_flint_and_steel", + {pos = pt.above, gain = 0.6, max_hear_distance = 8} + ) + itemstack:add_wear(1000) + if pt.type == "node" then local node_under = minetest.get_node(pt.under).name - - if minetest.get_item_group(node_under, "flammable") >= 1 then - if not minetest.is_protected(pt.above, player_name) then - minetest.set_node(pt.above, {name = "fire:basic_flame"}) - else - minetest.chat_send_player(player_name, "This area is protected") - end + local nodedef = minetest.registered_nodes[node_under] + if not nodedef then + return + end + local player_name = user:get_player_name() + if minetest.is_protected(pt.under, player_name) then + minetest.chat_send_player(player_name, "This area is protected") + return + end + if nodedef.on_ignite then + nodedef.on_ignite(pt.under, user) + elseif minetest.get_item_group(node_under, "flammable") >= 1 + and minetest.get_node(pt.above).name == "air" then + minetest.set_node(pt.above, {name = "fire:basic_flame"}) end end - if not minetest.setting_getbool("creative_mode") then return itemstack end @@ -103,6 +124,25 @@ minetest.register_craft({ } }) + +-- Override coalblock to enable permanent flame above +-- Coalblock is non-flammable to avoid unwanted basic_flame nodes + +minetest.override_item("default:coalblock", { + after_destruct = function(pos, oldnode) + pos.y = pos.y + 1 + if minetest.get_node(pos).name == "fire:permanent_flame" then + minetest.remove_node(pos) + end + end, + on_ignite = function(pos, igniter) + local flame_pos = {x = pos.x, y = pos.y + 1, z = pos.z} + if minetest.get_node(flame_pos).name == "air" then + minetest.set_node(flame_pos, {name = "fire:permanent_flame"}) + end + end, +}) + -- Get sound area of position fire.D = 6 -- size of sound areas @@ -169,118 +209,83 @@ function fire.update_sounds_around(pos) 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) - return minetest.find_node_near(pos, 1, {"group:puts_out_fire"}) -end - - --[[ Extinguish all flames quickly with water, snow, ice minetest.register_abm({ + label = "Extinguish flame", nodenames = {"fire:basic_flame", "fire:permanent_flame"}, neighbors = {"group:puts_out_fire"}, interval = 3, chance = 1, catch_up = false, - action = function(p0, node, _, _) - minetest.remove_node(p0) + action = function(pos, node, active_object_count, active_object_count_wider) + minetest.remove_node(pos) minetest.sound_play("fire_extinguish_flame", - {pos = p0, max_hear_distance = 16, gain = 0.25}) + {pos = pos, max_hear_distance = 16, gain = 0.25}) end, }) -]]-- Enable the following ABMs according to 'disable fire' setting +-- Enable the following ABMs according to 'enable fire' setting -if minetest.setting_getbool("disable_fire") then +local fire_enabled = minetest.setting_getbool("enable_fire") +if fire_enabled == nil then + -- New setting not specified, check for old setting. + -- If old setting is also not specified, 'not nil' is true. + fire_enabled = not minetest.setting_getbool("disable_fire") +end + +if not fire_enabled then -- Remove basic flames only minetest.register_abm({ + label = "Remove disabled fire", nodenames = {"fire:basic_flame"}, interval = 7, chance = 1, catch_up = false, - action = function(p0, node, _, _) - minetest.remove_node(p0) - end, + action = minetest.remove_node, }) -else - - -- Extinguish flames quickly with water, snow, ice - - minetest.register_abm({ - nodenames = {"fire:basic_flame"}, - neighbors = {"group:puts_out_fire"}, - interval = 3, - chance = 2, - action = function(p0, node, _, _) - minetest.remove_node(p0) - minetest.sound_play("fire_extinguish_flame", - {pos = p0, max_hear_distance = 16, gain = 0.25}) - end, - }) +else -- Fire enabled -- Ignite neighboring nodes, add basic flames minetest.register_abm({ + label = "Ignite flame", nodenames = {"group:flammable"}, neighbors = {"group:igniter"}, interval = 7, chance = 12, catch_up = false, - action = function(p0, node, _, _) + action = function(pos, node, active_object_count, active_object_count_wider) -- If there is water or stuff like that around node, don't ignite - if fire.flame_should_extinguish(p0) then + if minetest.find_node_near(pos, 1, {"group:puts_out_fire"}) then return end - local p = fire.find_pos_for_flame_around(p0) + local p = minetest.find_node_near(pos, 1, {"air"}) if p then minetest.set_node(p, {name = "fire:basic_flame"}) end end, }) - -- Remove basic flames and flammable nodes + -- Remove flammable nodes minetest.register_abm({ + label = "Remove flammable nodes", nodenames = {"fire:basic_flame"}, + neighbors = "group:flammable", interval = 5, - chance = 6, + chance = 18, catch_up = false, - action = function(p0, node, _, _) - -- If there are no flammable nodes around flame, remove flame - local p = minetest.find_node_near(p0, 1, {"group:flammable"}) - if not p then - minetest.remove_node(p0) - return - end - if math.random(1, 4) == 1 then + action = function(pos, node, active_object_count, active_object_count_wider) + local p = minetest.find_node_near(pos, 1, {"group:flammable"}) + if p then -- remove flammable nodes around flame - local node = minetest.get_node(p) - local def = minetest.registered_nodes[node.name] + local flammable_node = minetest.get_node(p) + local def = minetest.registered_nodes[flammable_node.name] if def.on_burn then def.on_burn(p) else @@ -296,7 +301,7 @@ end -- Rarely ignite things from far ---[[ Currently disabled to reduce the chance of uncontrollable spreading +-- Currently disabled to reduce the chance of uncontrollable spreading fires that disrupt servers. Also for less lua processing load. minetest.register_abm({ @@ -304,13 +309,13 @@ minetest.register_abm({ neighbors = {"air"}, interval = 5, chance = 10, - action = function(p0, node, _, _) + action = function(pos, node, active_object_count, active_object_count_wider) local reg = minetest.registered_nodes[node.name] if not reg or not reg.groups.igniter or reg.groups.igniter < 2 then return end local d = reg.groups.igniter - local p = minetest.find_node_near(p0, d, {"group:flammable"}) + local p = minetest.find_node_near(pos, d, {"group:flammable"}) if p then -- If there is water or stuff like that around flame, don't ignite if fire.flame_should_extinguish(p) then diff --git a/minetestforfun_game/mods/fire/license.txt b/minetestforfun_game/mods/fire/license.txt new file mode 100644 index 00000000..43f9cd7f --- /dev/null +++ b/minetestforfun_game/mods/fire/license.txt @@ -0,0 +1,84 @@ +License of source code +---------------------- + +GNU Lesser General Public License, version 2.1 +Copyright (C) 2012-2016 celeron55, Perttu Ahola +Copyright (C) 2012-2016 Various Minetest developers and contributors + +This program is free software; you can redistribute it and/or modify it under the terms +of the GNU Lesser General Public License as published by the Free Software Foundation; +either version 2.1 of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; +without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +See the GNU Lesser General Public License for more details: +https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html + + +Licenses of media (textures and sounds) +--------------------------------------- + +Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) +Copyright (C) 2012-2016 Perttu Ahola (celeron55) +Copyright (C) 2012-2016 Muadtralk +Copyright (C) 2013-2016 Gambit + +You are free to: +Share — copy and redistribute the material in any medium or format. +Adapt — remix, transform, and build upon the material for any purpose, even commercially. +The licensor cannot revoke these freedoms as long as you follow the license terms. + +Under the following terms: + +Attribution — You must give appropriate credit, provide a link to the license, and +indicate if changes were made. You may do so in any reasonable manner, but not in any way +that suggests the licensor endorses you or your use. + +ShareAlike — If you remix, transform, or build upon the material, you must distribute +your contributions under the same license as the original. + +No additional restrictions — You may not apply legal terms or technological measures that +legally restrict others from doing anything the license permits. + +Notices: + +You do not have to comply with the license for elements of the material in the public +domain or where your use is permitted by an applicable exception or limitation. +No warranties are given. The license may not give you all of the permissions necessary +for your intended use. For example, other rights such as publicity, privacy, or moral +rights may limit how you use the material. + +For more details: +http://creativecommons.org/licenses/by-sa/3.0/ + +----------------------- + +Attribution 3.0 Unported (CC BY 3.0) +Copyright (C) 2005 dobroide +Copyright (C) 2006 Dynamicell +Copyright (C) 2009 Benboncan + +You are free to: +Share — copy and redistribute the material in any medium or format. +Adapt — remix, transform, and build upon the material for any purpose, even commercially. +The licensor cannot revoke these freedoms as long as you follow the license terms. + +Under the following terms: + +Attribution — You must give appropriate credit, provide a link to the license, and +indicate if changes were made. You may do so in any reasonable manner, but not in any way +that suggests the licensor endorses you or your use. + +No additional restrictions — You may not apply legal terms or technological measures that +legally restrict others from doing anything the license permits. + +Notices: + +You do not have to comply with the license for elements of the material in the public +domain or where your use is permitted by an applicable exception or limitation. +No warranties are given. The license may not give you all of the permissions necessary +for your intended use. For example, other rights such as publicity, privacy, or moral +rights may limit how you use the material. + +For more details: +http://creativecommons.org/licenses/by/3.0/ diff --git a/minetestforfun_game/mods/fire/sounds/fire_extinguish_flame.1.ogg b/minetestforfun_game/mods/fire/sounds/fire_extinguish_flame.1.ogg new file mode 100644 index 00000000..42506ddf Binary files /dev/null and b/minetestforfun_game/mods/fire/sounds/fire_extinguish_flame.1.ogg differ diff --git a/minetestforfun_game/mods/fire/sounds/fire_extinguish_flame.2.ogg b/minetestforfun_game/mods/fire/sounds/fire_extinguish_flame.2.ogg new file mode 100644 index 00000000..2747ab81 Binary files /dev/null and b/minetestforfun_game/mods/fire/sounds/fire_extinguish_flame.2.ogg differ diff --git a/minetestforfun_game/mods/fire/sounds/fire_extinguish_flame.3.ogg b/minetestforfun_game/mods/fire/sounds/fire_extinguish_flame.3.ogg new file mode 100644 index 00000000..8baeac32 Binary files /dev/null and b/minetestforfun_game/mods/fire/sounds/fire_extinguish_flame.3.ogg differ diff --git a/minetestforfun_game/mods/fire/sounds/fire_flint_and_steel.ogg b/minetestforfun_game/mods/fire/sounds/fire_flint_and_steel.ogg new file mode 100644 index 00000000..6996e16f Binary files /dev/null and b/minetestforfun_game/mods/fire/sounds/fire_flint_and_steel.ogg differ diff --git a/minetestforfun_game/mods/flowers/README.txt b/minetestforfun_game/mods/flowers/README.txt index ebd4a21f..2a5e4de3 100755 --- a/minetestforfun_game/mods/flowers/README.txt +++ b/minetestforfun_game/mods/flowers/README.txt @@ -1,23 +1,26 @@ Minetest Game mod: flowers ========================== +See license.txt for license information. -License of source code: ------------------------ -Copyright (C) 2012-2013 Ironzorg, VanessaE +Authors of source code +---------------------- +Originally by Ironzorg (MIT) and VanessaE (MIT) +Various Minetest developers and contributors (MIT) -This program is free software. It comes without any warranty, to -the extent permitted by applicable law. You can redistribute it -and/or modify it under the terms of the Do What The Fuck You Want -To Public License, Version 2, as published by Sam Hocevar. See -http://sam.zoy.org/wtfpl/COPYING for more details. +Authors of media (textures) +--------------------------- +RHRhino (CC BY-SA 3.0): + flowers_dandelion_white.png + flowers_dandelion_yellow.png + flowers_geranium.png + flowers_rose.png + flowers_tulip.png + flowers_viola.png -License of media (textures and sounds) --------------------------------------- -WTFPL +Gambit (CC BY-SA 3.0): + flowers_mushroom_brown.png + flowers_mushroom_red.png + flowers_waterlily.png -Gambit (WTFPL): - flowers_mushroom_*.png - flowers_waterlily.png - -DanDuncombe (WTFPL): - flowers_spores_*.png +yyt16384 (CC BY-SA 3.0): + flowers_waterlily_bottom.png, derived from Gambit's texture diff --git a/minetestforfun_game/mods/flowers/init.lua b/minetestforfun_game/mods/flowers/init.lua index 8c0d90a2..563287ff 100755 --- a/minetestforfun_game/mods/flowers/init.lua +++ b/minetestforfun_game/mods/flowers/init.lua @@ -58,12 +58,42 @@ local function add_simple_flower(name, desc, box, f_groups) end flowers.datas = { - {"rose", "Rose", {-0.15, -0.5, -0.15, 0.15, 0.3, 0.15}, {color_red = 1}}, - {"tulip", "Orange Tulip", {-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_orange = 1}}, - {"dandelion_yellow", "Yellow Dandelion", {-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_yellow = 1}}, - {"geranium", "Blue Geranium", {-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_blue = 1}}, - {"viola", "Viola", {-0.5, -0.5, -0.5, 0.5, -0.2, 0.5}, {color_violet = 1}}, - {"dandelion_white", "White dandelion", {-0.5, -0.5, -0.5, 0.5, -0.2, 0.5}, {color_white = 1}} + { + "rose", + "Rose", + {-2 / 16, -0.5, -2 / 16, 2 / 16, 5 / 16, 2 / 16}, + {color_red = 1, flammable = 1} + }, + { + "tulip", + "Orange Tulip", + {-2 / 16, -0.5, -2 / 16, 2 / 16, 3 / 16, 2 / 16}, + {color_orange = 1, flammable = 1} + }, + { + "dandelion_yellow", + "Yellow Dandelion", + {-2 / 16, -0.5, -2 / 16, 2 / 16, 4 / 16, 2 / 16}, + {color_yellow = 1, flammable = 1} + }, + { + "geranium", + "Blue Geranium", + {-2 / 16, -0.5, -2 / 16, 2 / 16, 2 / 16, 2 / 16}, + {color_blue = 1, flammable = 1} + }, + { + "viola", + "Viola", + {-5 / 16, -0.5, -5 / 16, 5 / 16, -1 / 16, 5 / 16}, + {color_violet = 1, flammable = 1} + }, + { + "dandelion_white", + "White dandelion", + {-5 / 16, -0.5, -5 / 16, 5 / 16, -2 / 16, 5 / 16}, + {color_white = 1, flammable = 1} + }, } for _,item in pairs(flowers.datas) do @@ -95,50 +125,54 @@ minetest.register_node("flowers:lily_pad", { }) -- Flower spread +-- Public function to enable override by mods -minetest.register_abm({ - nodenames = {"group:flora"}, - neighbors = {"default:dirt_with_grass", "default:desert_sand"}, - interval = 13, - chance = 96, - action = function(pos, node) - pos.y = pos.y - 1 - local under = minetest.get_node(pos) - pos.y = pos.y + 1 - if under.name == "default:desert_sand" then - minetest.set_node(pos, {name = "default:dry_shrub"}) - elseif under.name ~= "default:dirt_with_grass" then - return - end +function flowers.flower_spread(pos, node) + pos.y = pos.y - 1 + local under = minetest.get_node(pos) + pos.y = pos.y + 1 + if under.name == "default:desert_sand" then + minetest.set_node(pos, {name = "default:dry_shrub"}) + return + elseif under.name ~= "default:dirt_with_grass" and + under.name ~= "default:dirt_with_dry_grass" then + return + end - local light = minetest.get_node_light(pos) + local light = minetest.get_node_light(pos) + if not light or light < 13 then + return + end + + local pos0 = vector.subtract(pos, 4) + local pos1 = vector.add(pos, 4) + if #minetest.find_nodes_in_area(pos0, pos1, "group:flora") > 3 then + return + end + + local seedling = minetest.find_nodes_in_area_under_air(pos0, pos1, + {"default:dirt_with_grass", "default:dirt_with_dry_grass"}) + if #seedling > 0 then + seedling = seedling[math.random(#seedling)] + seedling.y = seedling.y + 1 + light = minetest.get_node_light(seedling) if not light or light < 13 then return end + minetest.set_node(seedling, {name = node.name}) + end +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)] - seedling.y = seedling.y + 1 - light = minetest.get_node_light(seedling) - if not light or light < 13 then - return - end - if minetest.get_node(seedling).name == "air" then - minetest.set_node(seedling, {name = node.name}) - end - end +minetest.register_abm({ + label = "Flower spread", + nodenames = {"group:flora"}, + neighbors = {"default:dirt_with_grass", "default:dirt_with_dry_grass", + "default:desert_sand"}, + interval = 13, + chance = 96, + action = function(...) + flowers.flower_spread(...) end, }) @@ -157,12 +191,12 @@ minetest.register_node("flowers:mushroom_red", { sunlight_propagates = true, walkable = false, buildable_to = true, - groups = {snappy = 3, flammable = 3, attached_node = 1}, + groups = {snappy = 3, attached_node = 1, flammable = 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} + fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, -1 / 16, 4 / 16}, } }) @@ -176,34 +210,35 @@ minetest.register_node("flowers:mushroom_brown", { sunlight_propagates = true, walkable = false, buildable_to = true, - groups = {snappy = 3, flammable = 3, attached_node = 1}, + groups = {snappy = 3, attached_node = 1, flammable = 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} + fixed = {-3 / 16, -0.5, -3 / 16, 3 / 16, -2 / 16, 3 / 16}, } }) --- mushroom spread and death + +-- Mushroom spread and death + minetest.register_abm({ + label = "Mushroom spread", 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 + 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 or random_node.name ~= "air" then return end local node_under = minetest.get_node_or_nil({x = random.x, @@ -211,20 +246,25 @@ minetest.register_abm({ 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 and - not minetest.is_protected(random, "") then + + if (minetest.get_item_group(node_under.name, "soil") ~= 0 or + minetest.get_item_group(node_under.name, "tree") ~= 0) and + minetest.get_node_light(pos, 0.5) <= 3 and + minetest.get_node_light(random, 0.5) <= 3 then minetest.set_node(random, {name = node.name}) end end }) --- these old mushroom related nodes can be simplified now + +-- 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") +minetest.register_alias("mushroom:brown_natural", "flowers:mushroom_brown") +minetest.register_alias("mushroom:red_natural", "flowers:mushroom_red") -- @@ -236,22 +276,24 @@ minetest.register_node("flowers:waterlily", { drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - tiles = {"flowers_waterlily.png"}, + tiles = {"flowers_waterlily.png", "flowers_waterlily_bottom.png"}, inventory_image = "flowers_waterlily.png", wield_image = "flowers_waterlily.png", liquids_pointable = true, walkable = false, buildable_to = true, sunlight_propagates = true, - groups = {snappy = 3, flower = 1}, + floodable = true, + groups = {snappy = 3, flower = 1, flammable = 1}, sounds = default.node_sound_leaves_defaults(), + node_placement_prediction = "", node_box = { type = "fixed", - fixed = {-0.5, -0.5, -0.5, 0.5, -0.46875, 0.5} + fixed = {-0.5, -0.5, -0.5, 0.5, -15 / 32, 0.5} }, selection_box = { type = "fixed", - fixed = {-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5} + fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, -15 / 32, 7 / 16} }, on_place = function(itemstack, placer, pointed_thing) @@ -260,16 +302,20 @@ minetest.register_node("flowers:waterlily", { local def = minetest.registered_nodes[node] local player_name = placer:get_player_name() - if def and def.liquidtype == "source" and minetest.get_item_group(node, "water") > 0 then + if def and def.liquidtype == "source" and + minetest.get_item_group(node, "water") > 0 then if not minetest.is_protected(pos, player_name) then - minetest.set_node(pos, {name = "flowers:waterlily", param2 = math.random(0, 3)}) + minetest.set_node(pos, {name = "flowers:waterlily", + param2 = math.random(0, 3)}) if not minetest.setting_getbool("creative_mode") then itemstack:take_item() end else - minetest.chat_send_player(player_name, "This area is protected") + minetest.chat_send_player(player_name, "Node is protected") + minetest.record_protection_violation(pos, player_name) end end + return itemstack end }) diff --git a/minetestforfun_game/mods/flowers/license.txt b/minetestforfun_game/mods/flowers/license.txt new file mode 100644 index 00000000..d3011622 --- /dev/null +++ b/minetestforfun_game/mods/flowers/license.txt @@ -0,0 +1,62 @@ +License of source code +---------------------- + +The MIT License (MIT) +Copyright (C) 2012-2016 Ironzorg, VanessaE +Copyright (C) 2012-2016 Various Minetest developers and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of this +software and associated documentation files (the "Software"), to deal in the Software +without restriction, including without limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +For more details: +https://opensource.org/licenses/MIT + + +Licenses of media (textures) +---------------------------- + +Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) +Copyright (C) 2014-2016 RHRhino +Copyright (C) 2015-2016 Gambit +Copyright (C) 2016 yyt16384 + +You are free to: +Share — copy and redistribute the material in any medium or format. +Adapt — remix, transform, and build upon the material for any purpose, even commercially. +The licensor cannot revoke these freedoms as long as you follow the license terms. + +Under the following terms: + +Attribution — You must give appropriate credit, provide a link to the license, and +indicate if changes were made. You may do so in any reasonable manner, but not in any way +that suggests the licensor endorses you or your use. + +ShareAlike — If you remix, transform, or build upon the material, you must distribute +your contributions under the same license as the original. + +No additional restrictions — You may not apply legal terms or technological measures that +legally restrict others from doing anything the license permits. + +Notices: + +You do not have to comply with the license for elements of the material in the public +domain or where your use is permitted by an applicable exception or limitation. +No warranties are given. The license may not give you all of the permissions necessary +for your intended use. For example, other rights such as publicity, privacy, or moral +rights may limit how you use the material. + +For more details: +http://creativecommons.org/licenses/by-sa/3.0/ diff --git a/minetestforfun_game/mods/flowers/mapgen.lua b/minetestforfun_game/mods/flowers/mapgen.lua index 5337031b..2e69da4f 100755 --- a/minetestforfun_game/mods/flowers/mapgen.lua +++ b/minetestforfun_game/mods/flowers/mapgen.lua @@ -217,9 +217,9 @@ minetest.register_decoration({ -- Mods using singlenode mapgen can call these functions to enable -- the use of minetest.generate_ores or minetest.generate_decorations -local mg_params = minetest.get_mapgen_params() -if mg_params.mgname == "v6" then +local mg_name = minetest.get_mapgen_setting("mg_name") +if mg_name == "v6" then flowers.register_mgv6_decorations() -elseif mg_params.mgname ~= "singlenode" then +elseif mg_name ~= "singlenode" then flowers.register_decorations() end diff --git a/minetestforfun_game/mods/flowers/textures/flowers_waterlily_bottom.png b/minetestforfun_game/mods/flowers/textures/flowers_waterlily_bottom.png new file mode 100644 index 00000000..3dbeaf40 Binary files /dev/null and b/minetestforfun_game/mods/flowers/textures/flowers_waterlily_bottom.png differ diff --git a/minetestforfun_game/mods/nyancat/README.txt b/minetestforfun_game/mods/nyancat/README.txt new file mode 100644 index 00000000..fadc1d23 --- /dev/null +++ b/minetestforfun_game/mods/nyancat/README.txt @@ -0,0 +1,16 @@ +Minetest Game mod: nyancat +========================== +See license.txt for license information. + +Authors of source code +---------------------- +Originally by celeron55, Perttu Ahola (LGPL 2.1) +Various Minetest developers and contributors (LGPL 2.1) + +Authors of media files +---------------------- +VanessaE (CC BY-SA 3.0): + nyancat_front.png + nyancat_back.png + nyancat_side.png + nyancat_rainbow.png diff --git a/minetestforfun_game/mods/nyancat/depends.txt b/minetestforfun_game/mods/nyancat/depends.txt new file mode 100644 index 00000000..4ad96d51 --- /dev/null +++ b/minetestforfun_game/mods/nyancat/depends.txt @@ -0,0 +1 @@ +default diff --git a/minetestforfun_game/mods/nyancat/init.lua b/minetestforfun_game/mods/nyancat/init.lua new file mode 100644 index 00000000..7192beb8 --- /dev/null +++ b/minetestforfun_game/mods/nyancat/init.lua @@ -0,0 +1,89 @@ +minetest.register_node("nyancat:nyancat", { + description = "Nyan Cat", + tiles = {"nyancat_side.png", "nyancat_side.png", "nyancat_side.png", + "nyancat_side.png", "nyancat_back.png", "nyancat_front.png"}, + paramtype = "light", + light_source = default.LIGHT_MAX, + paramtype2 = "facedir", + groups = {cracky = 2}, + is_ground_content = false, + legacy_facedir_simple = true, + sounds = default.node_sound_defaults(), +}) + +minetest.register_node("nyancat:nyancat_rainbow", { + description = "Nyan Cat Rainbow", + tiles = { + "nyancat_rainbow.png^[transformR90", + "nyancat_rainbow.png^[transformR90", + "nyancat_rainbow.png" + }, + paramtype = "light", + light_source = default.LIGHT_MAX, + paramtype2 = "facedir", + groups = {cracky = 2}, + is_ground_content = false, + sounds = default.node_sound_defaults(), +}) + +minetest.register_craft({ + type = "fuel", + recipe = "nyancat:nyancat", + burntime = 1, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "nyancat:nyancat_rainbow", + burntime = 1, +}) + +nyancat = {} + +function nyancat.place(pos, facedir, length) + if facedir > 3 then + facedir = 0 + end + local tailvec = minetest.facedir_to_dir(facedir) + local p = {x = pos.x, y = pos.y, z = pos.z} + minetest.set_node(p, {name = "nyancat:nyancat", param2 = facedir}) + for i = 1, length do + p.x = p.x + tailvec.x + p.z = p.z + tailvec.z + minetest.set_node(p, {name = "nyancat:nyancat_rainbow", param2 = facedir}) + end +end + +function nyancat.generate(minp, maxp, seed) + local height_min = -31000 + local height_max = -32 + if maxp.y < height_min or minp.y > height_max then + return + end + local y_min = math.max(minp.y, height_min) + local y_max = math.min(maxp.y, height_max) + local volume = (maxp.x - minp.x + 1) * (y_max - y_min + 1) * (maxp.z - minp.z + 1) + local pr = PseudoRandom(seed + 9324342) + local max_num_nyancats = math.floor(volume / (16 * 16 * 16)) + for i = 1, max_num_nyancats do + if pr:next(0, 1000) == 0 then + local x0 = pr:next(minp.x, maxp.x) + local y0 = pr:next(minp.y, maxp.y) + local z0 = pr:next(minp.z, maxp.z) + local p0 = {x = x0, y = y0, z = z0} + nyancat.place(p0, pr:next(0, 3), pr:next(3, 15)) + end + end +end + +minetest.register_on_generated(function(minp, maxp, seed) + nyancat.generate(minp, maxp, seed) +end) + +-- Legacy +minetest.register_alias("default:nyancat", "nyancat:nyancat") +minetest.register_alias("default:nyancat_rainbow", "nyancat:nyancat_rainbow") +minetest.register_alias("nyancat", "nyancat:nyancat") +minetest.register_alias("nyancat_rainbow", "nyancat:nyancat_rainbow") +default.make_nyancat = nyancat.place +default.generate_nyancats = nyancat.generate diff --git a/minetestforfun_game/mods/nyancat/license.txt b/minetestforfun_game/mods/nyancat/license.txt new file mode 100644 index 00000000..3aa38617 --- /dev/null +++ b/minetestforfun_game/mods/nyancat/license.txt @@ -0,0 +1,50 @@ +License of source code +---------------------- + +GNU Lesser General Public License, version 2.1 +Copyright (C) 2011-2016 celeron55, Perttu Ahola +Copyright (C) 2012-2016 Various Minetest developers and contributors + +This program is free software; you can redistribute it and/or modify it under the terms +of the GNU Lesser General Public License as published by the Free Software Foundation; +either version 2.1 of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; +without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +See the GNU Lesser General Public License for more details: +https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html + + +Licenses of media (textures) +---------------------------- + +Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) +Copyright (C) 2012-2016 VanessaE + +You are free to: +Share — copy and redistribute the material in any medium or format. +Adapt — remix, transform, and build upon the material for any purpose, even commercially. +The licensor cannot revoke these freedoms as long as you follow the license terms. + +Under the following terms: + +Attribution — You must give appropriate credit, provide a link to the license, and +indicate if changes were made. You may do so in any reasonable manner, but not in any way +that suggests the licensor endorses you or your use. + +ShareAlike — If you remix, transform, or build upon the material, you must distribute +your contributions under the same license as the original. + +No additional restrictions — You may not apply legal terms or technological measures that +legally restrict others from doing anything the license permits. + +Notices: + +You do not have to comply with the license for elements of the material in the public +domain or where your use is permitted by an applicable exception or limitation. +No warranties are given. The license may not give you all of the permissions necessary +for your intended use. For example, other rights such as publicity, privacy, or moral +rights may limit how you use the material. + +For more details: +http://creativecommons.org/licenses/by-sa/3.0/ diff --git a/minetestforfun_game/mods/nyancat/textures/nyancat_back.png b/minetestforfun_game/mods/nyancat/textures/nyancat_back.png new file mode 100644 index 00000000..e479ace8 Binary files /dev/null and b/minetestforfun_game/mods/nyancat/textures/nyancat_back.png differ diff --git a/minetestforfun_game/mods/nyancat/textures/nyancat_front.png b/minetestforfun_game/mods/nyancat/textures/nyancat_front.png new file mode 100644 index 00000000..c9dd6a33 Binary files /dev/null and b/minetestforfun_game/mods/nyancat/textures/nyancat_front.png differ diff --git a/minetestforfun_game/mods/nyancat/textures/nyancat_rainbow.png b/minetestforfun_game/mods/nyancat/textures/nyancat_rainbow.png new file mode 100644 index 00000000..685a22cc Binary files /dev/null and b/minetestforfun_game/mods/nyancat/textures/nyancat_rainbow.png differ diff --git a/minetestforfun_game/mods/nyancat/textures/nyancat_side.png b/minetestforfun_game/mods/nyancat/textures/nyancat_side.png new file mode 100644 index 00000000..3152c337 Binary files /dev/null and b/minetestforfun_game/mods/nyancat/textures/nyancat_side.png differ diff --git a/minetestforfun_game/mods/screwdriver/README.txt b/minetestforfun_game/mods/screwdriver/README.txt new file mode 100644 index 00000000..9d39c58c --- /dev/null +++ b/minetestforfun_game/mods/screwdriver/README.txt @@ -0,0 +1,13 @@ +Minetest Game mod: screwdriver +============================== +See license.txt for license information. + +License of source code +---------------------- +Originally by RealBadAngel, Maciej Kasatkin (LGPL 2.1) +Various Minetest developers and contributors (LGPL 2.1) + +License of media (textures) +--------------------------- +Created by Gambit (CC BY-SA 3.0): + screwdriver.png diff --git a/minetestforfun_game/mods/screwdriver/init.lua b/minetestforfun_game/mods/screwdriver/init.lua index 7853c7e8..31daa1c5 100755 --- a/minetestforfun_game/mods/screwdriver/init.lua +++ b/minetestforfun_game/mods/screwdriver/init.lua @@ -66,6 +66,7 @@ screwdriver.handler = function(itemstack, user, pointed_thing, mode, uses) end else if not ndef or not ndef.paramtype2 == "facedir" or + ndef.on_rotate == false or (ndef.drawtype == "nodebox" and not ndef.node_box.type == "fixed") or node.param2 == nil then diff --git a/minetestforfun_game/mods/screwdriver/license.txt b/minetestforfun_game/mods/screwdriver/license.txt new file mode 100644 index 00000000..d9b721bb --- /dev/null +++ b/minetestforfun_game/mods/screwdriver/license.txt @@ -0,0 +1,50 @@ +License of source code +---------------------- + +GNU Lesser General Public License, version 2.1 +Copyright (C) 2013-2016 RealBadAngel, Maciej Kasatkin +Copyright (C) 2013-2016 Various Minetest developers and contributors + +This program is free software; you can redistribute it and/or modify it under the terms +of the GNU Lesser General Public License as published by the Free Software Foundation; +either version 2.1 of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; +without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +See the GNU Lesser General Public License for more details: +https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html + + +Licenses of media (textures) +---------------------------- + +Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) +Copyright (C) 2013-2016 Gambit + +You are free to: +Share — copy and redistribute the material in any medium or format. +Adapt — remix, transform, and build upon the material for any purpose, even commercially. +The licensor cannot revoke these freedoms as long as you follow the license terms. + +Under the following terms: + +Attribution — You must give appropriate credit, provide a link to the license, and +indicate if changes were made. You may do so in any reasonable manner, but not in any way +that suggests the licensor endorses you or your use. + +ShareAlike — If you remix, transform, or build upon the material, you must distribute +your contributions under the same license as the original. + +No additional restrictions — You may not apply legal terms or technological measures that +legally restrict others from doing anything the license permits. + +Notices: + +You do not have to comply with the license for elements of the material in the public +domain or where your use is permitted by an applicable exception or limitation. +No warranties are given. The license may not give you all of the permissions necessary +for your intended use. For example, other rights such as publicity, privacy, or moral +rights may limit how you use the material. + +For more details: +http://creativecommons.org/licenses/by-sa/3.0/ diff --git a/minetestforfun_game/mods/screwdriver/readme.txt b/minetestforfun_game/mods/screwdriver/readme.txt deleted file mode 100755 index bdf109b8..00000000 --- a/minetestforfun_game/mods/screwdriver/readme.txt +++ /dev/null @@ -1,21 +0,0 @@ -Minetest Game mod: screwdriver -============================== - -License of source code: ------------------------ -Copyright (C) 2013 RealBadAngel, Maciej Kasatkin - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -http://www.gnu.org/licenses/lgpl-2.1.html - -License of media (textures and sounds) --------------------------------------- -Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) -http://creativecommons.org/licenses/by-sa/3.0/ - -Created by Gambit (WTFPL): - screwdriver.png diff --git a/minetestforfun_game/mods/stairs/README.txt b/minetestforfun_game/mods/stairs/README.txt index 9bd0b213..d32cd71b 100755 --- a/minetestforfun_game/mods/stairs/README.txt +++ b/minetestforfun_game/mods/stairs/README.txt @@ -1,26 +1,16 @@ Minetest Game mod: stairs ========================= +See license.txt for license information. -License of source code: ------------------------ -Copyright (C) 2011-2012 Kahrl -Copyright (C) 2011-2012 celeron55, Perttu Ahola +Authors of source code +---------------------- +Originally by Kahrl (LGPL 2.1) and +celeron55, Perttu Ahola (LGPL 2.1) +Various Minetest developers and contributors (LGPL 2.1) -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -http://www.gnu.org/licenses/lgpl-2.1.html - -License of media (textures and sounds) --------------------------------------- -Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) -http://creativecommons.org/licenses/by-sa/3.0/ - -Authors of media files ------------------------ -Everything not listed in here: -Copyright (C) 2010-2012 celeron55, Perttu Ahola +Authors of media (models) +------------------------- +Jean-Patrick G. (kilbith) (CC BY-SA 3.0): + stairs_stair.obj diff --git a/minetestforfun_game/mods/stairs/init.lua b/minetestforfun_game/mods/stairs/init.lua index 9abdac4c..3dd34954 100755 --- a/minetestforfun_game/mods/stairs/init.lua +++ b/minetestforfun_game/mods/stairs/init.lua @@ -87,27 +87,48 @@ function stairs.register_stair(subname, recipeitem, groups, images, description, }) end - minetest.register_craft({ - output = 'stairs:stair_' .. subname .. ' 6', - recipe = { - {recipeitem, "", ""}, - {recipeitem, recipeitem, ""}, - {recipeitem, recipeitem, recipeitem}, - }, - }) + if recipeitem then + minetest.register_craft({ + output = 'stairs:stair_' .. subname .. ' 8', + recipe = { + {recipeitem, "", ""}, + {recipeitem, recipeitem, ""}, + {recipeitem, recipeitem, recipeitem}, + }, + }) - -- Flipped recipe for the silly minecrafters - minetest.register_craft({ - output = 'stairs:stair_' .. subname .. ' 6', - recipe = { - {"", "", recipeitem}, - {"", recipeitem, recipeitem}, - {recipeitem, recipeitem, recipeitem}, - }, - }) + -- Flipped recipe for the silly minecrafters + minetest.register_craft({ + output = 'stairs:stair_' .. subname .. ' 8', + recipe = { + {"", "", recipeitem}, + {"", recipeitem, recipeitem}, + {recipeitem, recipeitem, recipeitem}, + }, + }) + + -- Fuel + local baseburntime = minetest.get_craft_result({ + method = "fuel", + width = 1, + items = {recipeitem} + }).time + if baseburntime > 0 then + minetest.register_craft({ + type = "fuel", + recipe = 'stairs:stair_' .. subname, + burntime = math.floor(baseburntime * 0.75), + }) + end + end end +-- Slab facedir to placement 6d matching table +local slab_trans_dir = {[0] = 8, 0, 2, 1, 3, 4} +-- Slab facedir when placing initial slab against other surface +local slab_trans_dir_place = {[0] = 0, 20, 12, 16, 4, 8} + -- Register slabs. -- Node will be called stairs:slab_ @@ -127,86 +148,61 @@ function stairs.register_slab(subname, recipeitem, groups, images, description, fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, }, on_place = function(itemstack, placer, pointed_thing) - if pointed_thing.type ~= "node" then - return itemstack - end + local under = minetest.get_node(pointed_thing.under) + local wield_item = itemstack:get_name() - -- If it's being placed on an another similar one, replace it with - -- a full block - local slabpos = nil - local slabnode = nil - local p0 = pointed_thing.under - local p1 = pointed_thing.above - local n0 = minetest.get_node(p0) - local n1 = minetest.get_node(p1) - local param2 = 0 + if under and wield_item == under.name then + -- place slab using under node orientation + local dir = minetest.dir_to_facedir(vector.subtract( + pointed_thing.above, pointed_thing.under), true) - local n0_is_upside_down = (n0.name == "stairs:slab_" .. subname and - n0.param2 >= 20) + local p2 = under.param2 - 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 - slabpos = p1 - slabnode = n1 - end - if slabpos then - -- Remove the slab at slabpos - minetest.remove_node(slabpos) - -- Make a fake stack of a single item and try to place it - local fakestack = ItemStack(recipeitem) - fakestack:set_count(itemstack:get_count()) - - pointed_thing.above = slabpos - local success - 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()) - -- Else put old node back - else - minetest.set_node(slabpos, slabnode) - end - return itemstack - end - - -- Upside down slabs - 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 - minetest.remove_node(p0) - -- Make a fake stack of a single item and try to place it - local fakestack = ItemStack(recipeitem) - fakestack:set_count(itemstack:get_count()) - - pointed_thing.above = p0 - local success - 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()) - -- Else put old node back - else - minetest.set_node(p0, n0) + -- combine two slabs if possible + if slab_trans_dir[math.floor(p2 / 4)] == dir then + if not recipeitem then + return itemstack + end + local player_name = placer:get_player_name() + if minetest.is_protected(pointed_thing.under, player_name) and not + minetest.check_player_privs(placer, "protection_bypass") then + minetest.record_protection_violation(pointed_thing.under, + player_name) + return + end + minetest.set_node(pointed_thing.under, {name = recipeitem, param2 = p2}) + if not minetest.setting_getbool("creative_mode") then + itemstack:take_item() end return itemstack end - -- Place upside down slab - param2 = 20 - end + -- Placing a slab on an upside down slab should make it right-side up. + if p2 >= 20 and dir == 8 then + p2 = p2 - 20 + -- same for the opposite case: slab below normal slab + elseif p2 <= 3 and dir == 4 then + p2 = p2 + 20 + end - -- If pointing at the side of a upside down slab - if n0_is_upside_down and p0.y + 1 ~= p1.y then - param2 = 20 - end + -- else attempt to place node with proper param2 + minetest.item_place_node(ItemStack(wield_item), placer, pointed_thing, p2) + if not minetest.setting_getbool("creative_mode") then + itemstack:take_item() + end + return itemstack + else + -- place slab using look direction of player + local dir = minetest.dir_to_wallmounted(vector.subtract( + pointed_thing.above, pointed_thing.under), true) - return minetest.item_place(itemstack, placer, pointed_thing, param2) + local rot = slab_trans_dir_place[dir] + if rot == 0 or rot == 20 then + rot = rot + minetest.dir_to_facedir(placer:get_look_dir()) + end + + return minetest.item_place(itemstack, placer, pointed_thing, rot) + end end, }) @@ -218,12 +214,28 @@ function stairs.register_slab(subname, recipeitem, groups, images, description, }) end - minetest.register_craft({ - output = 'stairs:slab_' .. subname .. ' 6', - recipe = { - {recipeitem, recipeitem, recipeitem}, - }, - }) + if recipeitem then + minetest.register_craft({ + output = 'stairs:slab_' .. subname .. ' 6', + recipe = { + {recipeitem, recipeitem, recipeitem}, + }, + }) + + -- Fuel + local baseburntime = minetest.get_craft_result({ + method = "fuel", + width = 1, + items = {recipeitem} + }).time + if baseburntime > 0 then + minetest.register_craft({ + type = "fuel", + recipe = 'stairs:slab_' .. subname, + burntime = math.floor(baseburntime * 0.5), + }) + end + end end @@ -232,6 +244,7 @@ end if replace then minetest.register_abm({ + label = "Slab replace", nodenames = {"group:slabs_replace"}, interval = 16, chance = 1, @@ -252,8 +265,8 @@ 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 @@ -261,158 +274,275 @@ 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"}, - "Wooden Stair", - "Wooden Slab", - default.node_sound_wood_defaults()) +stairs.register_stair_and_slab( + "wood", + "default:wood", + {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + {"default_wood.png"}, + "Wooden Stair", + "Wooden Slab", + default.node_sound_wood_defaults() +) -stairs.register_stair_and_slab("junglewood", "default:junglewood", - {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3}, - {"default_junglewood.png"}, - "Junglewood Stair", - "Junglewood Slab", - default.node_sound_wood_defaults()) +stairs.register_stair_and_slab( + "junglewood", + "default:junglewood", + {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + {"default_junglewood.png"}, + "Jungle Wood Stair", + "Jungle Wood Slab", + default.node_sound_wood_defaults() +) -stairs.register_stair_and_slab("pine_wood", "default:pine_wood", - {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3}, - {"default_pine_wood.png"}, - "Pine Wood Stair", - "Pine Wood Slab", - default.node_sound_wood_defaults()) +stairs.register_stair_and_slab( + "pine_wood", + "default:pine_wood", + {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3}, + {"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", - {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3}, - {"default_acacia_wood.png"}, - "Acacia Wood Stair", - "Acacia Wood Slab", - default.node_sound_wood_defaults()) +stairs.register_stair_and_slab( + "acacia_wood", + "default:acacia_wood", + {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + {"default_acacia_wood.png"}, + "Acacia Wood Stair", + "Acacia Wood Slab", + default.node_sound_wood_defaults() +) -stairs.register_stair_and_slab("aspen_wood", "default:aspen_wood", - {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3}, - {"default_aspen_wood.png"}, - "Aspen Wood Stair", - "Aspen Wood Slab", - default.node_sound_wood_defaults()) +stairs.register_stair_and_slab( + "aspen_wood", + "default:aspen_wood", + {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3}, + {"default_aspen_wood.png"}, + "Aspen Wood Stair", + "Aspen Wood Slab", + default.node_sound_wood_defaults() +) -stairs.register_stair_and_slab("stone", "default:stone", - {cracky = 3}, - {"default_stone.png"}, - "Stone Stair", - "Stone Slab", - default.node_sound_stone_defaults()) +stairs.register_stair_and_slab( + "stone", + "default:stone", + {cracky = 3}, + {"default_stone.png"}, + "Stone Stair", + "Stone Slab", + default.node_sound_stone_defaults() +) -stairs.register_stair_and_slab("cobble", "default:cobble", - {cracky = 3}, - {"default_cobble.png"}, - "Cobblestone Stair", - "Cobblestone Slab", - default.node_sound_stone_defaults()) +stairs.register_stair_and_slab( + "cobble", + "default:cobble", + {cracky = 3}, + {"default_cobble.png"}, + "Cobblestone Stair", + "Cobblestone Slab", + default.node_sound_stone_defaults() +) -stairs.register_stair_and_slab("stonebrick", "default:stonebrick", - {cracky = 3}, - {"default_stone_brick.png"}, - "Stone Brick Stair", - "Stone Brick Slab", - default.node_sound_stone_defaults()) +stairs.register_stair_and_slab( + "mossycobble", + nil, + {cracky = 3}, + {"default_mossycobble.png"}, + "Mossy Cobblestone Stair", + "Mossy Cobblestone Slab", + default.node_sound_stone_defaults() +) -stairs.register_stair_and_slab("desert_stone", "default:desert_stone", - {cracky = 3}, - {"default_desert_stone.png"}, - "Desertstone Stair", - "Desertstone Slab", - default.node_sound_stone_defaults()) +stairs.register_stair_and_slab( + "stonebrick", + "default:stonebrick", + {cracky = 2}, + {"default_stone_brick.png"}, + "Stone Brick Stair", + "Stone Brick Slab", + default.node_sound_stone_defaults() +) -stairs.register_stair_and_slab("desert_cobble", "default:desert_cobble", - {cracky = 3}, - {"default_desert_cobble.png"}, - "Desert Cobblestone Stair", - "Desert Cobblestone Slab", - default.node_sound_stone_defaults()) +stairs.register_stair_and_slab( + "stone_block", + "default:stone_block", + {cracky = 2}, + {"default_stone_block.png"}, + "Stone Block Stair", + "Stone Block Slab", + default.node_sound_stone_defaults() +) -stairs.register_stair_and_slab("desert_stonebrick", "default:desert_stonebrick", - {cracky = 3}, - {"default_desert_stone_brick.png"}, - "Desert Stone Brick Stair", - "Desert Stone Brick Slab", - default.node_sound_stone_defaults()) +stairs.register_stair_and_slab( + "desert_stone", + "default:desert_stone", + {cracky = 3}, + {"default_desert_stone.png"}, + "Desert Stone Stair", + "Desert Stone Slab", + default.node_sound_stone_defaults() +) -stairs.register_stair_and_slab("sandstone", "default:sandstone", - {crumbly = 1, cracky = 3}, - {"default_sandstone.png"}, - "Sandstone Stair", - "Sandstone Slab", - default.node_sound_stone_defaults()) +stairs.register_stair_and_slab( + "desert_cobble", + "default:desert_cobble", + {cracky = 3}, + {"default_desert_cobble.png"}, + "Desert Cobblestone Stair", + "Desert Cobblestone Slab", + default.node_sound_stone_defaults() +) -stairs.register_stair_and_slab("sandstonebrick", "default:sandstonebrick", - {cracky = 2}, - {"default_sandstone_brick.png"}, - "Sandstone Brick Stair", - "Sandstone Brick Slab", - default.node_sound_stone_defaults()) +stairs.register_stair_and_slab( + "desert_stonebrick", + "default:desert_stonebrick", + {cracky = 2}, + {"default_desert_stone_brick.png"}, + "Desert Stone Brick Stair", + "Desert Stone Brick Slab", + default.node_sound_stone_defaults() +) -stairs.register_stair_and_slab("obsidian", "default:obsidian", - {cracky = 1, level = 2}, - {"default_obsidian.png"}, - "Obsidian Stair", - "Obsidian Slab", - default.node_sound_stone_defaults()) +stairs.register_stair_and_slab( + "desert_stone_block", + "default:desert_stone_block", + {cracky = 2}, + {"default_desert_stone_block.png"}, + "Desert Stone Block Stair", + "Desert Stone Block Slab", + default.node_sound_stone_defaults() +) -stairs.register_stair_and_slab("obsidianbrick", "default:obsidianbrick", - {cracky = 1, level = 2}, - {"default_obsidian_brick.png"}, - "Obsidian Brick Stair", - "Obsidian Brick Slab", - default.node_sound_stone_defaults()) +stairs.register_stair_and_slab( + "sandstone", + "default:sandstone", + {crumbly = 1, cracky = 3}, + {"default_sandstone.png"}, + "Sandstone Stair", + "Sandstone 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( + "sandstonebrick", + "default:sandstonebrick", + {cracky = 2}, + {"default_sandstone_brick.png"}, + "Sandstone Brick Stair", + "Sandstone 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( + "sandstone_block", + "default:sandstone_block", + {cracky = 2}, + {"default_sandstone_block.png"}, + "Sandstone Block Stair", + "Sandstone Block Slab", + default.node_sound_stone_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( + "obsidian", + "default:obsidian", + {cracky = 1, level = 2}, + {"default_obsidian.png"}, + "Obsidian Stair", + "Obsidian 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( + "obsidianbrick", + "default:obsidianbrick", + {cracky = 1, level = 2}, + {"default_obsidian_brick.png"}, + "Obsidian Brick Stair", + "Obsidian Brick 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( + "obsidian_block", + "default:obsidian_block", + {cracky = 1, level = 2}, + {"default_obsidian_block.png"}, + "Obsidian Block Stair", + "Obsidian Block 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_metal_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_metal_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_metal_defaults() +) + +stairs.register_stair_and_slab( + "goldblock", + "default:goldblock", + {cracky = 1}, + {"default_gold_block.png"}, + "Gold Block Stair", + "Gold Block Slab", + default.node_sound_metal_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()) -- From BFD: -stairs.register_stair_and_slab("cherry_wood", "default:cherry_plank", - {snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3}, - {"default_wood_cherry_planks.png"}, - "Cherry Plank Stair", - "Cherry Plank Slab", - "Cherry Plank Corner Stair", - default.node_sound_wood_defaults()) +stairs.register_stair_and_slab( + "cherry_wood", + "default:cherry_plank", + {snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3}, + {"default_wood_cherry_planks.png"}, + "Cherry Plank Stair", + "Cherry Plank Slab", + "Cherry Plank Corner Stair", + default.node_sound_wood_defaults() +) diff --git a/minetestforfun_game/mods/vessels/README.txt b/minetestforfun_game/mods/vessels/README.txt index d5c3da84..5bb798c8 100755 --- a/minetestforfun_game/mods/vessels/README.txt +++ b/minetestforfun_game/mods/vessels/README.txt @@ -1,45 +1,22 @@ Minetest Game mod: vessels ========================== +See license.txt for license information. -Crafts -------- -Glass bottle (yields 10) +Authors of source code +---------------------- +Originally by Vanessa Ezekowitz (LGPL 2.1) +Modified by Perttu Ahola (LGPL 2.1) +Various Minetest developers and contributors (LGPL 2.1) - G - G - G - G - - G - +Authors of media (textures) +--------------------------- +All not listed below, Vanessa Ezekowitz (CC BY-SA 3.0) -Drinking Glass (yields 14) - - G - G - G - G - G G G - -Heavy Steel Bottle (yields 5) - - S - S - S - S - - S - - -License of source code: ------------------------ -Copyright (C) 2012 Vanessa Ezekowitz -Version 2012-09-02 -Modifications by Perttu Ahola - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation; either version 2.1 of the License, or -(at your option) any later version. - -http://www.gnu.org/licenses/lgpl-2.1.html - -License of media (textures and sounds) --------------------------------------- -WTFPL - -Authors of media files ------------------------ -Unless specifically noted, -Copyright (C) 2012 Vanessa Ezekowitz +The following textures were modified by Thomas-S (CC BY-SA 3.0): + vessels_drinking_glass.png + vessels_drinking_glass_inv.png + vessels_glass_bottle.png + vessels_steel_bottle.png +The following texture was created by Wuzzy (CC BY-SA 3.0): + vessels_shelf_slot.png (based on vessels_glass_bottle.png) diff --git a/minetestforfun_game/mods/vessels/init.lua b/minetestforfun_game/mods/vessels/init.lua index bbd677a3..06dba1f0 100755 --- a/minetestforfun_game/mods/vessels/init.lua +++ b/minetestforfun_game/mods/vessels/init.lua @@ -2,22 +2,36 @@ -- See README.txt for licensing and other information. local vessels_shelf_formspec = - "size[8,7;]".. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "list[context;vessels;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;vessels]".. - "listring[current_player;main]".. - default.get_hotbar_bg(0,2.85) + "size[8,7;]" .. + default.gui_bg .. + default.gui_bg_img .. + default.gui_slots .. + "list[context;vessels;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;vessels]" .. + "listring[current_player;main]" .. + default.get_hotbar_bg(0, 2.85) + +-- Inventory slots overlay +local vx, vy = 0, 0.3 +for i = 1, 16 do + if i == 9 then + vx = 0 + vy = vy + 1 + end + vessels_shelf_formspec = vessels_shelf_formspec .. + "image[" .. vx .. "," .. vy .. ";1,1;vessels_shelf_slot.png]" + vx = vx + 1 +end minetest.register_node("vessels:shelf", { - description = "Vessels shelf", - tiles = {"default_wood.png", "default_wood.png", "default_wood.png^vessels_shelf.png"}, + description = "Vessels Shelf", + tiles = {"default_wood.png", "default_wood.png", "default_wood.png", + "default_wood.png", "vessels_shelf.png", "vessels_shelf.png"}, + paramtype2 = "facedir", 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) @@ -48,14 +62,21 @@ minetest.register_node("vessels:shelf", { minetest.log("action", player:get_player_name() .. " takes stuff from vessels shelf at ".. minetest.pos_to_string(pos)) end, + on_blast = function(pos) + local drops = {} + default.get_inventory_drops(pos, "vessels", drops) + drops[#drops + 1] = "vessels:shelf" + minetest.remove_node(pos) + return drops + end, }) minetest.register_craft({ - output = 'vessels:shelf', + output = "vessels:shelf", recipe = { - {'group:wood', 'group:wood', 'group:wood'}, - {'group:vessel', 'group:vessel', 'group:vessel'}, - {'group:wood', 'group:wood', 'group:wood'}, + {"group:wood", "group:wood", "group:wood"}, + {"group:vessel", "group:vessel", "group:vessel"}, + {"group:wood", "group:wood", "group:wood"}, } }) @@ -63,25 +84,25 @@ minetest.register_node("vessels:glass_bottle", { description = "Glass Bottle (empty)", drawtype = "plantlike", tiles = {"vessels_glass_bottle.png"}, - inventory_image = "vessels_glass_bottle_inv.png", + inventory_image = "vessels_glass_bottle.png", wield_image = "vessels_glass_bottle.png", paramtype = "light", is_ground_content = false, walkable = false, selection_box = { type = "fixed", - fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25} }, - groups = {vessel=1,dig_immediate=3,attached_node=1}, + groups = {vessel = 1, dig_immediate = 3, attached_node = 1}, sounds = default.node_sound_glass_defaults(), }) minetest.register_craft( { output = "vessels:glass_bottle 10", recipe = { - { "default:glass", "", "default:glass" }, - { "default:glass", "", "default:glass" }, - { "", "default:glass", "" } + {"default:glass", "", "default:glass"}, + {"default:glass", "", "default:glass"}, + {"", "default:glass", ""} } }) @@ -96,18 +117,18 @@ minetest.register_node("vessels:drinking_glass", { walkable = false, selection_box = { type = "fixed", - fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25} }, - groups = {vessel=1,dig_immediate=3,attached_node=1}, + groups = {vessel = 1, dig_immediate = 3, attached_node = 1}, sounds = default.node_sound_glass_defaults(), }) minetest.register_craft( { output = "vessels:drinking_glass 14", 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", "default:glass", "default:glass"} } }) @@ -115,30 +136,30 @@ minetest.register_node("vessels:steel_bottle", { description = "Heavy Steel Bottle (empty)", drawtype = "plantlike", tiles = {"vessels_steel_bottle.png"}, - inventory_image = "vessels_steel_bottle_inv.png", + inventory_image = "vessels_steel_bottle.png", wield_image = "vessels_steel_bottle.png", paramtype = "light", is_ground_content = false, walkable = false, selection_box = { type = "fixed", - fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25} }, - groups = {vessel=1,dig_immediate=3,attached_node=1}, + groups = {vessel = 1, dig_immediate = 3, attached_node = 1}, sounds = default.node_sound_defaults(), }) minetest.register_craft( { output = "vessels:steel_bottle 5", 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", ""} } }) --- Make sure we can recycle them +-- Glass and steel recycling minetest.register_craftitem("vessels:glass_fragments", { description = "Pile of Glass Fragments", diff --git a/minetestforfun_game/mods/vessels/license.txt b/minetestforfun_game/mods/vessels/license.txt new file mode 100644 index 00000000..de16a3b0 --- /dev/null +++ b/minetestforfun_game/mods/vessels/license.txt @@ -0,0 +1,52 @@ +License of source code +---------------------- + +GNU Lesser General Public License, version 2.1 +Copyright (C) 2012-2016 Vanessa Ezekowitz +Copyright (C) 2012-2016 celeron55, Perttu Ahola +Copyright (C) 2012-2016 Various Minetest developers and contributors + +This program is free software; you can redistribute it and/or modify it under the terms +of the GNU Lesser General Public License as published by the Free Software Foundation; +either version 2.1 of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; +without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +See the GNU Lesser General Public License for more details: +https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html + + +Licenses of media (textures) +---------------------------- + +Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) +Copyright (C) 2012-2016 Vanessa Ezekowitz +Copyright (C) 2016 Thomas-S + +You are free to: +Share — copy and redistribute the material in any medium or format. +Adapt — remix, transform, and build upon the material for any purpose, even commercially. +The licensor cannot revoke these freedoms as long as you follow the license terms. + +Under the following terms: + +Attribution — You must give appropriate credit, provide a link to the license, and +indicate if changes were made. You may do so in any reasonable manner, but not in any way +that suggests the licensor endorses you or your use. + +ShareAlike — If you remix, transform, or build upon the material, you must distribute +your contributions under the same license as the original. + +No additional restrictions — You may not apply legal terms or technological measures that +legally restrict others from doing anything the license permits. + +Notices: + +You do not have to comply with the license for elements of the material in the public +domain or where your use is permitted by an applicable exception or limitation. +No warranties are given. The license may not give you all of the permissions necessary +for your intended use. For example, other rights such as publicity, privacy, or moral +rights may limit how you use the material. + +For more details: +http://creativecommons.org/licenses/by-sa/3.0/ diff --git a/minetestforfun_game/mods/vessels/textures/vessels_shelf_slot.png b/minetestforfun_game/mods/vessels/textures/vessels_shelf_slot.png new file mode 100644 index 00000000..ff29082a Binary files /dev/null and b/minetestforfun_game/mods/vessels/textures/vessels_shelf_slot.png differ diff --git a/minetestforfun_game/mods/walls/README.txt b/minetestforfun_game/mods/walls/README.txt new file mode 100644 index 00000000..0389174d --- /dev/null +++ b/minetestforfun_game/mods/walls/README.txt @@ -0,0 +1,7 @@ +Minetest Game mod: walls +======================== +See license.txt for license information. + +Authors of source code +---------------------- +Auke Kok (LGPL 2.1) diff --git a/minetestforfun_game/mods/walls/init.lua b/minetestforfun_game/mods/walls/init.lua index 0b51bdb0..bee8e465 100644 --- a/minetestforfun_game/mods/walls/init.lua +++ b/minetestforfun_game/mods/walls/init.lua @@ -1,18 +1,3 @@ - ---[[ - -Walls mod for Minetest - -Copyright (C) 2015 Auke Kok - -This program is free software. It comes without any warranty, to -the extent permitted by applicable law. You can redistribute it -and/or modify it under the terms of the Do What The Fuck You Want -To Public License, Version 2, as published by Sam Hocevar. See -http://sam.zoy.org/wtfpl/COPYING for more details. - ---]] - walls = {} walls.register = function(wall_name, wall_desc, wall_texture, wall_mat, wall_sounds) diff --git a/minetestforfun_game/mods/walls/license.txt b/minetestforfun_game/mods/walls/license.txt new file mode 100644 index 00000000..ccfaf1cd --- /dev/null +++ b/minetestforfun_game/mods/walls/license.txt @@ -0,0 +1,14 @@ +License of source code +---------------------- + +GNU Lesser General Public License, version 2.1 +Copyright (C) 2015 Auke Kok + +This program is free software; you can redistribute it and/or modify it under the terms +of the GNU Lesser General Public License as published by the Free Software Foundation; +either version 2.1 of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; +without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +See the GNU Lesser General Public License for more details: +https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html diff --git a/minetestforfun_game/mods/wool/README.txt b/minetestforfun_game/mods/wool/README.txt index f57b6dd3..a66677dd 100755 --- a/minetestforfun_game/mods/wool/README.txt +++ b/minetestforfun_game/mods/wool/README.txt @@ -1,28 +1,16 @@ Minetest Game mod: wool ======================= +See license.txt for license information. -Mostly backward-compatible with jordach's 16-color wool mod. - -License of source code: ------------------------ -Copyright (C) 2012 Perttu Ahola (celeron55) - -This program is free software. It comes without any warranty, to -the extent permitted by applicable law. You can redistribute it -and/or modify it under the terms of the Do What The Fuck You Want -To Public License, Version 2, as published by Sam Hocevar. See -http://sam.zoy.org/wtfpl/COPYING for more details. - -License of media (textures and sounds) --------------------------------------- -Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) -http://creativecommons.org/licenses/by-sa/3.0/ - -Authors of media files ------------------------ -Cisoun: -- wool_black.png wool_brown.png wool_dark_green.png wool_green.png -- wool_magenta.png wool_pink.png wool_violet.png wool_yellow.png wool_blue.png -- wool_cyan.png wool_dark_grey.png wool_grey.png wool_orange.png wool_red.png -- wool_white.png +Authors of source code +---------------------- +Originally by Perttu Ahola (celeron55) (MIT) +Various Minetest developers and contributors (MIT) +Authors of media (textures) +--------------------------- +Cisoun (CC BY-SA 3.0): + wool_black.png wool_brown.png wool_dark_green.png wool_green.png + wool_magenta.png wool_pink.png wool_violet.png wool_yellow.png + wool_blue.png wool_cyan.png wool_dark_grey.png wool_grey.png + wool_orange.png wool_red.png wool_white.png diff --git a/minetestforfun_game/mods/wool/init.lua b/minetestforfun_game/mods/wool/init.lua index f485e4fb..b2f7ea78 100755 --- a/minetestforfun_game/mods/wool/init.lua +++ b/minetestforfun_game/mods/wool/init.lua @@ -1,13 +1,8 @@ --- minetest/wool/init.lua - --- Backwards compatibility with jordach's 16-color wool mod -minetest.register_alias("wool:dark_blue", "wool:blue") -minetest.register_alias("wool:gold", "wool:yellow") - local wool = {} -- This uses a trick: you can first define the recipes using all of the base -- colors, and then some recipes using more specific colors for a few non-base -- colors available. When crafting, the last recipes will be checked first. + wool.dyes = { {"white", "White", "basecolor_white"}, {"grey", "Grey", "basecolor_grey"}, @@ -35,16 +30,23 @@ for _, row in ipairs(wool.dyes) do description = desc.." Wool", tiles = {"wool_"..name..".png"}, is_ground_content = false, - groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3,flammable=3,wool=1}, + groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 3, + flammable = 3, wool = 1}, sounds = default.node_sound_defaults(), }) if craft_color_group then -- Crafting from dye and white wool minetest.register_craft({ type = "shapeless", - output = 'wool:'..name, - recipe = {'group:dye,'..craft_color_group, 'group:wool'}, + output = "wool:" .. name, + recipe = {"group:dye," .. craft_color_group, "group:wool"}, }) end end + +-- legacy + +-- Backwards compatibility with jordach's 16-color wool mod +minetest.register_alias("wool:dark_blue", "wool:blue") +minetest.register_alias("wool:gold", "wool:yellow") diff --git a/minetestforfun_game/mods/wool/license.txt b/minetestforfun_game/mods/wool/license.txt new file mode 100644 index 00000000..93101636 --- /dev/null +++ b/minetestforfun_game/mods/wool/license.txt @@ -0,0 +1,60 @@ +License of source code +---------------------- + +The MIT License (MIT) +Copyright (C) 2012-2016 Perttu Ahola (celeron55) +Copyright (C) 2012-2016 Various Minetest developers and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of this +software and associated documentation files (the "Software"), to deal in the Software +without restriction, including without limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +For more details: +https://opensource.org/licenses/MIT + + +Licenses of media (textures) +---------------------------- + +Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) +Copyright (C) 2012-2016 Cisoun + +You are free to: +Share — copy and redistribute the material in any medium or format. +Adapt — remix, transform, and build upon the material for any purpose, even commercially. +The licensor cannot revoke these freedoms as long as you follow the license terms. + +Under the following terms: + +Attribution — You must give appropriate credit, provide a link to the license, and +indicate if changes were made. You may do so in any reasonable manner, but not in any way +that suggests the licensor endorses you or your use. + +ShareAlike — If you remix, transform, or build upon the material, you must distribute +your contributions under the same license as the original. + +No additional restrictions — You may not apply legal terms or technological measures that +legally restrict others from doing anything the license permits. + +Notices: + +You do not have to comply with the license for elements of the material in the public +domain or where your use is permitted by an applicable exception or limitation. +No warranties are given. The license may not give you all of the permissions necessary +for your intended use. For example, other rights such as publicity, privacy, or moral +rights may limit how you use the material. + +For more details: +http://creativecommons.org/licenses/by-sa/3.0/ diff --git a/minetestforfun_game/mods/xpanes/README.txt b/minetestforfun_game/mods/xpanes/README.txt index b89e74a2..bcbc1294 100755 --- a/minetestforfun_game/mods/xpanes/README.txt +++ b/minetestforfun_game/mods/xpanes/README.txt @@ -1,16 +1,21 @@ Minetest Game mod: xpanes ========================= +See license.txt for license information. -License: --------- -Copyright (C) xyz -modified by BlockMen (iron bars) +Authors of source code +---------------------- +Originally by xyz (MIT) +BlockMen (MIT) +sofar (MIT) +Various Minetest developers and contributors (MIT) -Gambit (WTFPL): - xpanes_bar.png +Authors of media (textures) +--------------------------- +xyz (CC BY-SA 3.0): + All textures not mentioned below. -This program is free software. It comes without any warranty, to -the extent permitted by applicable law. You can redistribute it -and/or modify it under the terms of the Do What The Fuck You Want -To Public License, Version 2, as published by Sam Hocevar. See -http://sam.zoy.org/wtfpl/COPYING for more details. +Gambit (CC BY-SA 3.0): + xpanes_bar.png + +paramat (CC BY-SA 3.0): + xpanes_bar_top.png diff --git a/minetestforfun_game/mods/xpanes/init.lua b/minetestforfun_game/mods/xpanes/init.lua index 77c28830..b5299724 100755 --- a/minetestforfun_game/mods/xpanes/init.lua +++ b/minetestforfun_game/mods/xpanes/init.lua @@ -1,156 +1,147 @@ xpanes = {} -local function rshift(x, by) - return math.floor(x / 2 ^ by) +local function is_pane(pos) + return minetest.get_item_group(minetest.get_node(pos).name, "pane") > 0 end -local directions = { - {x = 1, y = 0, z = 0}, - {x = 0, y = 0, z = 1}, - {x = -1, y = 0, z = 0}, - {x = 0, y = 0, z = -1}, -} +local function connects_dir(pos, name, dir) + local aside = vector.add(pos, minetest.facedir_to_dir(dir)) + if is_pane(aside) then + return true + end -local function update_pane(pos, name) - if not minetest.get_node(pos).name:find("^xpanes:"..name) then + local connects_to = minetest.registered_nodes[name].connects_to + if not connects_to then + return false + end + local list = minetest.find_nodes_in_area(aside, aside, connects_to) + + if #list > 0 then + return true + end + + return false +end + +local function swap(pos, node, name, param2) + if node.name == name and node.param2 == param2 then return end - local sum = 0 - for i, dir in pairs(directions) do - 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 - def.drawtype ~= "nodebox") then - sum = sum + 2 ^ (i - 1) + + minetest.set_node(pos, {name = name, param2 = param2}) +end + +local function update_pane(pos) + if not is_pane(pos) then + return + end + local node = minetest.get_node(pos) + local name = node.name + if name:sub(-5) == "_flat" then + name = name:sub(1, -6) + end + + local any = node.param2 + local c = {} + local count = 0 + for dir = 0, 3 do + c[dir] = connects_dir(pos, name, dir) + if c[dir] then + any = dir + count = count + 1 end end - if sum == 0 then - sum = 15 - end - minetest.set_node(pos, {name = "xpanes:"..name.."_"..sum}) -end -local function update_nearby(pos, node) - node = node or minetest.get_node(pos) - local name = node.name - if not name or node.name:sub(1, 7) ~= "xpanes:" then - return - end - local underscore_pos = string.find(name, "_[^_]*$") or 0 - local len = name:len() - local num = tonumber(name:sub(underscore_pos+1, len)) - if not num or num < 1 or num > 15 then - name = name:sub(8) + if count == 0 then + swap(pos, node, name .. "_flat", any) + elseif count == 1 then + swap(pos, node, name .. "_flat", (any + 1) % 4) + elseif count == 2 then + if (c[0] and c[2]) or (c[1] and c[3]) then + swap(pos, node, name .. "_flat", (any + 1) % 4) + else + swap(pos, node, name, 0) + end else - name = name:sub(8, underscore_pos - 1) - end - for i, dir in pairs(directions) do - update_pane(vector.add(pos, dir), name) + swap(pos, node, name, 0) end end -minetest.register_on_placenode(update_nearby) -minetest.register_on_dignode(update_nearby) +minetest.register_on_placenode(function(pos, node) + if minetest.get_item_group(node, "pane") then + update_pane(pos) + end + for i = 0, 3 do + local dir = minetest.facedir_to_dir(i) + update_pane(vector.add(pos, dir)) + end +end) -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}, - {-0.5, -0.5, -1/32, 0, 0.5, 1/32}, - {-1/32, -0.5, -0.5, 1/32, 0.5, 0} -} - -local full_boxes = { - {-0.5, -0.5, -1/32, 0.5, 0.5, 1/32}, - {-1/32, -0.5, -0.5, 1/32, 0.5, 0.5} -} - -local sb_half_boxes = { - {0, -0.5, -0.06, 0.5, 0.5, 0.06}, - {-0.06, -0.5, 0, 0.06, 0.5, 0.5}, - {-0.5, -0.5, -0.06, 0, 0.5, 0.06}, - {-0.06, -0.5, -0.5, 0.06, 0.5, 0} -} - -local sb_full_boxes = { - {-0.5, -0.5, -0.06, 0.5, 0.5, 0.06}, - {-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, -} +minetest.register_on_dignode(function(pos) + for i = 0, 3 do + local dir = minetest.facedir_to_dir(i) + update_pane(vector.add(pos, dir)) + end +end) +xpanes = {} function xpanes.register_pane(name, def) for i = 1, 15 do - local need = {} - local cnt = 0 - for j = 1, 4 do - if rshift(i, j - 1) % 2 == 1 then - need[j] = true - cnt = cnt + 1 - end - end - local take = {} - local take2 = {} - if need[1] == true and need[3] == true then - need[1] = nil - need[3] = nil - table.insert(take, full_boxes[1]) - table.insert(take2, sb_full_boxes[1]) - end - if need[2] == true and need[4] == true then - need[2] = nil - need[4] = nil - table.insert(take, full_boxes[2]) - table.insert(take2, sb_full_boxes[2]) - end - for k in pairs(need) do - table.insert(take, half_boxes[k]) - table.insert(take2, sb_half_boxes[k]) - end - local texture = def.textures[1] - if cnt == 1 then - texture = def.textures[1].."^"..def.textures[2] - end - minetest.register_node(":xpanes:"..name.."_"..i, { - drawtype = "nodebox", - tiles = {def.textures[3], def.textures[3], texture}, - paramtype = "light", - groups = def.groups, - drop = "xpanes:"..name, - sounds = def.sounds, - node_box = { - type = "fixed", - fixed = take - }, - selection_box = { - type = "fixed", - fixed = take2 - } - }) + minetest.register_alias("xpanes:" .. name .. "_" .. i, "xpanes:" .. name .. "_flat") end - for k, v in pairs(pane_def_fields) do - def[k] = def[k] or v - end + local flatgroups = table.copy(def.groups) + flatgroups.pane = 1 + minetest.register_node(":xpanes:" .. name .. "_flat", { + description = def.description, + drawtype = "nodebox", + paramtype = "light", + is_ground_content = false, + sunlight_propagates = true, + inventory_image = def.inventory_image, + wield_image = def.wield_image, + paramtype2 = "facedir", + tiles = {def.textures[3], def.textures[3], def.textures[1]}, + groups = flatgroups, + drop = "xpanes:" .. name .. "_flat", + sounds = def.sounds, + node_box = { + type = "fixed", + fixed = {{-1/2, -1/2, -1/32, 1/2, 1/2, 1/32}}, + }, + selection_box = { + type = "fixed", + fixed = {{-1/2, -1/2, -1/32, 1/2, 1/2, 1/32}}, + }, + connect_sides = { "left", "right" }, + }) - def.on_construct = function(pos) - update_pane(pos, name) - end - - minetest.register_node(":xpanes:"..name, def) + local groups = table.copy(def.groups) + groups.pane = 1 + groups.not_in_creative_inventory = 1 + minetest.register_node(":xpanes:" .. name, { + drawtype = "nodebox", + paramtype = "light", + is_ground_content = false, + sunlight_propagates = true, + description = def.description, + tiles = {def.textures[3], def.textures[3], def.textures[1]}, + groups = groups, + drop = "xpanes:" .. name .. "_flat", + sounds = def.sounds, + node_box = { + type = "connected", + fixed = {{-1/32, -1/2, -1/32, 1/32, 1/2, 1/32}}, + connect_front = {{-1/32, -1/2, -1/2, 1/32, 1/2, -1/32}}, + connect_left = {{-1/2, -1/2, -1/32, -1/32, 1/2, 1/32}}, + connect_back = {{-1/32, -1/2, 1/32, 1/32, 1/2, 1/2}}, + connect_right = {{1/32, -1/2, -1/32, 1/2, 1/2, 1/32}}, + }, + connects_to = {"group:pane", "group:stone", "group:glass", "group:wood", "group:tree"}, + }) minetest.register_craft({ - output = "xpanes:"..name.." 16", + output = "xpanes:" .. name .. "_flat 16", recipe = def.recipe }) end @@ -170,11 +161,11 @@ xpanes.register_pane("pane", { xpanes.register_pane("bar", { description = "Iron bar", - textures = {"xpanes_bar.png","xpanes_bar.png","xpanes_space.png"}, + textures = {"xpanes_bar.png","xpanes_bar.png","xpanes_bar_top.png"}, inventory_image = "xpanes_bar.png", wield_image = "xpanes_bar.png", groups = {cracky=3, pane=1}, -- //MFF - sounds = default.node_sound_stone_defaults(), + sounds = default.node_sound_metal_defaults(), recipe = { {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}, {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"} diff --git a/minetestforfun_game/mods/xpanes/license.txt b/minetestforfun_game/mods/xpanes/license.txt new file mode 100644 index 00000000..dff72274 --- /dev/null +++ b/minetestforfun_game/mods/xpanes/license.txt @@ -0,0 +1,64 @@ +License of source code +---------------------- + +The MIT License (MIT) +Copyright (C) 2014-2016 xyz +Copyright (C) 2014-2016 BlockMen +Copyright (C) 2016 Auke Kok +Copyright (C) 2014-2016 Various Minetest developers and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of this +software and associated documentation files (the "Software"), to deal in the Software +without restriction, including without limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +For more details: +https://opensource.org/licenses/MIT + + +Licenses of media (textures) +---------------------------- + +Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) +Copyright (C) 2014-2016 xyz +Copyright (C) 2013-2016 Gambit +Copyright (C) 2016 paramat + +You are free to: +Share — copy and redistribute the material in any medium or format. +Adapt — remix, transform, and build upon the material for any purpose, even commercially. +The licensor cannot revoke these freedoms as long as you follow the license terms. + +Under the following terms: + +Attribution — You must give appropriate credit, provide a link to the license, and +indicate if changes were made. You may do so in any reasonable manner, but not in any way +that suggests the licensor endorses you or your use. + +ShareAlike — If you remix, transform, or build upon the material, you must distribute +your contributions under the same license as the original. + +No additional restrictions — You may not apply legal terms or technological measures that +legally restrict others from doing anything the license permits. + +Notices: + +You do not have to comply with the license for elements of the material in the public +domain or where your use is permitted by an applicable exception or limitation. +No warranties are given. The license may not give you all of the permissions necessary +for your intended use. For example, other rights such as publicity, privacy, or moral +rights may limit how you use the material. + +For more details: +http://creativecommons.org/licenses/by-sa/3.0/ diff --git a/minetestforfun_game/mods/xpanes/textures/xpanes_bar_top.png b/minetestforfun_game/mods/xpanes/textures/xpanes_bar_top.png new file mode 100644 index 00000000..5cd3d572 Binary files /dev/null and b/minetestforfun_game/mods/xpanes/textures/xpanes_bar_top.png differ diff --git a/minetestforfun_game/settingtypes.txt b/minetestforfun_game/settingtypes.txt new file mode 100644 index 00000000..2f91a7b6 --- /dev/null +++ b/minetestforfun_game/settingtypes.txt @@ -0,0 +1,42 @@ +# This file contains settings of minetest_game that can be changed in +# minetest.conf + +# In creative mode players are able to dig all kind of blocks nearly +# instantly, and have access to unlimited resources. +# Some of the functionality is only available if this setting is present +# at startup. +creative_mode (Creative mode) bool false + +# Flammable nodes will be ignited by nearby igniters. Spreading fire may +# cause severe destruction. +# Spreading fire nodes will disappear when fire is disabled, but +# 'permanent_flame' nodes are unaffected. +enable_fire (Fire) bool true + +# If enabled, steel tools, torches and cobblestone will be given to new +# players. +give_initial_stuff (Give initial items) bool false + +# If enabled, players respawn at the bed they last lay on instead of normal +# spawn. +# This setting is only read at startup. +enable_bed_respawn (Respawn at bed) bool true + +# If enabled, the night can be skipped if more than half of the players are +# in beds. +enable_bed_night_skip (Skip night when sleeping) bool true + +# When TNT explodes, it destroys nearby nodes and damages nearby players. +# This setting is disabled by default on servers. +enable_tnt (TNT) bool true + +# The radius in which nodes will be destroyed by a TNT explosion. +tnt_radius (TNT radius) int 3 0 + +# The time in seconds after which the bones of a dead player can be looted +# by everyone. +# Setting this to 0 will disable sharing of bones completely. +share_bones_time (Bone share time) int 1200 0 + +# Replaces old stairs with new ones. Only required for older worlds. +enable_stairs_replace_abm (Replace old stairs) bool false diff --git a/mods/maptools/depends.txt b/mods/maptools/depends.txt index 4ad96d51..70715c7b 100755 --- a/mods/maptools/depends.txt +++ b/mods/maptools/depends.txt @@ -1 +1,2 @@ default +fire