diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-02-18 23:13:44 +0100 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-02-18 23:13:44 +0100 |
commit | a686656253b9bd11238b2ae2210f809b49c355b9 (patch) | |
tree | 112663e0d7be31401232bd6e3f4f10852776639e /MCServer/Plugins/Debuggers | |
parent | Merge branch 'itemframes' of https://github.com/mc-server/MCServer into itemframes (diff) | |
parent | Merge pull request #696 from mc-server/paintings (diff) | |
download | cuberite-a686656253b9bd11238b2ae2210f809b49c355b9.tar cuberite-a686656253b9bd11238b2ae2210f809b49c355b9.tar.gz cuberite-a686656253b9bd11238b2ae2210f809b49c355b9.tar.bz2 cuberite-a686656253b9bd11238b2ae2210f809b49c355b9.tar.lz cuberite-a686656253b9bd11238b2ae2210f809b49c355b9.tar.xz cuberite-a686656253b9bd11238b2ae2210f809b49c355b9.tar.zst cuberite-a686656253b9bd11238b2ae2210f809b49c355b9.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 + + + + |