mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-28 05:21:05 +01:00
vl_pickblock: fix rightclick broken in survival
This commit is contained in:
parent
281c531533
commit
128676d098
1 changed files with 6 additions and 6 deletions
|
@ -20,6 +20,8 @@ local function pickblock(itemstack, placer, pointed_thing)
|
||||||
rnode = node.name
|
rnode = node.name
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- check if the picked node is already on the hotbar
|
||||||
|
-- if so, notify the player
|
||||||
local inv = placer:get_inventory()
|
local inv = placer:get_inventory()
|
||||||
for i=1,placer:hud_get_hotbar_itemcount() do
|
for i=1,placer:hud_get_hotbar_itemcount() do
|
||||||
local stack = inv:get_stack("main", i)
|
local stack = inv:get_stack("main", i)
|
||||||
|
@ -35,12 +37,10 @@ end
|
||||||
|
|
||||||
minetest.override_item("", {
|
minetest.override_item("", {
|
||||||
on_place = function(itemstack, placer, pointed_thing)
|
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
|
if mcl_util.call_on_rightclick(itemstack, placer, pointed_thing) then
|
||||||
return
|
return
|
||||||
else
|
elseif minetest.is_creative_enabled(placer:get_player_name()) then
|
||||||
return pickblock(itemstack, placer, pointed_thing)
|
return pickblock(itemstack, placer, pointed_thing)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue