diff options
author | madmaxoft <github@xoft.cz> | 2014-02-18 13:06:38 +0100 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-02-18 13:49:23 +0100 |
commit | 71b6fd3da92f5d0956a67e9185b823b6d9e207ef (patch) | |
tree | dd0d4f2241377ec5babe0881676f2eefdfa08634 /MCServer | |
parent | Added cWorld:SetAreaBiome() API function. (diff) | |
download | cuberite-71b6fd3da92f5d0956a67e9185b823b6d9e207ef.tar cuberite-71b6fd3da92f5d0956a67e9185b823b6d9e207ef.tar.gz cuberite-71b6fd3da92f5d0956a67e9185b823b6d9e207ef.tar.bz2 cuberite-71b6fd3da92f5d0956a67e9185b823b6d9e207ef.tar.lz cuberite-71b6fd3da92f5d0956a67e9185b823b6d9e207ef.tar.xz cuberite-71b6fd3da92f5d0956a67e9185b823b6d9e207ef.tar.zst cuberite-71b6fd3da92f5d0956a67e9185b823b6d9e207ef.zip |
Diffstat (limited to '')
-rw-r--r-- | MCServer/Plugins/Debuggers/Debuggers.lua | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua index 60e84c947..66894d835 100644 --- a/MCServer/Plugins/Debuggers/Debuggers.lua +++ b/MCServer/Plugins/Debuggers/Debuggers.lua @@ -55,6 +55,7 @@ function Initialize(Plugin) PM:BindCommand("/sched", "debuggers", HandleSched, "- Schedules a simple countdown using cWorld:ScheduleTask()"); PM:BindCommand("/cs", "debuggers", HandleChunkStay, "- Tests the ChunkStay Lua integration for the specified chunk coords"); PM:BindCommand("/compo", "debuggers", HandleCompo, "- Tests the cCompositeChat bindings") + PM:BindCommand("/sb", "debuggers", HandleSetBiome, "- Sets the biome around you to the specified one"); Plugin:AddWebTab("Debuggers", HandleRequest_Debuggers) Plugin:AddWebTab("StressTest", HandleRequest_StressTest) @@ -1218,3 +1219,42 @@ end + +function HandleSetBiome(a_Split, a_Player) + local Biome = biJungle + local Size = 20 + local SplitSize = #a_Split + if (SplitSize > 3) then + a_Player:SendMessage("Too many parameters. Usage: " .. a_Split[1] .. " <BiomeType>") + return true + end + + if (SplitSize >= 2) then + Biome = StringToBiome(a_Split[2]) + if (Biome == biInvalidBiome) then + a_Player:SendMessage("Unknown biome: '" .. a_Split[2] .. "'. Command ignored.") + return true + end + end + if (SplitSize >= 3) then + Size = tostring(a_Split[3]) + if (Size == nil) then + a_Player:SendMessage("Unknown size: '" .. a_Split[3] .. "'. Command ignored.") + return true + end + end + + local BlockX = math.floor(a_Player:GetPosX()) + local BlockZ = math.floor(a_Player:GetPosZ()) + a_Player:GetWorld():SetAreaBiome(BlockX - Size, BlockX + Size, BlockZ - Size, BlockZ + Size, Biome) + a_Player:SendMessage( + "Blocks {" .. (BlockX - Size) .. ", " .. (BlockZ - Size) .. + "} - {" .. (BlockX + Size) .. ", " .. (BlockZ + Size) .. + "} set to biome #" .. tostring(Biome) .. "." + ) + return true +end + + + + |