From da04d2e26fb0fb01e072b708547ad804234d262f Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Tue, 29 Dec 2020 13:42:59 +0100 Subject: [PATCH] Clean up output and update changelog --- CHANGELOG.md | 7 +++++++ redefinitions.lua | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 900b723..f17c80a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Changed + +- Refactor recipe override mechanism to avoid re-coding recipes + when we only want to change the amount produced. +- Realign rail recipe to the changes made in Minetest Game. All rail recipes + (standard, power, break) are boosted by 50%. + ### Fixed - [Fixed strange placement behavior for non-default Stairs+ nodes.](https://github.com/minetest-mods/moreblocks/pull/168) diff --git a/redefinitions.lua b/redefinitions.lua index ca0d9dc..e9c5ff7 100644 --- a/redefinitions.lua +++ b/redefinitions.lua @@ -5,6 +5,8 @@ Copyright © 2011-2020 Hugo Locurcio and contributors. Licensed under the zlib license. See LICENSE.md for more information. --]] +local modname = minetest.get_current_modname() + -- Redefine some of the default crafting recipes to be more productive -- Auxiliary function: take a recipe as returned by get_all_craft_recipes @@ -39,14 +41,13 @@ local change_recipe_amount = function(product, recipe, func) redo.output = ("%s %d"):format(product, newamount) minetest.register_craft(redo) - minetest.log(("moreblocks recipe for %s production: %d => %d"):format(product, oldamount, newamount)) + minetest.log("action", ("[MOD]%s: recipe for %s production: %d => %d"):format(modname, product, oldamount, newamount)) end 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 - minetest.log(dump(r)) change_recipe_amount(product, r, func) end end