1
0
cuberite-2a/MCServer/Plugins/Core/regeneratechunk.lua
madmaxoft@gmail.com 019c8b5bc7 Moved command API into cPluginManager.
As specified in http://forum.mc-server.org/showthread.php?tid=765 , commands are now bound using a single function, cPluginManager:BindCommand().

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1183 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-02-01 19:55:42 +00:00

18 lines
502 B
Lua

function HandleRegenerateChunkCommand(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