From 0a703d7a11e37570b597d50798e1f2b41de181d6 Mon Sep 17 00:00:00 2001 From: Freeman Date: Thu, 19 Oct 2023 17:28:26 +0200 Subject: [PATCH] remove copy_tool --- fancyshop.lua | 140 +++++++++++++++++++++++++------------------------- 1 file changed, 71 insertions(+), 69 deletions(-) diff --git a/fancyshop.lua b/fancyshop.lua index 12f0991..6c067b8 100644 --- a/fancyshop.lua +++ b/fancyshop.lua @@ -128,16 +128,16 @@ if minetest.get_modpath("awards") then icon = "player_vend_front.png", }) - awards.register_achievement("fancy_vend:wizard",{ - title = "You're a Wizard", - description = S("Craft a copy tool."), - trigger = { - type = "craft", - item = "fancy_vend:copy_tool", - target = 1, - }, - icon = "copier.png", - }) + -- awards.register_achievement("fancy_vend:wizard",{ + -- title = "You're a Wizard", + -- description = S("Craft a copy tool."), + -- trigger = { + -- type = "craft", + -- item = "fancy_vend:copy_tool", + -- target = 1, + -- }, + -- icon = "copier.png", + -- }) awards.register_achievement("fancy_vend:trader",{ title = "Trader", @@ -1520,75 +1520,77 @@ local function get_vendor_pos_and_settings(pointed_thing) return pos, settings end -minetest.register_tool(":fancy_vend:copy_tool",{ - inventory_image = "copier.png", - description = S("Geminio Wand (For copying vendor settings, right click to save settings, left click to set settings.)"), - stack_max = 1, - on_place = function(itemstack, placer, pointed_thing) - local pos, settings = get_vendor_pos_and_settings(pointed_thing) - if not pos then return end +minetest.register_alias("fancy_vend:copy_tool", "mcl_core:emerald") + +-- minetest.register_tool(":fancy_vend:copy_tool",{ +-- inventory_image = "copier.png", +-- description = S("Geminio Wand (For copying vendor settings, right click to save settings, left click to set settings.)"), +-- stack_max = 1, +-- on_place = function(itemstack, placer, pointed_thing) +-- local pos, settings = get_vendor_pos_and_settings(pointed_thing) +-- if not pos then return end - local meta = itemstack:get_meta() - meta:set_string("settings", minetest.serialize(settings)) +-- local meta = itemstack:get_meta() +-- meta:set_string("settings", minetest.serialize(settings)) - minetest.chat_send_player(placer:get_player_name(), "Settings saved.") +-- minetest.chat_send_player(placer:get_player_name(), "Settings saved.") - return itemstack - end, - on_use = function(itemstack, user, pointed_thing) - local pos, current_settings = get_vendor_pos_and_settings(pointed_thing) - if not pos then return end +-- return itemstack +-- end, +-- on_use = function(itemstack, user, pointed_thing) +-- local pos, current_settings = get_vendor_pos_and_settings(pointed_thing) +-- if not pos then return end - local meta = itemstack:get_meta() - local node_meta = minetest.get_meta(pos) - local new_settings = minetest.deserialize(meta:get_string("settings")) - if not new_settings then - minetest.chat_send_player(user:get_player_name(), "No settings to set with. Right-click first on the vendor you want to copy settings from.") - return - end +-- local meta = itemstack:get_meta() +-- local node_meta = minetest.get_meta(pos) +-- local new_settings = minetest.deserialize(meta:get_string("settings")) +-- if not new_settings then +-- minetest.chat_send_player(user:get_player_name(), "No settings to set with. Right-click first on the vendor you want to copy settings from.") +-- return +-- end - if can_modify_vendor(pos, user) then - -- Admin vendor priv check - if not minetest.check_player_privs(node_meta:get_string("owner"), {admin_vendor=true}) and new_settings.admin_vendor == true then - settings.admin_vendor = false - end +-- if can_modify_vendor(pos, user) then +-- -- Admin vendor priv check +-- if not minetest.check_player_privs(node_meta:get_string("owner"), {admin_vendor=true}) and new_settings.admin_vendor == true then +-- settings.admin_vendor = false +-- end - new_settings.input_item = current_settings.input_item - new_settings.input_item_qty = current_settings.input_item_qty - new_settings.output_item = current_settings.output_item - new_settings.output_item_qty = current_settings.output_item_qty +-- new_settings.input_item = current_settings.input_item +-- new_settings.input_item_qty = current_settings.input_item_qty +-- new_settings.output_item = current_settings.output_item +-- new_settings.output_item_qty = current_settings.output_item_qty - -- Admin vendor priv check - if not minetest.check_player_privs(node_meta:get_string("owner"), {admin_vendor=true}) and new_settings.admin_vendor then - new_settings.admin_vendor = current_settings.admin_vendor - end +-- -- Admin vendor priv check +-- if not minetest.check_player_privs(node_meta:get_string("owner"), {admin_vendor=true}) and new_settings.admin_vendor then +-- new_settings.admin_vendor = current_settings.admin_vendor +-- end - set_vendor_settings(pos, new_settings) - refresh_vendor(pos) - minetest.chat_send_player(user:get_player_name(), "Settings set.") - else - minetest.chat_send_player(user:get_player_name(), "You cannot modify this vendor.") - end - end, -}) +-- set_vendor_settings(pos, new_settings) +-- refresh_vendor(pos) +-- minetest.chat_send_player(user:get_player_name(), "Settings set.") +-- else +-- minetest.chat_send_player(user:get_player_name(), "You cannot modify this vendor.") +-- end +-- end, +-- }) -minetest.register_craft({ - output = "fancy_vend:copy_tool", - recipe = { - {"mcl_core:stick","", "" }, - {"", "mcl_core:obsidian","" }, - {"", "", "mcl_core:emerald"}, - } -}) +-- minetest.register_craft({ +-- output = "fancy_vend:copy_tool", +-- recipe = { +-- {"mcl_core:stick","", "" }, +-- {"", "mcl_core:obsidian","" }, +-- {"", "", "mcl_core:emerald"}, +-- } +-- }) -minetest.register_craft({ - output = "fancy_vend:copy_tool", - recipe = { - {"", "", "mcl_core:stick"}, - {"", "mcl_core:obsidian","" }, - {"mcl_core:emerald", "", "" }, - } -}) +-- minetest.register_craft({ +-- output = "fancy_vend:copy_tool", +-- recipe = { +-- {"", "", "mcl_core:stick"}, +-- {"", "mcl_core:obsidian","" }, +-- {"mcl_core:emerald", "", "" }, +-- } +-- }) ---------------------------