From e04978bddff7b34e5dce3049a5b12d6b82eddfa9 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 2 Jan 2021 22:12:17 +0100 Subject: [PATCH] update --- mods/christmas/init.lua | 5 +- mods/farming/hoes.lua | 4 +- mods/farming/license.txt | 2 +- mods/farming/mod.conf | 5 +- mods/mobs_redo/api.lua | 6 +- mods/moreblocks/CHANGELOG.md | 7 ++ mods/moreblocks/redefinitions.lua | 112 +++++++++++++---------- mods/skinsdb/meta/character_1938.txt | 3 + mods/skinsdb/meta/character_1939.txt | 3 + mods/skinsdb/textures/character_1938.png | Bin 0 -> 2648 bytes mods/skinsdb/textures/character_1939.png | Bin 0 -> 8325 bytes mods/stamina/init.lua | 12 ++- mods/stamina/settingtypes.txt | 5 + 13 files changed, 99 insertions(+), 65 deletions(-) create mode 100644 mods/skinsdb/meta/character_1938.txt create mode 100644 mods/skinsdb/meta/character_1939.txt create mode 100644 mods/skinsdb/textures/character_1938.png create mode 100644 mods/skinsdb/textures/character_1939.png create mode 100644 mods/stamina/settingtypes.txt diff --git a/mods/christmas/init.lua b/mods/christmas/init.lua index 8867729e..7eafc2d2 100644 --- a/mods/christmas/init.lua +++ b/mods/christmas/init.lua @@ -54,10 +54,7 @@ minetest.register_node("christmas:eggnog", { }) minetest.register_node("christmas:present", { description = "Christmas present", - tiles = { - "christmas_present.png", - "christmas_present_top.png" - }, + tiles = {"christmas_present.png"}, drawtype = "mesh", paramtype = "light", mesh = "christmas_present.obj", diff --git a/mods/farming/hoes.lua b/mods/farming/hoes.lua index 21d435b2..b7dcfd97 100644 --- a/mods/farming/hoes.lua +++ b/mods/farming/hoes.lua @@ -481,7 +481,7 @@ if minetest.get_modpath("moreores") then {"", "", "group:stick"} } }) - +--[[ farming.register_hoe(":moreores:hoe_silver", { description = S("%s Hoe"):format(S("Silver")), inventory_image = "moreores_tool_silverhoe.png", @@ -510,5 +510,5 @@ if minetest.get_modpath("moreores") then minetest.override_item("moreores:hoe_mithril", { original_description = desc, description = toolranks.create_description(desc)}) - end + end]] end diff --git a/mods/farming/license.txt b/mods/farming/license.txt index aa8a40ea..6f5bf4a4 100644 --- a/mods/farming/license.txt +++ b/mods/farming/license.txt @@ -149,7 +149,7 @@ Created by OgelGames (CC BY-SA 4.0) farming_cactus_juice.png farming_salad.png -Created by Felfa +Created by Felfa (CC0) farming_blackberry*.png farming_lettuce*.png farming_burger.png diff --git a/mods/farming/mod.conf b/mods/farming/mod.conf index 80ab8b0b..bc6a919b 100644 --- a/mods/farming/mod.conf +++ b/mods/farming/mod.conf @@ -1 +1,4 @@ -name = farming \ No newline at end of file +name = farming +depends = default +optional_depends = stairs, intllib, lucky_block, toolranks +description = Adds many plants and food to Minetest diff --git a/mods/mobs_redo/api.lua b/mods/mobs_redo/api.lua index d2198509..a00b16ef 100644 --- a/mods/mobs_redo/api.lua +++ b/mods/mobs_redo/api.lua @@ -8,7 +8,7 @@ local use_cmi = minetest.global_exists("cmi") mobs = { mod = "redo", - version = "20201206", + version = "20210102", intllib = S, invis = minetest.global_exists("invisibility") and invisibility or {} } @@ -4503,10 +4503,10 @@ function mobs:capture_mob(self, clicker, chance_hand, chance_net, minetest.add_item(clicker:get_pos(), new_stack) end - remove_mob(self, true) - self:mob_sound("default_place_node_hard") + remove_mob(self, true) + return new_stack -- when chance above fails or set to 0, miss! diff --git a/mods/moreblocks/CHANGELOG.md b/mods/moreblocks/CHANGELOG.md index 900b7231..e050101b 100644 --- a/mods/moreblocks/CHANGELOG.md +++ b/mods/moreblocks/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Changed + +- Refactored recipe override mechanism to avoid re-coding recipes + when we only want to change the amount produced. +- [Realigned rail recipe to the changes made in Minetest Game.](https://github.com/minetest-mods/moreblocks/pull/169) + - All rail recipes (standard, power, break) were boosted by 50%. + ### Fixed - [Fixed strange placement behavior for non-default Stairs+ nodes.](https://github.com/minetest-mods/moreblocks/pull/168) diff --git a/mods/moreblocks/redefinitions.lua b/mods/moreblocks/redefinitions.lua index 1856c989..e9c5ff7e 100644 --- a/mods/moreblocks/redefinitions.lua +++ b/mods/moreblocks/redefinitions.lua @@ -5,64 +5,78 @@ Copyright © 2011-2020 Hugo Locurcio and contributors. Licensed under the zlib license. See LICENSE.md for more information. --]] --- Redefinitions of some default crafting recipes: +local modname = minetest.get_current_modname() --- Signs: +1 -minetest.clear_craft({ - recipe = { - {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, - {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, - {'', 'group:stick', ''}, +-- Redefine some of the default crafting recipes to be more productive + +-- Auxiliary function: take a recipe as returned by get_all_craft_recipes +-- and turn it into a table that can be used to clear a craft or declare a new one +local reconstruct_internal_craft = function(recipe) + local recp = { + { "", "", "" }, + { "", "", "" }, + { "", "", "" }, } -}) + for idx, item in pairs(recipe.items) do + local row = math.ceil(idx / recipe.width) + local col = idx - (row-1)*recipe.width + recp[row][col] = item + end + return recp +end -minetest.clear_craft({ - recipe = { - {'group:wood', 'group:wood', 'group:wood'}, - {'group:wood', 'group:wood', 'group:wood'}, - {'', 'group:stick', ''}, - } -}) +-- Change the amount produced by recipe by apply func to the old amount +local change_recipe_amount = function(product, recipe, func) + local recp = reconstruct_internal_craft(recipe) -minetest.register_craft({ - output = 'default:sign_wall_steel 4', - recipe = { - {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, - {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, - {'', 'group:stick', ''}, - } -}) + local oldamount = tonumber(recipe.output:match(" [0-9]+$") or "1") -minetest.register_craft({ - output = 'default:sign_wall_wood 4', - recipe = { - {'group:wood', 'group:wood', 'group:wood'}, - {'group:wood', 'group:wood', 'group:wood'}, - {'', 'group:stick', ''}, - } -}) + local newamount = func(oldamount) + -- remove old crafting recipe + local redo = { recipe = recp } + minetest.clear_craft(redo) -minetest.clear_craft({ - recipe = { - {"default:papyrus", "default:papyrus", "default:papyrus"} - } -}) -minetest.register_craft({ - output = "default:paper 4", - recipe = { - {"default:papyrus", "default:papyrus", "default:papyrus"}, - } -}) + -- new output + redo.output = ("%s %d"):format(product, newamount) + minetest.register_craft(redo) + minetest.log("action", ("[MOD]%s: recipe for %s production: %d => %d"):format(modname, product, oldamount, newamount)) +end -minetest.register_craft({ - output = "default:rail 24", - recipe = { - {"default:steel_ingot", "", "default:steel_ingot"}, - {"default:steel_ingot", "default:stick", "default:steel_ingot"}, - {"default:steel_ingot", "", "default:steel_ingot"}, - } +local increase_craft_production = function(product, func) + local recipes = minetest.get_all_craft_recipes(product) + for _, r in pairs(recipes) do + if r.type == "normal" or r.method == "normal" then + change_recipe_amount(product, r, func) + end + end +end + +-- Increase the crafting production according to the rules from the table, which is in the form: +-- { +-- { detector, amount changing function } +-- { detector, amount changing function } +-- } +-- TODO: consider exporting this function to other mods +local increase_craft_production_table = function(map_table) + for product, _ in pairs(minetest.registered_items) do + for _, tab in pairs(map_table) do + local detector = tab[1] + local func = tab[2] + if detector(product) then + increase_craft_production(product, func) + -- only apply one boost + break + end + end + end +end + +increase_craft_production_table({ + { function(n) return n:match('^default:sign_wall') end, function(old) return old + 1 end }, + { function(n) return n == 'default:paper' end, function(old) return old*4 end }, + { function(n) return n:match('^carts:.*rail$') or n:match('^default:.*rail$') end, function(old) return old + old/2 end }, }) minetest.register_craft({ diff --git a/mods/skinsdb/meta/character_1938.txt b/mods/skinsdb/meta/character_1938.txt new file mode 100644 index 00000000..41c3d376 --- /dev/null +++ b/mods/skinsdb/meta/character_1938.txt @@ -0,0 +1,3 @@ +MUD +Mihin Dissanayake +CC BY-SA 3.0 diff --git a/mods/skinsdb/meta/character_1939.txt b/mods/skinsdb/meta/character_1939.txt new file mode 100644 index 00000000..41c3d376 --- /dev/null +++ b/mods/skinsdb/meta/character_1939.txt @@ -0,0 +1,3 @@ +MUD +Mihin Dissanayake +CC BY-SA 3.0 diff --git a/mods/skinsdb/textures/character_1938.png b/mods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q*VXhS+}d^BW0 zEPb`guFHMt50~e9KKPd)6d3UPDI;@mf(JmPcR+!6w4GGor}bW7^JoCvb QQ;1)9^6B$8&W(QmKkd-9wEzGB literal 0 HcmV?d00001 diff --git a/mods/stamina/init.lua b/mods/stamina/init.lua index 0b068db1..4231e0d8 100644 --- a/mods/stamina/init.lua +++ b/mods/stamina/init.lua @@ -45,10 +45,12 @@ local function get_int_attribute(player) end +local stamina_enabled = minetest.settings:get_bool("enable_stamina") ~= false + local function stamina_update_level(player, level) -- pipeworks fake player check - if not player.get_attribute then + if not player.get_attribute or not stamina_enabled then return nil end @@ -129,8 +131,8 @@ end -- Sprint settings and function -local enable_sprint = minetest.setting_getbool("sprint") ~= false -local enable_sprint_particles = minetest.setting_getbool("sprint_particles") ~= false +local enable_sprint = minetest.settings:get_bool("sprint") ~= false +local enable_sprint_particles = minetest.settings:get_bool("sprint_particles") ~= false local monoids = minetest.get_modpath("player_monoids") local pova_mod = minetest.get_modpath("pova") @@ -567,8 +569,8 @@ end -- stamina is disabled if damage is disabled -if minetest.setting_getbool("enable_damage") -and minetest.setting_get("enable_stamina") ~= false then +if minetest.settings:get_bool("enable_damage") +and minetest.settings:get_bool("enable_stamina") ~= false then minetest.register_on_joinplayer(function(player) diff --git a/mods/stamina/settingtypes.txt b/mods/stamina/settingtypes.txt new file mode 100644 index 00000000..62ac5894 --- /dev/null +++ b/mods/stamina/settingtypes.txt @@ -0,0 +1,5 @@ +sprint (Enable sprint) bool true + +sprint_particles (Enable sprint particles) bool true + +enable_stamina (Enable stamina/hunger) bool true