From 3ba4aabbcff6c4682a88df0cf099e55fc26d5844 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 9 Feb 2019 00:17:25 +0100 Subject: [PATCH] Check for protection when using anvil formspec --- mods/ITEMS/mcl_anvils/init.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mods/ITEMS/mcl_anvils/init.lua b/mods/ITEMS/mcl_anvils/init.lua index 3863583f7..8b3717a34 100644 --- a/mods/ITEMS/mcl_anvils/init.lua +++ b/mods/ITEMS/mcl_anvils/init.lua @@ -407,6 +407,11 @@ local anvildef = { meta:set_string("formspec", form) end, on_receive_fields = function(pos, formname, fields, sender) + local sender_name = sender:get_player_name() + if minetest.is_protected(pos, sender_name) then + minetest.record_protection_violation(pos, sender_name) + return + end if fields.name_button or fields.name then local set_name if fields.name == nil then