summaryrefslogtreecommitdiffstats
path: root/source/cClientHandle.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-25 23:46:18 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-25 23:46:18 +0200
commit7157ebc061b496d84c685070107045e8440a6ef0 (patch)
tree46ae305d432f61b0fef5363b49ea534bcafdab10 /source/cClientHandle.cpp
parentRemoved cPackets from cChunk. (diff)
downloadcuberite-7157ebc061b496d84c685070107045e8440a6ef0.tar
cuberite-7157ebc061b496d84c685070107045e8440a6ef0.tar.gz
cuberite-7157ebc061b496d84c685070107045e8440a6ef0.tar.bz2
cuberite-7157ebc061b496d84c685070107045e8440a6ef0.tar.lz
cuberite-7157ebc061b496d84c685070107045e8440a6ef0.tar.xz
cuberite-7157ebc061b496d84c685070107045e8440a6ef0.tar.zst
cuberite-7157ebc061b496d84c685070107045e8440a6ef0.zip
Diffstat (limited to '')
-rw-r--r--source/cClientHandle.cpp58
1 files changed, 58 insertions, 0 deletions
diff --git a/source/cClientHandle.cpp b/source/cClientHandle.cpp
index a0ec88f80..206ad9acd 100644
--- a/source/cClientHandle.cpp
+++ b/source/cClientHandle.cpp
@@ -74,6 +74,7 @@
#include "packets/cPacket_Respawn.h"
#include "packets/cPacket_SpawnMob.h"
#include "packets/cPacket_TeleportEntity.h"
+#include "packets/cPacket_Thunderbolt.h"
#include "packets/cPacket_TimeUpdate.h"
#include "packets/cPacket_UpdateHealth.h"
#include "packets/cPacket_UpdateSign.h"
@@ -1969,6 +1970,63 @@ void cClientHandle::SendUnloadChunk(int a_ChunkX, int a_ChunkZ)
+void cClientHandle::SendWeather(eWeather a_Weather)
+{
+ switch( a_Weather )
+ {
+ case eWeather_Sunny:
+ {
+ cPacket_NewInvalidState WeatherPacket;
+ WeatherPacket.m_Reason = 2; // stop rain
+ Send(WeatherPacket);
+ break;
+ }
+
+ case eWeather_Rain:
+ {
+ cPacket_NewInvalidState WeatherPacket;
+ WeatherPacket.m_Reason = 1; // begin rain
+ Send(WeatherPacket);
+ break;
+ }
+
+ case eWeather_ThunderStorm:
+ {
+ cPacket_NewInvalidState WeatherPacket;
+ WeatherPacket.m_Reason = 1; // begin rain
+ Send(WeatherPacket);
+ break;
+ }
+ }
+}
+
+
+
+
+
+void cClientHandle::SendTimeUpdate(Int64 a_WorldTime)
+{
+ cPacket_TimeUpdate tu;
+ tu.m_Time = a_WorldTime;
+ Send(tu);
+}
+
+
+
+
+
+void cClientHandle::SendThunderbolt(int a_BlockX, int a_BlockY, int a_BlockZ)
+{
+ cPacket_Thunderbolt ThunderboltPacket;
+ ThunderboltPacket.m_xLBPos = a_BlockX;
+ ThunderboltPacket.m_yLBPos = a_BlockY;
+ ThunderboltPacket.m_zLBPos = a_BlockZ;
+}
+
+
+
+
+
void cClientHandle::CheckIfWorldDownloaded(void)
{
if (m_State != csDownloadingWorld)