mirror of
https://git.minetest.land/Mineclonia/Mineclonia.git
synced 2024-11-18 00:05:12 +00:00
Correct stair/slab rightclick handling
This commit is contained in:
parent
979246a7c5
commit
dde6c678ad
1 changed files with 16 additions and 0 deletions
|
@ -1,4 +1,12 @@
|
||||||
local function place_slab_normal(itemstack, placer, pointed_thing)
|
local function place_slab_normal(itemstack, placer, pointed_thing)
|
||||||
|
-- Use pointed node's on_rightclick function first, if present
|
||||||
|
local node = minetest.get_node(pointed_thing.under)
|
||||||
|
if placer and not placer:get_player_control().sneak then
|
||||||
|
if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].on_rightclick then
|
||||||
|
return minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer, itemstack) or itemstack
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local p0 = pointed_thing.under
|
local p0 = pointed_thing.under
|
||||||
local p1 = pointed_thing.above
|
local p1 = pointed_thing.above
|
||||||
|
|
||||||
|
@ -19,6 +27,14 @@ local function place_slab_normal(itemstack, placer, pointed_thing)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function place_stair(itemstack, placer, pointed_thing)
|
local function place_stair(itemstack, placer, pointed_thing)
|
||||||
|
-- Use pointed node's on_rightclick function first, if present
|
||||||
|
local node = minetest.get_node(pointed_thing.under)
|
||||||
|
if placer and not placer:get_player_control().sneak then
|
||||||
|
if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].on_rightclick then
|
||||||
|
return minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer, itemstack) or itemstack
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local p0 = pointed_thing.under
|
local p0 = pointed_thing.under
|
||||||
local p1 = pointed_thing.above
|
local p1 = pointed_thing.above
|
||||||
local param2 = 0
|
local param2 = 0
|
||||||
|
|
Loading…
Reference in a new issue