mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-12-26 11:17:30 +01:00
Add function for colorwallmounted node rotation
This commit adds a new utility function which helps find the rotation of `colorwallmounted` nodes.
This commit is contained in:
parent
9972b055c5
commit
4659d1a0f1
@ -1033,3 +1033,13 @@ function mcl_util.get_palette_indexes_from_pos(pos)
|
|||||||
return palette_indexes
|
return palette_indexes
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function mcl_util.get_colorwallmounted_rotation(pos)
|
||||||
|
local colorwallmounted_node = minetest.get_node(pos)
|
||||||
|
for i = 0, 32, 1 do
|
||||||
|
local colorwallmounted_rotation = colorwallmounted_node.param2 - (i * 8)
|
||||||
|
if colorwallmounted_rotation < 6 then
|
||||||
|
return colorwallmounted_rotation
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user