added blacklist for quest items

This commit is contained in:
Sokomine 2021-06-15 01:23:49 +02:00
parent 9e4e0b9b26
commit 634631a8e9
2 changed files with 14 additions and 0 deletions

View File

@ -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 = {}

View File

@ -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()