summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/Core/regen.lua
diff options
context:
space:
mode:
Diffstat (limited to 'MCServer/Plugins/Core/regen.lua')
-rw-r--r--MCServer/Plugins/Core/regen.lua18
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