From d412c25a61c06bd31086a59fc14154fedb2d46ae Mon Sep 17 00:00:00 2001 From: root Date: Mon, 5 Apr 2021 14:46:21 +0200 Subject: [PATCH] update --- mods/advtrains/advtrains/misc_nodes.lua | 8 +- .../advtrains_interlocking/demosignals.lua | 3 - mods/advtrains/advtrains_signals_ks/init.lua | 4 - mods/advtrains/serialize_lib/api.md | 120 ++++ mods/advtrains/serialize_lib/atomic.lua | 12 +- mods/advtrains/serialize_lib/init.lua | 4 +- mods/advtrains/serialize_lib/license.txt | 662 ++++++++++++++++++ mods/advtrains/serialize_lib/readme.md | 43 +- mods/advtrains/serialize_lib/serialize.lua | 21 +- mods/biome_lib/API.txt | 40 ++ mods/biome_lib/README.md | 2 +- mods/biome_lib/growth.lua | 6 +- mods/biome_lib/init.lua | 105 ++- mods/biome_lib/mod.conf | 3 +- mods/biome_lib/search_functions.lua | 6 +- mods/bonemeal/init.lua | 15 +- mods/castle/autocraft.lua | 14 +- mods/castle/pillars.lua | 2 +- mods/castle/textures/castle_street_light.png | Bin 0 -> 465 bytes mods/castle/town_item.lua | 23 +- mods/farming/compatibility.lua | 16 +- mods/farming/crops/garlic.lua | 1 + mods/farming/crops/soy.lua | 32 + ...anana_leaf.png => farming_banana_leaf.png} | Bin ...a_single.png => farming_banana_single.png} | Bin mods/farming/textures/farming_soy_sauce.png | Bin 0 -> 166 bytes ...{strawberry.png => farming_strawberry.png} | Bin mods/mobs_animal/kitten.lua | 3 +- mods/mobs_monster/lava_flan.lua | 2 + mods/mobs_monster/sand_monster.lua | 1 + mods/mobs_redo/api.lua | 129 ++-- mods/mobs_redo/api.txt | 5 +- mods/mobs_redo/crafts.lua | 16 + mods/mobs_redo/textures/mobs_protector2.png | Bin 0 -> 164 bytes mods/protector/doors_chest.lua | 7 +- mods/protector/init.lua | 9 +- mods/skinsdb/meta/character_2023.txt | 3 + mods/skinsdb/textures/character_2023.png | Bin 0 -> 4995 bytes mods/stairs/stairs.lua | 11 + mods/stamina/init.lua | 11 +- 40 files changed, 1205 insertions(+), 134 deletions(-) create mode 100644 mods/advtrains/serialize_lib/api.md create mode 100644 mods/advtrains/serialize_lib/license.txt create mode 100644 mods/castle/textures/castle_street_light.png rename mods/farming/textures/{banana_leaf.png => farming_banana_leaf.png} (100%) rename mods/farming/textures/{banana_single.png => farming_banana_single.png} (100%) create mode 100644 mods/farming/textures/farming_soy_sauce.png rename mods/farming/textures/{strawberry.png => farming_strawberry.png} (100%) create mode 100644 mods/mobs_redo/textures/mobs_protector2.png create mode 100644 mods/skinsdb/meta/character_2023.txt create mode 100644 mods/skinsdb/textures/character_2023.png diff --git a/mods/advtrains/advtrains/misc_nodes.lua b/mods/advtrains/advtrains/misc_nodes.lua index fe484ac9..bcf73294 100644 --- a/mods/advtrains/advtrains/misc_nodes.lua +++ b/mods/advtrains/advtrains/misc_nodes.lua @@ -16,7 +16,7 @@ function advtrains.register_platform(modprefix, preset) description = attrans("@1 Platform (low)", desc), tiles = {btex.."^advtrains_platform.png", btex, btex, btex, btex, btex}, groups = {cracky = 1, not_blocking_trains = 1, platform=1}, - sounds = default.node_sound_stone_defaults(), + sounds = ndef.sounds, drawtype = "nodebox", node_box = { type = "fixed", @@ -33,7 +33,7 @@ function advtrains.register_platform(modprefix, preset) description = attrans("@1 Platform (high)", desc), tiles = {btex.."^advtrains_platform.png", btex, btex, btex, btex, btex}, groups = {cracky = 1, not_blocking_trains = 1, platform=2}, - sounds = default.node_sound_stone_defaults(), + sounds = ndef.sounds, drawtype = "nodebox", node_box = { type = "fixed", @@ -58,7 +58,7 @@ function advtrains.register_platform(modprefix, preset) minetest.register_node(modprefix..":platform_45_"..nodename, { description = attrans("@1 Platform (45 degree)", desc), groups = {cracky = 1, not_blocking_trains = 1, platform=2}, - sounds = default.node_sound_stone_defaults(), + sounds = ndef.sounds, drawtype = "mesh", mesh = "advtrains_platform_diag.b3d", selection_box = diagonalbox, @@ -80,7 +80,7 @@ function advtrains.register_platform(modprefix, preset) minetest.register_node(modprefix..":platform_45_low_"..nodename, { description = attrans("@1 Platform (low, 45 degree)", desc), groups = {cracky = 1, not_blocking_trains = 1, platform=2}, - sounds = default.node_sound_stone_defaults(), + sounds = ndef.sounds, drawtype = "mesh", mesh = "advtrains_platform_diag_low.b3d", selection_box = diagonalbox_low, diff --git a/mods/advtrains/advtrains_interlocking/demosignals.lua b/mods/advtrains/advtrains_interlocking/demosignals.lua index cba1f301..1c1b8b2b 100644 --- a/mods/advtrains/advtrains_interlocking/demosignals.lua +++ b/mods/advtrains/advtrains_interlocking/demosignals.lua @@ -41,7 +41,6 @@ minetest.register_node("advtrains_interlocking:ds_danger", { advtrains_signal = 2, save_in_at_nodedb = 1, }, - sounds = default.node_sound_stone_defaults(), advtrains = { set_aspect = setaspect, supported_aspects = suppasp, @@ -61,7 +60,6 @@ minetest.register_node("advtrains_interlocking:ds_free", { advtrains_signal = 2, save_in_at_nodedb = 1, }, - sounds = default.node_sound_stone_defaults(), advtrains = { set_aspect = setaspect, supported_aspects = suppasp, @@ -83,7 +81,6 @@ minetest.register_node("advtrains_interlocking:ds_slow", { advtrains_signal = 2, save_in_at_nodedb = 1, }, - sounds = default.node_sound_stone_defaults(), advtrains = { set_aspect = setaspect, supported_aspects = suppasp, diff --git a/mods/advtrains/advtrains_signals_ks/init.lua b/mods/advtrains/advtrains_signals_ks/init.lua index 3209cb12..b05506ec 100755 --- a/mods/advtrains/advtrains_signals_ks/init.lua +++ b/mods/advtrains/advtrains_signals_ks/init.lua @@ -105,7 +105,6 @@ for _, rtab in ipairs({ }, drop = "advtrains_signals_ks:hs_danger_0", inventory_image = "advtrains_signals_ks_hs_inv.png", - sounds = default.node_sound_stone_defaults(), advtrains = { set_aspect = setaspectf(rot), supported_aspects = suppasp, @@ -151,7 +150,6 @@ for _, rtab in ipairs({ }, drop = "advtrains_signals_ks:ra_danger_0", inventory_image = "advtrains_signals_ks_ra_inv.png", - sounds = default.node_sound_stone_defaults(), advtrains = { set_aspect = setaspectf_ra(rot), supported_aspects = suppasp_ra, @@ -203,7 +201,6 @@ for _, rtab in ipairs({ }, drop = "advtrains_signals_ks:sign_8_0", inventory_image = "advtrains_signals_ks_sign_8.png", - sounds = default.node_sound_stone_defaults(), advtrains = { -- This is a static signal! No set_aspect get_aspect = function(pos, node) @@ -239,7 +236,6 @@ for _, rtab in ipairs({ not_in_creative_inventory = (rtab.ici) and 0 or 1, }, drop = "advtrains_signals_ks:mast_mast_0", - sounds = default.node_sound_stone_defaults(), }) advtrains.trackplacer.add_worked("advtrains_signals_ks:mast","mast", "_"..rot) end diff --git a/mods/advtrains/serialize_lib/api.md b/mods/advtrains/serialize_lib/api.md new file mode 100644 index 00000000..c4ccd773 --- /dev/null +++ b/mods/advtrains/serialize_lib/api.md @@ -0,0 +1,120 @@ +# serialize_lib API + +## Serialization Library (serialize.lua) + +### config table + +Serialization functions accept a config table. Currently only one configuration option is defined. + + config = { + skip_empty_tables = false + -- used for write_to_fd/write_to_file + -- if true, does not store empty tables + -- On next read, keys that mapped to empty tables resolve to nil + } + +If you want to use all-default config options, you can pass `nil` as the config parameter. + +### Serialization limits + + * Only strings, booleans, numbers and tables can be serialized, no functions or userdata + * serialize_lib requires that no reference loops are present in the table to be serialized. Currently, when passing a table that has a reference loop, serialize_lib will produce a stack overflow. + +### Functions + +All of these functions call `error()` if an error occurs. Errors can be caught with `pcall()`. + +#### write_to_fd(root_table, file, config) +Writes the contents of `root_table` to the file from the file handle given by `file`, and closes the file descriptor afterwards. + +#### write_to_file(root_table, filename, config) +First, opens `filename` for write. Then, writes the contents of `root_table` to the file. + +#### read_from_fd(file) +Reads the file from the file handle given by `file`, and closes the file descriptor afterwards. Returns the deserialized table. + +#### read_from_file(filename) +First, opens `filename` for read. Then, reads the file and returns the deserialized table. + +### External Lua Module +serialize.lua can be loaded as a standard Lua module even outside Minetest, like this: + + local serialize = require("serialize") + +## General API + +### Minetest wrappers for serialization functions + +Serialize_lib wraps write_to_file and read_from_file into 2 functions that do not throw errors but instead log the fact to the server log and have an appropriate return value: + +#### serialize_lib.write_table_to_file(root_table, filename) + +Serializes `root_table` into `filename`. On success, returns true. On failure, logs the error, then returns false and the error message. + +#### serialize_lib.read_table_from_file(filename) + +Deserializes the given file. On success, returns the deserialized table. On failure, logs the error, then returns false and the error message. + +## Atomic API + +serialize_lib provides functions for atomic saving. This means that if the process is interrupted during writing the save file, it is ensured that no save data gets corrupted and that instead the old state is read. + +The atomic system is flexible, and can be used not only to save serialized Lua tables but arbitrary file formats by means of a callback function. This callback function gets passed a file descriptor to operate on. + +### Concept +The plain scheme just overwrites the file in place. This however poses problems when we are interrupted right within the write, so we have incomplete data. So, the following scheme is applied: + +Unix: + + 1. writes to `filename.new` + 2. moves `filename.new` to `filename`, clobbering previous file + +Windows: + + 1. writes to `filename.new` + 2. delete `filename` + 3. moves `filename.new` to `filename` + +We count a new version of the state as "committed" after stage 2. + +During loading, we apply the following order of precedence: + + 1. `filename` + 2. `filename.new` (windows only, in case we were interrupted just before 3. when saving) + +### Functions + +All of these functions return either true on success or nil, error on error. + +#### serialize_lib.load_atomic(filename, callback) + +Load a saved state. + +If 'callback' is nil: reads serialized table. Returns the read table, or nil,err on error. + +If 'callback' is a function (signature `func(file_handle)` ): Counterpart to save_atomic with function argument. Opens the file and calls callback on it. If the callback function throws an error, and strict loading is enabled, that error is propagated. The callback's first return value is returned by load_atomic. + +#### serialize_lib.save_atomic(data, filename, callback, config) + +Save a file atomically. + +'data' is the data to be saved (when a callback is used, this can be nil) + +If 'callback' is nil: 'data' must be a table, and is serialized into the file + +If 'callback' is a function (signature `func(data, file_handle)` ): Opens the file and calls callback on it. The 'data' argument is the data passed to save_atomic(). If the callback function throws an error, and strict loading is enabled, that error is propagated. The callback's first return value is returned by load_atomic(). + +Important: the callback must close the file in all cases! + +#### serialize_lib.save_atomic_multiple(parts_table, filename_prefix, callbacks_table, config) + +Saves multiple files synchronously. First writes all data to all `filename`.new files, then moves all files in quick succession to avoid inconsistent backups. parts_table is a table where the keys are used as part of the filename and the values are the respective data written to it. + + * Example: if `parts_table={foo={...}, bar={...}}`, then `filename_prefix`foo and `filename_prefix`bar are written out. + +If 'callbacks_table' is defined, it is consulted for callbacks the same way save_atomic does. + + * Example: if `callbacks_table = {foo = func()...}`, then the callback is used during writing of file 'foo' (but not for 'bar') + * Note however that you must at least insert a "true" in the parts_table if you don't use the data argument. + +Important: the callback must close the file in all cases! diff --git a/mods/advtrains/serialize_lib/atomic.lua b/mods/advtrains/serialize_lib/atomic.lua index 182cf426..4a48c274 100644 --- a/mods/advtrains/serialize_lib/atomic.lua +++ b/mods/advtrains/serialize_lib/atomic.lua @@ -65,7 +65,7 @@ local function save_atomic_move_file(filename) end local function open_file_and_save_callback(callback, filename) - local file, err = io.open(filename, "w") + local file, err = io.open(filename, "wb") if not file then error("Failed opening file '"..filename.."' for write:\n"..err) end @@ -75,7 +75,7 @@ local function open_file_and_save_callback(callback, filename) end local function open_file_and_load_callback(filename, callback) - local file, err = io.open(filename, "r") + local file, err = io.open(filename, "rb") if not file then error("Failed opening file '"..filename.."' for read:\n"..err) end @@ -97,7 +97,7 @@ function serialize_lib.load_atomic(filename, callback) local cbfunc = callback or ser.read_from_fd -- try - local file, ret = io.open(filename, "r") + local file, ret = io.open(filename, "rb") if file then -- read the file using the callback local success @@ -117,7 +117,7 @@ function serialize_lib.load_atomic(filename, callback) serialize_lib.log_warn(ret) -- try .new - file, ret = io.open(filename..".new", "r") + file, ret = io.open(filename..".new", "rb") if file then -- read the file using the callback local success @@ -151,7 +151,7 @@ function serialize_lib.save_atomic(data, filename, callback, config) local cbfunc = callback or ser.write_to_fd - local file, ret = io.open(filename..".new", "w") + local file, ret = io.open(filename..".new", "wb") if file then -- save the file using the callback local success @@ -189,7 +189,7 @@ function serialize_lib.save_atomic_multiple(parts_table, filename_prefix, callba end local success = false - local file, ret = io.open(filename..".new", "w") + local file, ret = io.open(filename..".new", "wb") if file then -- save the file using the callback success, ret = pcall(cbfunc, data, file, config) diff --git a/mods/advtrains/serialize_lib/init.lua b/mods/advtrains/serialize_lib/init.lua index 20ffa4d6..afc68843 100644 --- a/mods/advtrains/serialize_lib/init.lua +++ b/mods/advtrains/serialize_lib/init.lua @@ -57,6 +57,7 @@ function serialize_lib.read_table_from_file(filename) local succ, ret = pcall(ser.read_from_file, filename) if not succ then serialize_lib.log_error(ret) + return false,ret end return ret end @@ -67,8 +68,9 @@ function serialize_lib.write_table_to_file(root_table, filename) local succ, ret = pcall(ser.write_to_file, root_table, filename) if not succ then serialize_lib.log_error(ret) + return false,ret end - return ret + return true end diff --git a/mods/advtrains/serialize_lib/license.txt b/mods/advtrains/serialize_lib/license.txt new file mode 100644 index 00000000..f36a7b77 --- /dev/null +++ b/mods/advtrains/serialize_lib/license.txt @@ -0,0 +1,662 @@ + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + + Copyright (C) {{ year }} {{ organization }} + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 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 Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +. diff --git a/mods/advtrains/serialize_lib/readme.md b/mods/advtrains/serialize_lib/readme.md index ac364b8e..1a14187f 100644 --- a/mods/advtrains/serialize_lib/readme.md +++ b/mods/advtrains/serialize_lib/readme.md @@ -4,4 +4,45 @@ Created out of the need to have a robust data store for advtrains. The main purpose is to load and store large Lua table structures into files, without loading everything in memory and exhausting the function constant limit of LuaJIT. -Also contains various utilities to handle files on disk in a safe manner, retain multiple versions of the same file a.s.o. \ No newline at end of file +Also contains various utilities to handle files on disk in a safe manner, retain multiple versions of the same file a.s.o. + +## API documentation + +For API documentation, see `api.md`. + +## Configuration + +serialize_lib includes two configuration options: + +### serialize_lib_strict_loading (Strict loading) + * Type: boolean + * Default: false + +Enable strict file loading mode + +If enabled, if any error occurs during loading of a file using the 'atomic' API, an error is thrown. You probably need to disable this option for initial loading after creating the world. + +### serialize_lib_no_auto_windows_mode (No automatic Windows Mode) + * Type: boolean + * Default: false + +Do not automatically switch to "Windows mode" when saving atomically + +Normally, when renaming filename.new to filename fails, serialize_lib automatically switches to a mode where it deletes filename prior to moving. Enable this option to prevent this behavior and abort saving instead. + +## License +serialize_lib +Copyright (C) 2020-2021 orwell96 + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 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 Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . \ No newline at end of file diff --git a/mods/advtrains/serialize_lib/serialize.lua b/mods/advtrains/serialize_lib/serialize.lua index 12a26c4d..4b1ebb79 100644 --- a/mods/advtrains/serialize_lib/serialize.lua +++ b/mods/advtrains/serialize_lib/serialize.lua @@ -3,6 +3,9 @@ -- Contains the serialization and deserialization routines --[[ +Version history: +1 - initial +2 - also escaping CR character as &r Structure of entry: [keytype][key]:[valuetype][val] @@ -19,7 +22,7 @@ Table: E example: -LUA_SER v=1 { +LUA_SER v=2 { Skey:Svalue key = "value", N1:Seins [1] = "eins", B1:T [true] = { @@ -32,7 +35,7 @@ String representations: In strings the following characters are escaped by & '&' -> '&&' (line break) -> '&n' -(CR) -> '&r' --> required? +(CR) -> '&r' ':' -> '&:' All other characters are unchanged as they bear no special meaning. ]] @@ -97,6 +100,7 @@ end function escape_chars(str) local rstr = string.gsub(str, "&", "&&") rstr = string.gsub(rstr, ":", "&:") + rstr = string.gsub(rstr, "\r", "&r") rstr = string.gsub(rstr, "\n", "&n") return rstr end @@ -172,6 +176,7 @@ end function unescape_chars(str) --TODO local rstr = string.gsub(str, "&:", ":") rstr = string.gsub(rstr, "&n", "\n") + rstr = string.gsub(rstr, "&r", "\r") rstr = string.gsub(rstr, "&&", "&") return rstr end @@ -187,7 +192,7 @@ config = { -- Writes the passed table into the passed file descriptor, and closes the file local function write_to_fd(root_table, file, config) - file:write("LUA_SER v=1\n") + file:write("LUA_SER v=2\n") write_table(root_table, file, config) file:write("E\nEND_SER\n") file:close() @@ -197,14 +202,14 @@ end -- Throws errors when something is wrong. Closes the file. -- config: see above local function read_from_fd(file) - local first_line = file:read("*l") - if first_line ~= "LUA_SER v=1" then + local first_line = file:read("*line") + if not string.match(first_line, "LUA_SER v=[12]") then file:close() error("Expected header, got '"..first_line.."' instead!") end local t = {} read_table(t, file) - local last_line = file:read("*l") + local last_line = file:read("*line") file:close() if last_line ~= "END_SER" then error("Missing END_SER, got '"..last_line.."' instead!") @@ -216,7 +221,7 @@ end -- config: see above function write_to_file(root_table, filename, config) -- try opening the file - local file, err = io.open(filename, "w") + local file, err = io.open(filename, "wb") if not file then error("Failed opening file '"..filename.."' for write:\n"..err) end @@ -228,7 +233,7 @@ end -- Opens the passed filename, and returns its deserialized contents function read_from_file(filename) -- try opening the file - local file, err = io.open(filename, "r") + local file, err = io.open(filename, "rb") if not file then error("Failed opening file '"..filename.."' for read:\n"..err) end diff --git a/mods/biome_lib/API.txt b/mods/biome_lib/API.txt index 0dd15c35..bacbafce 100644 --- a/mods/biome_lib/API.txt +++ b/mods/biome_lib/API.txt @@ -588,3 +588,43 @@ And this particular one is mapped slightly differently from the others: (Note the +150 and +50 offsets) + +================== +Default game nodes +================== + +Although this project was intended to be used with minetest_game, it can be +configured to work with something else instead. All you need to do is provide +the names of the nodes in your game you want biome_lib's internals to use. + +Put these settings in your game's minetest.conf (or your client's own config, +if desired). You'll need to set all of them. + +biome_lib_default_grow_through_nodes + Comma-separated list of things that a spawned node is allowed to grow + through. Air is always added to whatever you specify. + Default: air, default:snow + +biome_lib_default_water_nodes + Comma-separated list of nodes that should be treated as water for the sake + of looking for neighboring "wet" ground. + Default: default:water_source, default:water_flowing, + default:river_water_source, default:river_water_flowing + +biome_lib_default_wet_surfaces + Comma-separated list of nodes that should be considered "wet" if one of + the aforementioned water nodes is nearby. + Default: default:dirt, default:dirt_with_grass, default:sand + +biome_lib_default_grow_nodes + Comma-separated list of nodes that something must be sitting on to be + able to actively change from one thing to another (such as a sapling + growing into a tree), to be used for ALL growable nodes, if the calling + mod doesn't provide its own lists. + Default: "default:dirt_with_grass" + +biome_lib_default_ground_nodes + Comma-separated list of nodes to use as the "root" of something that can + gradually climb up a wall, to be used for ALL such nodes, if the calling + mod doesn't provide its own lists. + Default: "default:dirt_with_grass" diff --git a/mods/biome_lib/README.md b/mods/biome_lib/README.md index ac39750f..2cfd09d4 100644 --- a/mods/biome_lib/README.md +++ b/mods/biome_lib/README.md @@ -12,7 +12,7 @@ Both mapgen-based spawning and ABM-based spawning is supported. Growing code is It is primarily intended for mapgen v6, but it should work fine when used with mapgen v7. -**Dependencies**: default from minetest_game +**Dependencies:** nothing, but if you don't use `minetest_game`, you'll need to supply some settings (see API.txt). **Recommends**: [Plantlife Modpack](https://github.com/minetest-mods/plantlife_modpack), [More Trees](https://github.com/minetest-mods/moretrees) diff --git a/mods/biome_lib/growth.lua b/mods/biome_lib/growth.lua index 807b69c5..ba5285ca 100644 --- a/mods/biome_lib/growth.lua +++ b/mods/biome_lib/growth.lua @@ -20,8 +20,8 @@ function biome_lib:grow_plants(opts) local options = opts options.height_limit = options.height_limit or 5 - options.ground_nodes = options.ground_nodes or { "default:dirt_with_grass" } - options.grow_nodes = options.grow_nodes or { "default:dirt_with_grass" } + options.ground_nodes = options.ground_nodes or biome_lib.default_ground_nodes + options.grow_nodes = options.grow_nodes or biome_lib.default_grow_nodes options.seed_diff = options.seed_diff or 0 local n @@ -55,7 +55,7 @@ function biome_lib:grow_plants(opts) if options.need_wall and options.verticals_list then walldir = biome_lib:find_adjacent_wall(p_top, options.verticals_list, options.choose_random_wall) end - if (n_top.name == "air" or n_top.name == "default:snow") + if biome_lib.default_grow_through_nodes[n_top.name] and (not options.need_wall or (options.need_wall and walldir)) then if options.grow_vertically and walldir then if biome_lib:search_downward(pos, options.height_limit, options.ground_nodes) then diff --git a/mods/biome_lib/init.lua b/mods/biome_lib/init.lua index aefc9f1b..515ae074 100644 --- a/mods/biome_lib/init.lua +++ b/mods/biome_lib/init.lua @@ -9,8 +9,6 @@ biome_lib = {} biome_lib.air = {name = "air"} -plantslib = setmetatable({}, { __index=function(t,k) print("Use of deprecated function:", k) return biome_lib[k] end }) - biome_lib.blocklist_aircheck = {} biome_lib.blocklist_no_aircheck = {} @@ -32,6 +30,41 @@ biome_lib.total_no_aircheck_calls = 0 biome_lib.queue_run_ratio = tonumber(minetest.settings:get("biome_lib_queue_run_ratio")) or 100 +local function tableize(s) + return string.split(string.trim(string.gsub(s, " ", ""))) +end + +local c1 minetest.settings:get("biome_lib_default_grow_through_nodes") +biome_lib.default_grow_through_nodes = {["air"] = true} +if c1 then + for _, i in ipairs(tableize(c1)) do + biome_lib.default_grow_through_nodes[i] = true + end +else + biome_lib.default_grow_through_nodes["default:snow"] = true +end + +local c2 minetest.settings:get("biome_lib_default_water_nodes") +biome_lib.default_water_nodes = {} +if c2 then + for _, i in ipairs(tableize(c2)) do + biome_lib.default_water_nodes[i] = true + end +else + biome_lib.default_water_nodes["default:water_source"] = true + biome_lib.default_water_nodes["default:water_flowing"] = true + biome_lib.default_water_nodes["default:river_water_source"] = true + biome_lib.default_water_nodes["default:river_water_flowing"] = true +end + +local c3 = minetest.settings:get("biome_lib_default_wet_surfaces") +local c4 = minetest.settings:get("biome_lib_default_ground_nodes") +local c5 = minetest.settings:get("biome_lib_default_grow_nodes") + +biome_lib.default_wet_surfaces = c3 and tableize(c3) or {"default:dirt", "default:dirt_with_grass", "default:sand"} +biome_lib.default_ground_nodes = c4 and tableize(c4) or {"default:dirt_with_grass"} +biome_lib.default_grow_nodes = c5 and tableize(c5) or {"default:dirt_with_grass"} + -- Boilerplate to support localized strings if intllib mod is installed. local S if minetest.global_exists("intllib") then @@ -45,12 +78,12 @@ else end biome_lib.intllib = S -local DEBUG = false --... except if you want to spam the console with debugging info :-) +local DEBUG = minetest.settings:get_bool("biome_lib_debug", false) function biome_lib:dbg(msg) if DEBUG then - print("[Plantlife] "..msg) - minetest.log("verbose", "[Plantlife] "..msg) + print("[Biome Lib] "..msg) + minetest.log("verbose", "[Biome Lib] "..msg) end end @@ -125,7 +158,7 @@ function biome_lib:set_defaults(biome) biome.near_nodes_size = biome.near_nodes_size or 0 biome.near_nodes_count = biome.near_nodes_count or 1 biome.rarity = biome.rarity or 50 - biome.max_count = biome.max_count or 5 + biome.max_count = biome.max_count or 125 if biome.check_air ~= false then biome.check_air = true end -- specific to abm spawner @@ -296,6 +329,7 @@ local function populate_single_surface(biome, pos, perlin_fertile_area, checkair end function biome_lib:populate_surfaces(biome, nodes_or_function_or_model, snodes, checkair) + local items_added = 0 biome_lib:set_defaults(biome) @@ -316,10 +350,10 @@ function biome_lib:populate_surfaces(biome, nodes_or_function_or_model, snodes, local num_in_biome_nodes = #in_biome_nodes if num_in_biome_nodes == 0 then - return + return 0 end - for i = 1, math.min(biome.max_count, num_in_biome_nodes) do + for i = 1, math.min(math.ceil(biome.max_count/25), num_in_biome_nodes) do local tries = 0 local spawned = false while tries < 2 and not spawned do @@ -388,7 +422,9 @@ function biome_lib:populate_surfaces(biome, nodes_or_function_or_model, snodes, tries = tries + 1 end end + if spawned then items_added = items_added + 1 end end + return items_added end -- Primary mapgen spawner, for mods that can work with air checking enabled on @@ -411,14 +447,22 @@ function biome_lib:generate_block_with_air_checking() biome_lib.surface_nodes_aircheck.blockhash = minetest.find_nodes_in_area_under_air(minp, maxp, biome_lib.surfaceslist_aircheck) biome_lib.actioncount_aircheck.blockhash = 1 - + if #biome_lib.surface_nodes_aircheck.blockhash > 0 then + biome_lib:dbg("Mapblock at "..minetest.pos_to_string(minp).." added, with "..#biome_lib.surface_nodes_aircheck.blockhash.." surface nodes detected.") + end + elseif not minetest.get_node_or_nil(minp) then + minetest.load_area(minp) else if biome_lib.actionslist_aircheck[biome_lib.actioncount_aircheck.blockhash] then -- [1] is biome, [2] is node/function/model - biome_lib:populate_surfaces( + local added = biome_lib:populate_surfaces( biome_lib.actionslist_aircheck[biome_lib.actioncount_aircheck.blockhash][1], biome_lib.actionslist_aircheck[biome_lib.actioncount_aircheck.blockhash][2], biome_lib.surface_nodes_aircheck.blockhash, true) + if added > 0 then + biome_lib:dbg("Ran biome_lib:populate_surfaces for block at "..minetest.pos_to_string(minp).. + ". Entry #"..biome_lib.actioncount_aircheck.blockhash.." added "..added.." items.") + end biome_lib.actioncount_aircheck.blockhash = biome_lib.actioncount_aircheck.blockhash + 1 else table.remove(biome_lib.blocklist_aircheck, 1) @@ -445,7 +489,8 @@ function biome_lib:generate_block_no_aircheck() biome_lib.surface_nodes_no_aircheck.blockhash = minetest.find_nodes_in_area(minp, maxp, biome_lib.surfaceslist_no_aircheck) biome_lib.actioncount_no_aircheck.blockhash = 1 - + elseif not minetest.get_node_or_nil(minp) then + minetest.load_area(minp) else if biome_lib.actionslist_no_aircheck[biome_lib.actioncount_no_aircheck.blockhash] then biome_lib:populate_surfaces( @@ -617,11 +662,11 @@ function biome_lib:spawn_on_surfaces(sd,sp,sr,sc,ss,sa) local currentsurface = minetest.get_node(pos).name - if currentsurface == "default:water_source" and + if biome_lib.default_water_nodes[currentsurface] and #minetest.find_nodes_in_area( {x=pos.x, y=pos.y-biome.depth_max-1, z=pos.z}, vector.new(pos), - {"default:dirt", "default:dirt_with_grass", "default:sand"} + biome_lib.default_wet_surfaces ) == 0 then return -- On water but no ground nearby end @@ -682,12 +727,9 @@ function biome_lib:replace_object(pos, replacement, grow_function, walldir, seed end end - dofile(biome_lib.modpath .. "/search_functions.lua") assert(loadfile(biome_lib.modpath .. "/growth.lua"))(time_scale) - - -- Check for infinite stacks if minetest.get_modpath("unified_inventory") or not minetest.settings:get_bool("creative_mode") then @@ -705,10 +747,29 @@ function biome_lib:get_nodedef_field(nodename, fieldname) return minetest.registered_nodes[nodename][fieldname] end +if DEBUG then + biome_lib.last_count_air = 0 + biome_lib.last_count_no_air = 0 + + function biome_lib.show_pending_block_counts() + if biome_lib.last_count_air ~= #biome_lib.blocklist_aircheck + or biome_lib.last_count_no_air ~= #biome_lib.blocklist_no_aircheck then + biome_lib:dbg(string.format("Pending block counts, air: %-7i no-air: %i", + #biome_lib.blocklist_aircheck, #biome_lib.blocklist_no_aircheck)) + + biome_lib.last_count_air = #biome_lib.blocklist_aircheck + biome_lib.last_count_no_air = #biome_lib.blocklist_no_aircheck + end + minetest.after(1, biome_lib.show_pending_block_counts) + end + + biome_lib.show_pending_block_counts() + + minetest.after(0, function() + print("Registered a total of "..(#biome_lib.surfaceslist_aircheck)+(#biome_lib.surfaceslist_no_aircheck).." surface types to be evaluated, spread") + print("across "..#biome_lib.actionslist_aircheck.." actions with air-checking and "..#biome_lib.actionslist_no_aircheck.." actions without.") + end) + +end + print("[Biome Lib] Loaded") - -minetest.after(0, function() - print("[Biome Lib] Registered a total of "..(#biome_lib.surfaceslist_aircheck)+(#biome_lib.surfaceslist_no_aircheck).." surface types to be evaluated, spread") - print("[Biome Lib] across "..#biome_lib.actionslist_aircheck.." actions with air-checking and "..#biome_lib.actionslist_no_aircheck.." actions without.") -end) - diff --git a/mods/biome_lib/mod.conf b/mods/biome_lib/mod.conf index b3312f63..86b044a3 100644 --- a/mods/biome_lib/mod.conf +++ b/mods/biome_lib/mod.conf @@ -1,4 +1,3 @@ name = biome_lib min_minetest_version = 5.2.0 -depends = default -optional_depends = intllib +optional_depends = default, intllib diff --git a/mods/biome_lib/search_functions.lua b/mods/biome_lib/search_functions.lua index 1f11476d..11f379aa 100644 --- a/mods/biome_lib/search_functions.lua +++ b/mods/biome_lib/search_functions.lua @@ -56,11 +56,11 @@ end -- split into individual mapblocks to reduce lag minetest.register_on_generated(function(minp, maxp, blockseed) - for x = 0, 5 do + for x = 0, 4 do local minx = minp.x + x*16 - for y = 0, 5 do + for y = 0, 4 do local miny = minp.y + y*16 - for z = 0, 5 do + for z = 0, 4 do local minz = minp.z + z*16 local bmin = {x=minx, y=miny, z=minz} diff --git a/mods/bonemeal/init.lua b/mods/bonemeal/init.lua index 71cff14c..b7990eb1 100644 --- a/mods/bonemeal/init.lua +++ b/mods/bonemeal/init.lua @@ -37,6 +37,17 @@ local function pine_grow(pos) end +-- special function for cactus growth +local function cactus_grow(pos) + default.grow_cactus(pos, minetest.get_node(pos)) +end + +-- special function for papyrus growth +local function papyrus_grow(pos) + default.grow_papyrus(pos, minetest.get_node(pos)) +end + + -- default saplings local saplings = { {"default:sapling", default.grow_new_apple_tree, "soil"}, @@ -49,7 +60,9 @@ local saplings = { {"default:acacia_bush_sapling", default.grow_acacia_bush, "soil"}, {"default:large_cactus_seedling", default.grow_large_cactus, "sand"}, {"default:blueberry_bush_sapling", default.grow_blueberry_bush, "soil"}, - {"default:pine_bush_sapling", default.grow_pine_bush, "soil"} + {"default:pine_bush_sapling", default.grow_pine_bush, "soil"}, + {"default:cactus", cactus_grow, "sand"}, + {"default:papyrus", papyrus_grow, "soil"}, } -- helper tables ( "" denotes a blank item ) diff --git a/mods/castle/autocraft.lua b/mods/castle/autocraft.lua index 903ba47b..b7544f14 100644 --- a/mods/castle/autocraft.lua +++ b/mods/castle/autocraft.lua @@ -10,7 +10,8 @@ minetest.register_node("castle:autocraft", { paramtype = "light", paramtype2 = "facedir", sounds = default.node_sound_wood_defaults(), - +drop = "pipeworks:autocrafter", +})--[[ on_construct = function(pos) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() @@ -18,16 +19,6 @@ minetest.register_node("castle:autocraft", { inv:set_size("in", 6 * 4) -- was 8 * 3 meta:set_string("formspec", ---[[ - "size[8,11]" - ..default.gui_bg..default.gui_bg_img..default.gui_slots - .."list[context;craft;2.5,0;3,3]" - .."list[context;in;0,3.5;8,3]" - .."list[current_player;main;0,7;8,4]" - .."label[0,0;AUTOCRAFTER]" - .."label[0.5,1.2;Recipe ->]" - .."label[0,3;Materials:") ---]] "size[10,9]" ..default.gui_bg..default.gui_bg_img..default.gui_slots .."list[context;craft;7,0.5;3,3]" @@ -156,3 +147,4 @@ minetest.register_abm({ end end, }) +]] \ No newline at end of file diff --git a/mods/castle/pillars.lua b/mods/castle/pillars.lua index 94c63c98..ee4580ee 100644 --- a/mods/castle/pillars.lua +++ b/mods/castle/pillars.lua @@ -93,5 +93,5 @@ for n = 1, #pillar do {pillar[n][4],pillar[n][4]} }, }) - grp = {cracky = 3, not_in_craft_guide = 1} + --grp = {cracky = 3, not_in_craft_guide = 1} end diff --git a/mods/castle/textures/castle_street_light.png b/mods/castle/textures/castle_street_light.png new file mode 100644 index 0000000000000000000000000000000000000000..dc3f72ef0c00a0be090305f034aa084a97b2fdb9 GIT binary patch literal 465 zcmV;?0WSWDP)FD6-=ilSv+U4Zj?(O9|H7hzc zD_&ADmw!Cw<=yJ(;p*w)+}qRP;MnHn-0JDz>+0g{>*MtE>(cMw<=*G!-|z0`@bBjF@aOXJ>htpI^z-WY_wIP56tn;U0LDo~K~#9! zWsgN-!$1H7wf2I&>?CFgbD0_b|EX?sY;~N2G{PhulM#(V=!lHd3DSfxF5(cu8A(zk z1bQo7Rp_dhAPET5Q04MTb>3mm2r_QIaJg=z?cs8sfr`S3T2`-HN^^G)}%LLbC}daVcD+H$TJzv}eJ1UZ?W$GHX zsYMCRh7pP;-3t;Jq?~0=73heFG#aoxn#17f L>gTe~DWM4f>60|E literal 0 HcmV?d00001 diff --git a/mods/farming/textures/strawberry.png b/mods/farming/textures/farming_strawberry.png similarity index 100% rename from mods/farming/textures/strawberry.png rename to mods/farming/textures/farming_strawberry.png diff --git a/mods/mobs_animal/kitten.lua b/mods/mobs_animal/kitten.lua index 04aa6f08..58094514 100644 --- a/mods/mobs_animal/kitten.lua +++ b/mods/mobs_animal/kitten.lua @@ -155,7 +155,8 @@ minetest.register_craftitem(":mobs:hairball", { local newpos = {x = pos.x + dir.x, y = pos.y + dir.y + 1.5, z = pos.z + dir.z} local item = hairball_items[math.random(1, #hairball_items)] - if item ~= "" then + if item ~= "" + and minetest.registered_items[item] then minetest.add_item(newpos, {name = item}) end diff --git a/mods/mobs_monster/lava_flan.lua b/mods/mobs_monster/lava_flan.lua index cbf1cf93..6e355fe2 100644 --- a/mods/mobs_monster/lava_flan.lua +++ b/mods/mobs_monster/lava_flan.lua @@ -37,6 +37,7 @@ mobs:register_mob("mobs_monster:lava_flan", { }, water_damage = 8, lava_damage = 0, + fire_damage = 0, light_damage = 0, immune_to = { {"mobs:pick_lava", -2}, -- lava pick heals 2 health @@ -240,6 +241,7 @@ mobs:register_mob("mobs_monster:obsidian_flan", { }, water_damage = 0, lava_damage = 8, + fire_damage = 0, light_damage = 0, animation = { speed_normal = 15, diff --git a/mods/mobs_monster/sand_monster.lua b/mods/mobs_monster/sand_monster.lua index 21c5af6e..67595be3 100644 --- a/mods/mobs_monster/sand_monster.lua +++ b/mods/mobs_monster/sand_monster.lua @@ -39,6 +39,7 @@ mobs:register_mob("mobs_monster:sand_monster", { attack_type = "dogfight", pathfinding = true, --specific_attack = {"player", "mobs_npc:npc"}, + --ignore_invisibility = true, reach = 2, damage = 1, hp_min = 4, diff --git a/mods/mobs_redo/api.lua b/mods/mobs_redo/api.lua index a3a75c64..eaaf0f79 100644 --- a/mods/mobs_redo/api.lua +++ b/mods/mobs_redo/api.lua @@ -8,12 +8,12 @@ local use_cmi = minetest.global_exists("cmi") mobs = { mod = "redo", - version = "20210323", + version = "20210405", intllib = S, invis = minetest.global_exists("invisibility") and invisibility or {} } --- localize math functions +-- localize common functions local pi = math.pi local square = math.sqrt local sin = math.sin @@ -112,7 +112,8 @@ local mob_class = { light_damage_min = 14, light_damage_max = 15, water_damage = 0, - lava_damage = 0, + lava_damage = 4, + fire_damage = 4, air_damage = 0, suffocation = 2, fall_damage = 1, @@ -164,6 +165,7 @@ local mob_class = { local mob_class_meta = {__index = mob_class} + -- play sound function mob_class:mob_sound(sound) @@ -982,7 +984,12 @@ local is_node_dangerous = function(self, nodename) end if self.lava_damage > 0 - and minetest.get_item_group(nodename, "igniter") ~= 0 then + and minetest.get_item_group(nodename, "lava") ~= 0 then + return true + end + + if self.fire_damage > 0 + and minetest.get_item_group(nodename, "fire") ~= 0 then return true end @@ -1068,37 +1075,47 @@ function mob_class:do_env_damage() local nodef = minetest.registered_nodes[self.standing_in] -- water - if self.water_damage and nodef.groups.water then + if self.water_damage ~= 0 + and nodef.groups.water then - if self.water_damage ~= 0 then + self.health = self.health - self.water_damage - self.health = self.health - self.water_damage + effect(pos, 5, "bubble.png", nil, nil, 1, nil) - effect(pos, 5, "bubble.png", nil, nil, 1, nil) - - if self:check_for_death({type = "environment", - pos = pos, node = self.standing_in}) then - return true - end + if self:check_for_death({type = "environment", + pos = pos, node = self.standing_in}) then + return true end - -- ignition source (fire or lava) - elseif self.lava_damage and nodef.groups.igniter then + -- lava damage + elseif self.lava_damage ~= 0 + and nodef.groups.lava then - if self.lava_damage ~= 0 then + self.health = self.health - self.lava_damage - self.health = self.health - self.lava_damage + effect(pos, 15, "fire_basic_flame.png", 1, 5, 1, 0.2, 15, true) - effect(pos, 15, "fire_basic_flame.png", 1, 5, 1, 0.2, 15, true) - - if self:check_for_death({type = "environment", pos = pos, - node = self.standing_in, hot = true}) then - return true - end + if self:check_for_death({type = "environment", pos = pos, + node = self.standing_in, hot = true}) then + return true end - -- damage_per_second node check - elseif nodef.damage_per_second ~= 0 then + -- fire damage + elseif self.fire_damage ~= 0 + and nodef.groups.fire then + + self.health = self.health - self.fire_damage + + effect(pos, 15, "fire_basic_flame.png", 1, 5, 1, 0.2, 15, true) + + if self:check_for_death({type = "environment", pos = pos, + node = self.standing_in, hot = true}) then + return true + end + + -- damage_per_second node check (not fire and lava) + elseif nodef.damage_per_second ~= 0 + and nodef.groups.lava == 0 and nodef.groups.fire == 0 then self.health = self.health - nodef.damage_per_second @@ -2772,15 +2789,37 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir, damage) return true end - -- is mob protected? - if self.protected and hitter:is_player() - and minetest.is_protected(self.object:get_pos(), - hitter:get_player_name()) then + -- is mob protected + if self.protected then - minetest.chat_send_player(hitter:get_player_name(), - S("Mob has been protected!")) + -- did player hit mob and if so is it in protected area + if hitter:is_player() then - return true + local player_name = hitter:get_player_name() + + if player_name ~= self.owner + and minetest.is_protected(self.object:get_pos(), player_name) then + + minetest.chat_send_player(hitter:get_player_name(), + S("Mob has been protected!")) + + return true + end + + -- if protection is on level 2 then dont let arrows harm mobs + elseif self.protected == 2 then + + local ent = hitter and hitter:get_luaentity() + + if ent and ent._is_arrow then + + return true -- arrow entity + + elseif not ent then + + return true -- non entity + end + end end local weapon = hitter:get_wielded_item() @@ -2812,7 +2851,7 @@ function mob_class:on_punch(hitter, tflp, tool_capabilities, dir, damage) end damage = damage + (tool_capabilities.damage_groups[group] or 0) - * tmp * ((armor[group] or 0) / 100.0) + * tmp * ((armor[group] or 0) / 100.0) end end @@ -3149,8 +3188,7 @@ function mob_class:mob_activate(staticdata, def, dtime) def.textures = {def.textures} end - self.base_texture = def.textures and - def.textures[random(#def.textures)] + self.base_texture = def.textures and def.textures[random(#def.textures)] self.base_mesh = def.mesh self.base_size = self.visual_size self.base_colbox = self.collisionbox @@ -3557,6 +3595,7 @@ minetest.register_entity(name, setmetatable({ light_damage_max = def.light_damage_max, water_damage = def.water_damage, lava_damage = def.lava_damage, + fire_damage = def.fire_damage, air_damage = def.air_damage, suffocation = def.suffocation, fall_damage = def.fall_damage, @@ -4562,19 +4601,21 @@ function mobs:protect(self, clicker) local name = clicker:get_player_name() local tool = clicker:get_wielded_item() + local tool_name = tool:get_name() - if tool:get_name() ~= "mobs:protector" then + if tool_name ~= "mobs:protector" + and tool_name ~= "mobs:protector2" then return false end - if self.tamed == false then + if not self.tamed then minetest.chat_send_player(name, S("Not tamed!")) - return true -- false + return true end - if self.protected == true then + if self.protected then minetest.chat_send_player(name, S("Already protected!")) - return true -- false + return true end if not mobs.is_creative(clicker:get_player_name()) then @@ -4582,9 +4623,15 @@ function mobs:protect(self, clicker) clicker:set_wielded_item(tool) end - self.protected = true + -- set protection level + if tool_name == "mobs:protector" then + self.protected = true + else + self.protected = 2 ; self.fire_damage = 0 + end local pos = self.object:get_pos() + pos.y = pos.y + self.collisionbox[2] + 0.5 effect(self.object:get_pos(), 25, "mobs_protect_particle.png", diff --git a/mods/mobs_redo/api.txt b/mods/mobs_redo/api.txt index 08214a62..72473a8d 100644 --- a/mods/mobs_redo/api.txt +++ b/mods/mobs_redo/api.txt @@ -66,7 +66,10 @@ functions needed for the mob to work properly which contains the following: water. 'air_damage' holds damage per second inflicted to mob when standing in air. 'lava_damage' holds the damage per second inflicted to mobs when standing - in lava or fire or an ignition source. + in lava. + 'fire_damage' holds the damage per second inflicted to mobs when standing + in fire. + 'light_damage' holds the damage per second inflicted to mobs when light level is between the min and max values below 'light_damage_min' minimum light value when mob is affected (default: 14) diff --git a/mods/mobs_redo/crafts.lua b/mods/mobs_redo/crafts.lua index c1371918..3fed1587 100644 --- a/mods/mobs_redo/crafts.lua +++ b/mods/mobs_redo/crafts.lua @@ -115,6 +115,22 @@ minetest.register_craft({ } }) +-- level 2 protection rune +minetest.register_craftitem("mobs:protector2", { + description = S("Mob Protection Rune (Level 2)"), + inventory_image = "mobs_protector2.png", + groups = {flammable = 2} +}) + +minetest.register_craft({ + output = "mobs:protector2", + recipe = { + {"mobs:protector", "default:mese_crystal", "mobs:protector"}, + {"default:mese_crystal", "default:diamondblock", "default:mese_crystal"}, + {"mobs:protector", "default:mese_crystal", "mobs:protector"} + } +}) + -- saddle minetest.register_craftitem("mobs:saddle", { description = S("Saddle"), diff --git a/mods/mobs_redo/textures/mobs_protector2.png b/mods/mobs_redo/textures/mobs_protector2.png new file mode 100644 index 0000000000000000000000000000000000000000..8c5a17e61d9922264e9516d39a889941c066afc8 GIT binary patch literal 164 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPHV5AX?b1=0pa`e6~F?M;m(7Y{jH zdm{oAVk`;r3ubV5b|VeQarSg^4B@z*oZ!HamdwbJyJQJRnxVF(rsg3DF9k(qRdI>K zCpnKKgas7^H5yKtBa*1pWnkKsu}guc= 1 then + checkbox_faction = true end end end @@ -578,6 +578,7 @@ minetest.register_node("protector:protect2", { inventory_image = "protector_logo.png", sounds = default.node_sound_stone_defaults(), groups = {dig_immediate = 2, unbreakable = 1}, + use_texture_alpha = "clip", paramtype = "light", paramtype2 = "wallmounted", legacy_wallmounted = true, diff --git a/mods/skinsdb/meta/character_2023.txt b/mods/skinsdb/meta/character_2023.txt new file mode 100644 index 00000000..24738310 --- /dev/null +++ b/mods/skinsdb/meta/character_2023.txt @@ -0,0 +1,3 @@ +josegamestest_0 +Jose Anastácio +CC BY-SA 3.0 diff --git a/mods/skinsdb/textures/character_2023.png b/mods/skinsdb/textures/character_2023.png new file mode 100644 index 0000000000000000000000000000000000000000..6676fdebb49616dd09e29392314c542d8edf4395 GIT binary patch literal 4995 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 N002ovPDHLkV1oONi=Y4i literal 0 HcmV?d00001 diff --git a/mods/stairs/stairs.lua b/mods/stairs/stairs.lua index b9f98c61..82097e4c 100644 --- a/mods/stairs/stairs.lua +++ b/mods/stairs/stairs.lua @@ -497,6 +497,17 @@ stairs.register_all("bred2", "xanadu:red2", "Decorative baked red clay 2", stairs.stone) +stairs.register_all("compressed_cobble", "xanadu:compressed_cobble", + {cracky = 3, level = 2}, + {"compressed_cobble.png"}, + "Compressed Cobble", + stairs.stone) + +stairs.register_all("compressed_dirt", "xanadu:compressed_dirt", + {crumbly = 2}, + {"compressed_dirt.png"}, + "Compressed Dirt", + stairs.stone) end --= Castle Mod diff --git a/mods/stamina/init.lua b/mods/stamina/init.lua index 8acc1575..7034dc45 100644 --- a/mods/stamina/init.lua +++ b/mods/stamina/init.lua @@ -517,7 +517,8 @@ function stamina.eat(hp_change, replace_with_item, itemstack, user, pointed_thin minetest.sound_play(snd, {to_player = name, gain = 0.7}, true) -- particle effect when eating - local pos = user:get_pos() ; pos.y = pos.y + 1.5 -- mouth level + local prop = user:get_properties() + local pos = user:get_pos() ; pos.y = pos.y + prop.eye_height -- mouth level local texture = minetest.registered_items[itemname].inventory_image local dir = user:get_look_dir() @@ -601,8 +602,7 @@ and minetest.settings:get_bool("enable_stamina") ~= false then if get_int_attribute(player) then - level = math.min(get_int_attribute(player), - STAMINA_VISUAL_MAX) + level = math.min(get_int_attribute(player), STAMINA_VISUAL_MAX) else local meta = player:get_meta() @@ -620,7 +620,7 @@ and minetest.settings:get_bool("enable_stamina") ~= false then number = level, alignment = {x = -1, y = -1}, offset = {x = -266, y = -110}, - max = 0, + max = 0 }) stamina.players[name] = { @@ -628,7 +628,7 @@ and minetest.settings:get_bool("enable_stamina") ~= false then exhaustion = 0, poisoned = nil, drunk = nil, - sprint = nil, + sprint = nil } end) @@ -675,7 +675,6 @@ else stamina.players[player:get_player_name()] = { poisoned = nil, sprint = nil, drunk = nil, exhaustion = 0} end) - end -- clear when player leaves