From 9915ec18528385d174a61f268a630983b34fba2c Mon Sep 17 00:00:00 2001 From: AliasAlreadyTaken Date: Sun, 27 Jun 2021 01:51:29 +0200 Subject: [PATCH 1/3] Disable crafting recipes for coins by default Crafting recipes for coins can be enabled again by setting `maptools.enable_coin_crafting = true` in `minetest.conf`. --- config.lua | 2 ++ craftitems.lua | 38 ++++++++++++++++++++++---------------- docs/CHANGELOG.md | 3 +++ settingtypes.txt | 3 +++ 4 files changed, 30 insertions(+), 16 deletions(-) create mode 100644 settingtypes.txt diff --git a/config.lua b/config.lua index b980fc3..d574a0c 100644 --- a/config.lua +++ b/config.lua @@ -27,3 +27,5 @@ end -- Show Map Tools stuff in creative inventory (1 or 0): setting("integer", "hide_from_creative_inventory", 1) +-- Enable crafting recipes for coins (true or false): +setting("bool", "enable_coin_crafting", false) diff --git a/craftitems.lua b/craftitems.lua index 3bc72bb..ae9e4cd 100644 --- a/craftitems.lua +++ b/craftitems.lua @@ -16,11 +16,13 @@ minetest.register_craftitem("maptools:copper_coin", { stack_max = 10000, }) -minetest.register_craft({ - output = "maptools:copper_coin 10", - type = "shapeless", - recipe = { "default:copper_ingot", "default:copper_ingot" } -}) +if maptools.config and maptools.config.enable_coin_crafting then + minetest.register_craft({ + output = "maptools:copper_coin 10", + type = "shapeless", + recipe = { "default:copper_ingot", "default:copper_ingot" } + }) +end minetest.register_craftitem("maptools:silver_coin", { description = S("Silver Coin"), @@ -29,12 +31,14 @@ minetest.register_craftitem("maptools:silver_coin", { stack_max = 10000, }) -if minetest.get_modpath("moreores") then - minetest.register_craft({ - output = "maptools:silver_coin 10", - type = "shapeless", - recipe = { "moreores:silver_ingot", "moreores:silver_ingot" } - }) +if maptools.config and maptools.config.enable_coin_crafting then + if minetest.get_modpath("moreores") then + minetest.register_craft({ + output = "maptools:silver_coin 10", + type = "shapeless", + recipe = { "moreores:silver_ingot", "moreores:silver_ingot" } + }) + end end minetest.register_craftitem("maptools:gold_coin", { @@ -44,11 +48,13 @@ minetest.register_craftitem("maptools:gold_coin", { stack_max = 10000, }) -minetest.register_craft({ - output = "maptools:gold_coin 10", - type = "shapeless", - recipe = { "default:gold_ingot", "default:gold_ingot" } -}) +if maptools.config and maptools.config.enable_coin_crafting then + minetest.register_craft({ + output = "maptools:gold_coin 10", + type = "shapeless", + recipe = { "default:gold_ingot", "default:gold_ingot" } + }) +end minetest.register_craftitem("maptools:infinitefuel", { description = S("Infinite Fuel"), diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index c51cbe7..1fe425c 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Changed +- Disabled crafting recipes for coins by default. + - They can be enabled again by setting `maptools.enable_coin_crafting = true` + in `minetest.conf`. - Map Tools nodes can no longer be exploded by TNT. - Switched from Travis CI to GitHub Actions for continuous integration. diff --git a/settingtypes.txt b/settingtypes.txt new file mode 100644 index 0000000..d820301 --- /dev/null +++ b/settingtypes.txt @@ -0,0 +1,3 @@ +# If `true`, enables coin crafting recipes. If `false`, disables coin crafting recipes. +# Takes effect only at load-time; runtime changes to this setting are ignored. +maptools.enable_coin_crafting (Enable crafting recipes for coins) bool false From e3ca31cdb9a9326d0be498673cc0a80abbe2e8ec Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Tue, 29 Jun 2021 00:33:43 +0200 Subject: [PATCH 2/3] Bump to version 2.2.0 --- docs/CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 1fe425c..af3cefb 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [2.2.0] - 2021-06-28 + ### Changed - Disabled crafting recipes for coins by default. @@ -51,7 +53,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Initial versioned release. -[Unreleased]: https://github.com/minetest-mods/maptools/compare/v2.1.0...HEAD +[Unreleased]: https://github.com/minetest-mods/maptools/compare/v2.2.0...HEAD +[2.2.0]: https://github.com/minetest-mods/maptools/compare/v2.1.0...v2.2.0 [2.1.0]: https://github.com/minetest-mods/maptools/compare/v2.0.0...v2.1.0 [2.0.0]: https://github.com/minetest-mods/maptools/compare/v1.1.0...v2.0.0 [1.1.0]: https://github.com/minetest-mods/maptools/compare/v1.0.0...v1.1.0 From d1134c47afca946ce49ef9ee287fd367733a79e0 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Tue, 29 Jun 2021 00:44:54 +0200 Subject: [PATCH 3/3] Link to the pull request disabling coin crafting in the changelog --- docs/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index af3cefb..9dfd88d 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Changed -- Disabled crafting recipes for coins by default. +- [Disabled crafting recipes for coins by default.](https://github.com/minetest-mods/maptools/pull/29) - They can be enabled again by setting `maptools.enable_coin_crafting = true` in `minetest.conf`. - Map Tools nodes can no longer be exploded by TNT.