From 82251995205b7ffe510a30b90e4187d67d4448fd Mon Sep 17 00:00:00 2001 From: VorTechnix <45538536+VorTechnix@users.noreply.github.com> Date: Wed, 28 Jul 2021 18:06:10 -0700 Subject: [PATCH] renamed axes.lua to player.lua --- worldeditadditions/init.lua | 2 +- worldeditadditions/utils/{axes.lua => player.lua} | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) rename worldeditadditions/utils/{axes.lua => player.lua} (85%) diff --git a/worldeditadditions/init.lua b/worldeditadditions/init.lua index a01356e..ce7924d 100644 --- a/worldeditadditions/init.lua +++ b/worldeditadditions/init.lua @@ -31,7 +31,7 @@ dofile(wea.modpath.."/utils/nodes.lua") dofile(wea.modpath.."/utils/node_identification.lua") dofile(wea.modpath.."/utils/terrain.lua") 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") diff --git a/worldeditadditions/utils/axes.lua b/worldeditadditions/utils/player.lua similarity index 85% rename from worldeditadditions/utils/axes.lua rename to worldeditadditions/utils/player.lua index dd7b3a6..a402fb1 100644 --- a/worldeditadditions/utils/axes.lua +++ b/worldeditadditions/utils/player.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. -- @param name string The name of the player to return facing direction of. -- @return Returns axis name and sign multiplier. 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 x, z= math.abs(dir.x), math.abs(dir.z) if x > z then return "x", dir.x > 0 and 1 or -1