summaryrefslogtreecommitdiffstats
path: root/source/cServer.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-04-10 13:22:11 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-04-10 13:22:11 +0200
commitc51a4b9469fee0314d1b849206d1cf1c7c1240e4 (patch)
tree655d6a392b5483eea1453a08c24e269f8ae68d09 /source/cServer.cpp
parentCompression error -5 fix (diff)
downloadcuberite-c51a4b9469fee0314d1b849206d1cf1c7c1240e4.tar
cuberite-c51a4b9469fee0314d1b849206d1cf1c7c1240e4.tar.gz
cuberite-c51a4b9469fee0314d1b849206d1cf1c7c1240e4.tar.bz2
cuberite-c51a4b9469fee0314d1b849206d1cf1c7c1240e4.tar.lz
cuberite-c51a4b9469fee0314d1b849206d1cf1c7c1240e4.tar.xz
cuberite-c51a4b9469fee0314d1b849206d1cf1c7c1240e4.tar.zst
cuberite-c51a4b9469fee0314d1b849206d1cf1c7c1240e4.zip
Diffstat (limited to 'source/cServer.cpp')
-rw-r--r--source/cServer.cpp29
1 files changed, 28 insertions, 1 deletions
diff --git a/source/cServer.cpp b/source/cServer.cpp
index 23fcbdda0..eff4e9fc0 100644
--- a/source/cServer.cpp
+++ b/source/cServer.cpp
@@ -485,13 +485,40 @@ bool cServer::Command( cClientHandle & a_Client, const char* a_Cmd )
{
if (split.size() != 2)
{
- a_Client.Send(cPacket_Chat(cChatColor::Green + "Invalid syntax, expected 1 parameter, the numebr of chunks to stream"));
+ a_Client.Send(cPacket_Chat(cChatColor::Green + "Invalid syntax, expected 1 parameter, the number of chunks to stream"));
return false;
}
int dist = atol(split[1].c_str());
a_Client.SetViewDistance(dist);
return true;
}
+
+ if (split[0].compare("/regeneratechunk") == 0)
+ {
+ int ChunkX, ChunkZ;
+ if (split.size() == 1)
+ {
+ // Regenerate current chunk
+ ChunkX = a_Client.GetPlayer()->GetChunkX();
+ ChunkZ = a_Client.GetPlayer()->GetChunkZ();
+ }
+ else if (split.size() == 3)
+ {
+ // Regenerate chunk in params
+ ChunkX = atoi(split[1].c_str());
+ ChunkZ = atoi(split[2].c_str());
+ }
+ else
+ {
+ a_Client.Send(cPacket_Chat(cChatColor::Green + "Invalid syntax, expected either 0 (current chunk) or 2 (x, z) parameters"));
+ return false;
+ }
+ AString Msg;
+ Printf(Msg, "Regenerating chunk [%d, %d]", ChunkX, ChunkZ);
+ a_Client.Send(cPacket_Chat(cChatColor::Green + Msg));
+ a_Client.GetPlayer()->GetWorld()->RegenerateChunk(ChunkX, ChunkZ);
+ return true;
+ }
return false;
}