renamed axes.lua to player.lua

This commit is contained in:
VorTechnix 2021-07-28 18:06:10 -07:00
parent 43a59b68ff
commit 8225199520
2 changed files with 8 additions and 2 deletions

@ -31,7 +31,7 @@ dofile(wea.modpath.."/utils/nodes.lua")
dofile(wea.modpath.."/utils/node_identification.lua") dofile(wea.modpath.."/utils/node_identification.lua")
dofile(wea.modpath.."/utils/terrain.lua") dofile(wea.modpath.."/utils/terrain.lua")
dofile(wea.modpath.."/utils/raycast_adv.lua") -- For the farwand dofile(wea.modpath.."/utils/raycast_adv.lua") -- For the farwand
dofile(wea.modpath.."/utils/axes.lua") dofile(wea.modpath.."/utils/player.lua") -- Player info functions
dofile(wea.modpath.."/lib/compat/saplingnames.lua") dofile(wea.modpath.."/lib/compat/saplingnames.lua")

@ -1,8 +1,14 @@
-- Returns the player's position (at leg level).
-- @param name string The name of the player to return facing direction of.
-- @return Returns position.
function worldeditadditions.player_vector(name)
return minetest.get_player_by_name(name):get_pos()
end
-- Returns the player's facing direction on the horizontal axes only. -- Returns the player's facing direction on the horizontal axes only.
-- @param name string The name of the player to return facing direction of. -- @param name string The name of the player to return facing direction of.
-- @return Returns axis name and sign multiplier. -- @return Returns axis name and sign multiplier.
function worldeditadditions.player_axis2d(name) function worldeditadditions.player_axis2d(name)
-- minetest.get_player_by_name("singleplayer"): -- minetest.get_player_by_name("singleplayer"):
local dir = minetest.get_player_by_name(name):get_look_dir() local dir = minetest.get_player_by_name(name):get_look_dir()
local x, z= math.abs(dir.x), math.abs(dir.z) local x, z= math.abs(dir.x), math.abs(dir.z)
if x > z then return "x", dir.x > 0 and 1 or -1 if x > z then return "x", dir.x > 0 and 1 or -1