From 634631a8e9639c595eff913d449e2dc99e9a5e99 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Tue, 15 Jun 2021 01:23:49 +0200 Subject: [PATCH] added blacklist for quest items --- config.lua | 4 ++++ fs_edit_general.lua | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/config.lua b/config.lua index 58e0de0..9d3bb89 100644 --- a/config.lua +++ b/config.lua @@ -49,3 +49,7 @@ yl_speak_up.blacklist_effect_on_block_place = {} yl_speak_up.blacklist_effect_on_block_dig = {} yl_speak_up.blacklist_effect_on_block_punch = {} yl_speak_up.blacklist_effect_on_block_right_click = {} + +-- If some items are for some reasons not at all acceptable as quest items, +-- blacklist them here. The data structure is the same as for the tables above. +yl_speak_up.blacklist_action_quest_item = {} diff --git a/fs_edit_general.lua b/fs_edit_general.lua index c089fba..c73fa30 100644 --- a/fs_edit_general.lua +++ b/fs_edit_general.lua @@ -454,6 +454,16 @@ yl_speak_up.input_fs_edit_option_related = function(player, formname, fields, "button[1.5,2.0;2,0.9;back_from_error_msg;Back]"}) return end + -- is this particular item blacklisted on this server? + if(yl_speak_up.blacklist_action_quest_item[ stack:get_name() ]) then + yl_speak_up.show_fs(player, "msg", { + input_to = "yl_speak_up:"..formspec_input_to, + formspec = "size[9,2.5]".. + "label[0.2,0.5;Sorry. This item is blacklisted on this ".. + "server.\nYou can't use it as a quest item.]".. + "button[1.5,2.0;2,0.9;back_from_error_msg;Back]"}) + return + end local meta = stack:get_meta() -- what does the NPC want to give? v[ "a_value" ] = stack:get_name().." "..stack:get_count()