diff options
author | Pokechu22 <Pokechu22@users.noreply.github.com> | 2016-05-14 21:12:42 +0200 |
---|---|---|
committer | Alexander Harkness <me@bearbin.net> | 2016-05-14 21:12:42 +0200 |
commit | a4f327118b06ced1cd4510b7d20d34da83aa78a3 (patch) | |
tree | d6dbd41cfbec99f2598fb51907b86d9cbe0e8a05 /Server/Plugins/Debuggers | |
parent | Fixed death on teleportation or leaving Minecart (#3181) (diff) | |
download | cuberite-a4f327118b06ced1cd4510b7d20d34da83aa78a3.tar cuberite-a4f327118b06ced1cd4510b7d20d34da83aa78a3.tar.gz cuberite-a4f327118b06ced1cd4510b7d20d34da83aa78a3.tar.bz2 cuberite-a4f327118b06ced1cd4510b7d20d34da83aa78a3.tar.lz cuberite-a4f327118b06ced1cd4510b7d20d34da83aa78a3.tar.xz cuberite-a4f327118b06ced1cd4510b7d20d34da83aa78a3.tar.zst cuberite-a4f327118b06ced1cd4510b7d20d34da83aa78a3.zip |
Diffstat (limited to 'Server/Plugins/Debuggers')
-rw-r--r-- | Server/Plugins/Debuggers/Debuggers.lua | 28 | ||||
-rw-r--r-- | Server/Plugins/Debuggers/Info.lua | 6 |
2 files changed, 34 insertions, 0 deletions
diff --git a/Server/Plugins/Debuggers/Debuggers.lua b/Server/Plugins/Debuggers/Debuggers.lua index 422993932..c11052071 100644 --- a/Server/Plugins/Debuggers/Debuggers.lua +++ b/Server/Plugins/Debuggers/Debuggers.lua @@ -2156,3 +2156,31 @@ end + +function HandleBlkCmd(a_Split, a_Player) + -- Gets info about the block the player is looking at. + local World = a_Player:GetWorld(); + + local Callbacks = { + OnNextBlock = function(a_BlockX, a_BlockY, a_BlockZ, a_BlockType, a_BlockMeta) + if (a_BlockType ~= E_BLOCK_AIR) then + a_Player:SendMessage("Block at " .. a_BlockX .. ", " .. a_BlockY .. ", " .. a_BlockZ .. " is " .. a_BlockType .. ":" .. a_BlockMeta) + return true; + end + end + }; + + local EyePos = a_Player:GetEyePosition(); + local LookVector = a_Player:GetLookVector(); + LookVector:Normalize(); + + local End = EyePos + LookVector * 50; + + cLineBlockTracer.Trace(World, Callbacks, EyePos.x, EyePos.y, EyePos.z, End.x, End.y, End.z); + + return true; +end + + + + diff --git a/Server/Plugins/Debuggers/Info.lua b/Server/Plugins/Debuggers/Info.lua index 99d3ebe74..51406c27c 100644 --- a/Server/Plugins/Debuggers/Info.lua +++ b/Server/Plugins/Debuggers/Info.lua @@ -202,6 +202,12 @@ g_PluginInfo = Handler = HandleRemoveXp, HelpString = "Remove all xp" }, + ["/blk"] = + { + Permission = "debuggers", + Handler = HandleBlkCmd, + HelpString = "Gets info about the block you are looking at" + }, }, -- Commands ConsoleCommands = |