diff options
author | bearbin <bearbin@gmail.com> | 2013-07-27 18:19:22 +0200 |
---|---|---|
committer | bearbin <bearbin@gmail.com> | 2013-07-27 18:19:22 +0200 |
commit | 1d0b57d8abf2297614659e1115b81d569612a402 (patch) | |
tree | df7d0acb85b3ef5c4783f721a83908ddc5130ef7 /MCServer/Plugins/Core/regen.lua | |
parent | Merge pull request #7 from tigerw/master (diff) | |
parent | Merge pull request #8 from mc-server/master (diff) | |
download | cuberite-1d0b57d8abf2297614659e1115b81d569612a402.tar cuberite-1d0b57d8abf2297614659e1115b81d569612a402.tar.gz cuberite-1d0b57d8abf2297614659e1115b81d569612a402.tar.bz2 cuberite-1d0b57d8abf2297614659e1115b81d569612a402.tar.lz cuberite-1d0b57d8abf2297614659e1115b81d569612a402.tar.xz cuberite-1d0b57d8abf2297614659e1115b81d569612a402.tar.zst cuberite-1d0b57d8abf2297614659e1115b81d569612a402.zip |
Diffstat (limited to 'MCServer/Plugins/Core/regen.lua')
-rw-r--r-- | MCServer/Plugins/Core/regen.lua | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/MCServer/Plugins/Core/regen.lua b/MCServer/Plugins/Core/regen.lua new file mode 100644 index 000000000..f1dd4e118 --- /dev/null +++ b/MCServer/Plugins/Core/regen.lua @@ -0,0 +1,18 @@ +function HandleRegenCommand(Split, Player) + if ((#Split == 2) or (#Split > 3)) then + Player:SendMessage( cChatColor.Green .. "Usage: '/regeneratechunk' or '/regeneratechunk [X] [Z]'"); + return true; + end + + local X = Player:GetChunkX(); + local Z = Player:GetChunkZ(); + + if (#Split == 3) then + X = Split[2]; + Z = Split[3]; + end + + Player:SendMessage(cChatColor.Green .. "Regenerating chunk ["..X..", "..Z.."]"); + Player:GetWorld():RegenerateChunk(X, Z); + return true; +end
\ No newline at end of file |