mirror of
https://github.com/minetest-mods/technic.git
synced 2024-11-16 15:30:42 +01:00
Fix quarry rotation (#68)
Previously the model was rotated but the dig position of the quarry was not updated. If the player did not restart the quarry through the formspec, it dug at the previous location.
This commit is contained in:
parent
4522961140
commit
35e989ba2e
|
@ -281,6 +281,20 @@ minetest.register_node("technic:quarry", {
|
||||||
reset_quarry(pos)
|
reset_quarry(pos)
|
||||||
set_quarry_status(pos)
|
set_quarry_status(pos)
|
||||||
end,
|
end,
|
||||||
|
on_rotate = function(pos, node, player, click, new_param2)
|
||||||
|
local meta = minetest.get_meta(pos)
|
||||||
|
if meta:get_int("enabled") == 1 then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
-- only allow rotation around y-axis
|
||||||
|
node.param2 = new_param2 % 4
|
||||||
|
|
||||||
|
minetest.swap_node(pos, node)
|
||||||
|
reset_quarry(pos)
|
||||||
|
set_quarry_status(pos)
|
||||||
|
return true
|
||||||
|
end,
|
||||||
after_place_node = function(pos, placer, itemstack)
|
after_place_node = function(pos, placer, itemstack)
|
||||||
minetest.get_meta(pos):set_string("owner", placer:get_player_name())
|
minetest.get_meta(pos):set_string("owner", placer:get_player_name())
|
||||||
pipeworks.scan_for_tube_objects(pos)
|
pipeworks.scan_for_tube_objects(pos)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user