aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/RotateHeadPacket.cpp
diff options
context:
space:
mode:
authordaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
committerdaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
commitb691c43c44ff180d10e7d4a9afc83b98551ff586 (patch)
tree3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.World/RotateHeadPacket.cpp
parentdef8cb415354ac390b7e89052a50605285f1aca9 (diff)
Initial commit
Diffstat (limited to 'Minecraft.World/RotateHeadPacket.cpp')
-rw-r--r--Minecraft.World/RotateHeadPacket.cpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/Minecraft.World/RotateHeadPacket.cpp b/Minecraft.World/RotateHeadPacket.cpp
new file mode 100644
index 00000000..a0cd02d7
--- /dev/null
+++ b/Minecraft.World/RotateHeadPacket.cpp
@@ -0,0 +1,51 @@
+#include "stdafx.h"
+
+#include "RotateHeadPacket.h"
+
+RotateHeadPacket::RotateHeadPacket()
+{
+}
+
+RotateHeadPacket::RotateHeadPacket(int id, char yHeadRot)
+{
+ this->id = id;
+ this->yHeadRot = yHeadRot;
+}
+
+void RotateHeadPacket::read(DataInputStream *dis)
+{
+ id = dis->readInt();
+ yHeadRot = dis->readByte();
+}
+
+void RotateHeadPacket::write(DataOutputStream *dos)
+{
+ dos->writeInt(id);
+ dos->writeByte(yHeadRot);
+}
+
+void RotateHeadPacket::handle(PacketListener *listener)
+{
+ listener->handleRotateMob(shared_from_this());
+}
+
+int RotateHeadPacket::getEstimatedSize()
+{
+ return 5;
+}
+
+bool RotateHeadPacket::canBeInvalidated()
+{
+ return true;
+}
+
+bool RotateHeadPacket::isInvalidatedBy(shared_ptr<Packet> packet)
+{
+ shared_ptr<RotateHeadPacket> target = dynamic_pointer_cast<RotateHeadPacket>(packet);
+ return target->id == id;
+}
+
+bool RotateHeadPacket::isAync()
+{
+ return true;
+} \ No newline at end of file