Minetest-WorldEditAdditions/worldeditadditions/utils/selector_helps.lua
VorTechnix 489d856176 Added srect and basename
Also moved saplingaliases and corrected the block text in forest.lua
2021-02-24 08:40:53 -08:00

10 lines
356 B
Lua

function worldeditadditions.player_axis2d(name)
-- minetest.get_player_by_name("singleplayer"):
local dir = math.floor(minetest.get_player_by_name(name):get_look_horizontal() / math.pi * 2 + 0.5) % 3
local crdnl = { {1,"z"},{-1,"x"},{-1,"z"},{1,"x"} }
return crdnl[dir+1]
end
-- Tests
-- /lua print(unpack(worldeditadditions.player_axis2d(myname)))