From 82b9a549804682e688857614f294e6a37620d29a Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Sun, 17 Jan 2021 00:27:51 +0100 Subject: [PATCH] Add check --- init.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index b1c71a1..b1c0ef3 100644 --- a/init.lua +++ b/init.lua @@ -2328,6 +2328,7 @@ local trash = core.create_detached_inventory("i3_trash", { inv:set_list(listname, {}) local name = player:get_player_name() + if not creative_enabled(name) then set_fs(player) end @@ -2336,10 +2337,13 @@ local trash = core.create_detached_inventory("i3_trash", { trash:set_size("main", 1) -core.register_on_player_inventory_action(function(player, action, inv, info) - if (info.from_list == "main" and info.to_list == "craft") or - (info.from_list == "craft" and info.to_list == "main") or - (info.from_list == "craftresult" and info.to_list == "main") then +core.register_on_player_inventory_action(function(player, _, _, info) + local name = player:get_player_name() + + if not creative_enabled(name) and + ((info.from_list == "main" and info.to_list == "craft") or + (info.from_list == "craft" and info.to_list == "main") or + (info.from_list == "craftresult" and info.to_list == "main")) then set_fs(player) end end)