mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-12-25 01:19:33 +01:00
Disallow to place ladders on some other nodes
This commit is contained in:
parent
a7fdfa13ef
commit
5f20b18d32
1 changed files with 11 additions and 3 deletions
|
@ -1171,11 +1171,19 @@ minetest.register_node("mcl_core:ladder", {
|
||||||
|
|
||||||
local under = pointed_thing.under
|
local under = pointed_thing.under
|
||||||
local node = minetest.get_node(under)
|
local node = minetest.get_node(under)
|
||||||
|
|
||||||
local def = minetest.registered_nodes[node.name]
|
local def = minetest.registered_nodes[node.name]
|
||||||
|
local groups = def.groups
|
||||||
|
if (groups and (groups.glass or groups.leaves or groups.slab)) or
|
||||||
|
node.name == "mcl_core:ice" or node.name == "mcl_nether:glowstone" or node.name == "mcl_ocean:sea_lantern" then
|
||||||
|
return itemstack
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Check special rightclick action of pointed node
|
||||||
if def and def.on_rightclick then
|
if def and def.on_rightclick then
|
||||||
return def.on_rightclick(under, node, placer, itemstack,
|
if not placer:get_player_control().sneak then
|
||||||
pointed_thing) or itemstack, false
|
return def.on_rightclick(under, node, placer, itemstack,
|
||||||
|
pointed_thing) or itemstack, false
|
||||||
|
end
|
||||||
end
|
end
|
||||||
local above = pointed_thing.above
|
local above = pointed_thing.above
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue