From decf90ac922d17b00daa3487ed842a57969dc1bb Mon Sep 17 00:00:00 2001 From: Freeman Date: Fri, 18 Aug 2023 05:43:36 +0200 Subject: [PATCH] craft shops and old shops settings --- fancyshop.lua | 20 ++++++++++++-------- settingtypes.txt | 3 +++ shop.lua | 4 ++-- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/fancyshop.lua b/fancyshop.lua index 5a85de9..c06ab21 100644 --- a/fancyshop.lua +++ b/fancyshop.lua @@ -25,6 +25,8 @@ local S = core.get_translator(core.get_current_modname()) local settings = minetest.settings +local shopcraft = core.settings:get_bool("emeraldbank.shop_craft") or true + local display_node = (settings:get("fancy_vend.display_node") or "mcl_core:glass") local max_logs = (tonumber(settings:get("fancy_vend.log_max")) or 40) local autorotate_speed = (tonumber(settings:get("fancy_vend.autorotate_speed")) or 1) @@ -1483,14 +1485,16 @@ minetest.register_node(":fancy_vend:player_depo", player_depo) minetest.register_node(":fancy_vend:admin_vendor", admin_vendor) minetest.register_node(":fancy_vend:admin_depo", admin_depo) -minetest.register_craft({ - output = "fancy_vend:player_vendor", - recipe = { - { "mcl_core:gold_ingot",display_node, "mcl_core:gold_ingot"}, - { "mcl_core:diamond", "mesecons:redstone", "mcl_core:diamond"}, - { "mcl_core:gold_ingot","mcl_chests:chest","mcl_core:gold_ingot"}, - } -}) +if shopcraft then + minetest.register_craft({ + output = "fancy_vend:player_vendor", + recipe = { + { "mcl_core:gold_ingot", display_node, "mcl_core:gold_ingot"}, + { "mcl_core:diamond", "mesecons:redstone", "mcl_core:diamond"}, + { "mcl_core:gold_ingot","mcl_chests:chest","mcl_core:gold_ingot"}, + } + }) +end -- Hopper support if minetest.get_modpath("hopper") then diff --git a/settingtypes.txt b/settingtypes.txt index a6cf228..88520a4 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -7,6 +7,9 @@ emeraldbank.bank_craft (bank craft) bool true # If true shop can be crafted emeraldbank.shop_craft (shop craft) bool true +# If true old shop can be crafted +emeraldbank.old_shop_craft (old shop craft) bool false + # If true, bank will give emeralds to players for gamed time emeraldbank.income_enabled (Is income enabled?) bool true diff --git a/shop.lua b/shop.lua index 94aa173..0364eff 100644 --- a/shop.lua +++ b/shop.lua @@ -20,7 +20,7 @@ local S = core.get_translator(core.get_current_modname()) -local shopcraft = core.settings:get_bool("emeraldbank.shop_craft") or true +local oldshopcraft = core.settings:get_bool("emeraldbank.old_shop_craft") or false -- privilege core.register_privilege("admin_shop", { @@ -340,7 +340,7 @@ core.register_on_player_receive_fields(function(sender, formname, fields) end) -if shopcraft then +if oldshopcraft then core.register_craft({ output = "emeraldbank:shop 3", recipe = {