Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable or disable crafting recipes for coins #29

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
44 changes: 28 additions & 16 deletions craftitems.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@ 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"),
Expand All @@ -29,12 +33,16 @@ 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", {
Expand All @@ -44,11 +52,15 @@ 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"),
Expand Down
3 changes: 3 additions & 0 deletions settingtypes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# If true enables coin crafting recipes. If false or omitted, disables coin crafting recipes
# Takes effect only during loadtime.
maptools.enable_coin_crafting (Enable crafting recipes for coins) bool false