|
|
|
@ -18,13 +18,13 @@ minetest.registered_items[""].on_place = function(item_stack, placer, pointed_th |
|
|
|
|
local node = minetest.get_node(pos) |
|
|
|
|
if registry.is_rotatable(node) then |
|
|
|
|
local def = minetest.registered_nodes[node.name] |
|
|
|
|
def.on_rightclick(pos, node, placer, item_stack, pointed_thing) |
|
|
|
|
return -- Skip default behavior. |
|
|
|
|
return def.on_rightclick(pos, node, placer, item_stack, pointed_thing) |
|
|
|
|
-- Skip default behavior. |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
-- Call the default function, so we can still get the "scaling" functionality. |
|
|
|
|
default_on_place(item_stack, placer, pointed_thing, ...) |
|
|
|
|
return default_on_place(item_stack, placer, pointed_thing, ...) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
local rotate_node = nc_extended_rotating.rotate.rotate_node |
|
|
|
@ -39,7 +39,7 @@ function registry.register_rotatable(name, def, rightclick_filter_func) |
|
|
|
|
def.on_rightclick = function(pos, node, clicker, ...) |
|
|
|
|
-- If `rightclick_filter_func` is set and returns true, call the default `on_rightclick`. |
|
|
|
|
if registry.is_rightclick_filtered(pos, node, clicker, ...) then |
|
|
|
|
default_on_rightclick(pos, node, clicker, ...) |
|
|
|
|
return default_on_rightclick(pos, node, clicker, ...) |
|
|
|
|
else |
|
|
|
|
if nodecore.protection_test(pos, clicker) then return end |
|
|
|
|
local state = nc_extended_rotating.state.get_rotating_state(clicker, pos, node) |
|
|
|
|