Skip to content

Commit 9915ec1

Browse files
AliasAlreadyTakenCalinou
authored andcommitted
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`.
1 parent fd9476c commit 9915ec1

File tree

4 files changed

+30
-16
lines changed

4 files changed

+30
-16
lines changed

config.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,5 @@ end
2727

2828
-- Show Map Tools stuff in creative inventory (1 or 0):
2929
setting("integer", "hide_from_creative_inventory", 1)
30+
-- Enable crafting recipes for coins (true or false):
31+
setting("bool", "enable_coin_crafting", false)

craftitems.lua

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ minetest.register_craftitem("maptools:copper_coin", {
1616
stack_max = 10000,
1717
})
1818

19-
minetest.register_craft({
20-
output = "maptools:copper_coin 10",
21-
type = "shapeless",
22-
recipe = { "default:copper_ingot", "default:copper_ingot" }
23-
})
19+
if maptools.config and maptools.config.enable_coin_crafting then
20+
minetest.register_craft({
21+
output = "maptools:copper_coin 10",
22+
type = "shapeless",
23+
recipe = { "default:copper_ingot", "default:copper_ingot" }
24+
})
25+
end
2426

2527
minetest.register_craftitem("maptools:silver_coin", {
2628
description = S("Silver Coin"),
@@ -29,12 +31,14 @@ minetest.register_craftitem("maptools:silver_coin", {
2931
stack_max = 10000,
3032
})
3133

32-
if minetest.get_modpath("moreores") then
33-
minetest.register_craft({
34-
output = "maptools:silver_coin 10",
35-
type = "shapeless",
36-
recipe = { "moreores:silver_ingot", "moreores:silver_ingot" }
37-
})
34+
if maptools.config and maptools.config.enable_coin_crafting then
35+
if minetest.get_modpath("moreores") then
36+
minetest.register_craft({
37+
output = "maptools:silver_coin 10",
38+
type = "shapeless",
39+
recipe = { "moreores:silver_ingot", "moreores:silver_ingot" }
40+
})
41+
end
3842
end
3943

4044
minetest.register_craftitem("maptools:gold_coin", {
@@ -44,11 +48,13 @@ minetest.register_craftitem("maptools:gold_coin", {
4448
stack_max = 10000,
4549
})
4650

47-
minetest.register_craft({
48-
output = "maptools:gold_coin 10",
49-
type = "shapeless",
50-
recipe = { "default:gold_ingot", "default:gold_ingot" }
51-
})
51+
if maptools.config and maptools.config.enable_coin_crafting then
52+
minetest.register_craft({
53+
output = "maptools:gold_coin 10",
54+
type = "shapeless",
55+
recipe = { "default:gold_ingot", "default:gold_ingot" }
56+
})
57+
end
5258

5359
minetest.register_craftitem("maptools:infinitefuel", {
5460
description = S("Infinite Fuel"),

docs/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
99

1010
### Changed
1111

12+
- Disabled crafting recipes for coins by default.
13+
- They can be enabled again by setting `maptools.enable_coin_crafting = true`
14+
in `minetest.conf`.
1215
- Map Tools nodes can no longer be exploded by TNT.
1316
- Switched from Travis CI to GitHub Actions for continuous integration.
1417

settingtypes.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# If `true`, enables coin crafting recipes. If `false`, disables coin crafting recipes.
2+
# Takes effect only at load-time; runtime changes to this setting are ignored.
3+
maptools.enable_coin_crafting (Enable crafting recipes for coins) bool false

0 commit comments

Comments
 (0)