From 128676d098dc8c19e0aa8e5ddb59df293b34c389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikita=20Wi=C5=9Bniewski?= Date: Sat, 3 Aug 2024 13:57:34 +0700 Subject: [PATCH] vl_pickblock: fix rightclick broken in survival --- mods/PLAYER/vl_pickblock/init.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mods/PLAYER/vl_pickblock/init.lua b/mods/PLAYER/vl_pickblock/init.lua index 1e61b7c04..a5a542d16 100644 --- a/mods/PLAYER/vl_pickblock/init.lua +++ b/mods/PLAYER/vl_pickblock/init.lua @@ -20,6 +20,8 @@ local function pickblock(itemstack, placer, pointed_thing) rnode = node.name end + -- check if the picked node is already on the hotbar + -- if so, notify the player local inv = placer:get_inventory() for i=1,placer:hud_get_hotbar_itemcount() do local stack = inv:get_stack("main", i) @@ -35,12 +37,10 @@ end minetest.override_item("", { on_place = function(itemstack, placer, pointed_thing) - if minetest.is_creative_enabled(placer:get_player_name()) then - if mcl_util.call_on_rightclick(itemstack, placer, pointed_thing) then - return - else - return pickblock(itemstack, placer, pointed_thing) - end + if mcl_util.call_on_rightclick(itemstack, placer, pointed_thing) then + return + elseif minetest.is_creative_enabled(placer:get_player_name()) then + return pickblock(itemstack, placer, pointed_thing) end end })