the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#include "stdafx.h"
2#include <iostream>
3#include "InputOutputStream.h"
4#include "PacketListener.h"
5#include "SetTimePacket.h"
6
7SetTimePacket::SetTimePacket()
8{
9 gameTime = 0;
10 dayTime = 0;
11}
12
13SetTimePacket::SetTimePacket(__int64 gameTime, __int64 dayTime, bool tickDayTime)
14{
15 this->gameTime = gameTime;
16 this->dayTime = dayTime;
17
18 // 4J: We send daylight cycle rule with host options so don't need this
19 /*if (!tickDayTime)
20 {
21 this->dayTime = -this->dayTime;
22 if (this->dayTime == 0)
23 {
24 this->dayTime = -1;
25 }
26 }*/
27}
28
29void SetTimePacket::read(DataInputStream *dis) //throws IOException
30{
31 gameTime = dis->readLong();
32 dayTime = dis->readLong();
33}
34
35void SetTimePacket::write(DataOutputStream *dos) //throws IOException
36{
37 dos->writeLong(gameTime);
38 dos->writeLong(dayTime);
39}
40
41void SetTimePacket::handle(PacketListener *listener)
42{
43 listener->handleSetTime(shared_from_this());
44}
45
46int SetTimePacket::getEstimatedSize()
47{
48 return 16;
49}
50
51bool SetTimePacket::canBeInvalidated()
52{
53 return true;
54}
55
56bool SetTimePacket::isInvalidatedBy(shared_ptr<Packet> packet)
57{
58 return true;
59}
60
61bool SetTimePacket::isAync()
62{
63 return true;
64}