summaryrefslogtreecommitdiffstats
path: root/Server/Plugins/Debuggers
diff options
context:
space:
mode:
Diffstat (limited to 'Server/Plugins/Debuggers')
-rw-r--r--Server/Plugins/Debuggers/Debuggers.lua28
-rw-r--r--Server/Plugins/Debuggers/Info.lua6
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 =