summaryrefslogtreecommitdiffstats
path: root/Server/Plugins/Debuggers/Debuggers.lua
diff options
context:
space:
mode:
authorPokechu22 <Pokechu22@users.noreply.github.com>2016-05-14 21:12:42 +0200
committerAlexander Harkness <me@bearbin.net>2016-05-14 21:12:42 +0200
commita4f327118b06ced1cd4510b7d20d34da83aa78a3 (patch)
treed6dbd41cfbec99f2598fb51907b86d9cbe0e8a05 /Server/Plugins/Debuggers/Debuggers.lua
parentFixed death on teleportation or leaving Minecart (#3181) (diff)
downloadcuberite-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/Debuggers.lua')
-rw-r--r--Server/Plugins/Debuggers/Debuggers.lua28
1 files changed, 28 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
+
+
+
+