diff options
author | Mattes D <github@xoft.cz> | 2020-04-14 16:43:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-14 16:43:21 +0200 |
commit | c9a9b3c9d0d4fed0b02d9935923bfd7dcbc45d1e (patch) | |
tree | 7d7ba1d772d1f4994773f325046a4e6229c91d16 /Server/Plugins | |
parent | Pressure plate sounds and delay (#4643) (diff) | |
download | cuberite-c9a9b3c9d0d4fed0b02d9935923bfd7dcbc45d1e.tar cuberite-c9a9b3c9d0d4fed0b02d9935923bfd7dcbc45d1e.tar.gz cuberite-c9a9b3c9d0d4fed0b02d9935923bfd7dcbc45d1e.tar.bz2 cuberite-c9a9b3c9d0d4fed0b02d9935923bfd7dcbc45d1e.tar.lz cuberite-c9a9b3c9d0d4fed0b02d9935923bfd7dcbc45d1e.tar.xz cuberite-c9a9b3c9d0d4fed0b02d9935923bfd7dcbc45d1e.tar.zst cuberite-c9a9b3c9d0d4fed0b02d9935923bfd7dcbc45d1e.zip |
Diffstat (limited to 'Server/Plugins')
-rw-r--r-- | Server/Plugins/Debuggers/Debuggers.lua | 20 | ||||
-rw-r--r-- | Server/Plugins/Debuggers/Info.lua | 8 |
2 files changed, 28 insertions, 0 deletions
diff --git a/Server/Plugins/Debuggers/Debuggers.lua b/Server/Plugins/Debuggers/Debuggers.lua index 1505904a8..657599b84 100644 --- a/Server/Plugins/Debuggers/Debuggers.lua +++ b/Server/Plugins/Debuggers/Debuggers.lua @@ -1727,6 +1727,26 @@ end +function HandleVectorCmd(a_Split, a_Player) + a_Player:SendMessage("Testing the Vector3 APIs...") + + -- Test the Vector3 coercion in ManualBindings - any Vector3 type should be accepted for any Vector3 parameter: + local pos = a_Player:GetPosition() + local c = cCuboid:new() + c:Assign(pos - Vector3d(2, 2, 2), pos + Vector3d(2, 2, 2)) + assert(c:IsInside(Vector3d(pos))) + assert(c:IsInside(Vector3f(pos))) + assert(c:IsInside(Vector3i(pos))) + assert(c:IsInside({pos.x, pos.y, pos.z})) + + a_Player:SendMessage("Test successful.") + return true +end + + + + + function HandleWESel(a_Split, a_Player) -- Check if the selection is a cuboid: local IsCuboid = cPluginManager:CallPlugin("WorldEdit", "IsPlayerSelectionCuboid") diff --git a/Server/Plugins/Debuggers/Info.lua b/Server/Plugins/Debuggers/Info.lua index 734b27e97..6fbd90e58 100644 --- a/Server/Plugins/Debuggers/Info.lua +++ b/Server/Plugins/Debuggers/Info.lua @@ -260,6 +260,14 @@ g_PluginInfo = Handler = HandleTestWndCmd, HelpString = "Opens up a window using plugin API" }, + + ["/vector"] = + { + Permission = "debuggers", + Handler = HandleVectorCmd, + HelpString = "Tests the Vector3 API", + }, + ["/wesel"] = { Permission = "debuggers", |