summaryrefslogtreecommitdiffstats
path: root/source/Protocol/Protocol125.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-10-21 10:01:59 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-10-21 10:01:59 +0200
commit9f60f83ea7118c47f0dd2f7355d5b0a56a0bd255 (patch)
tree9b4466b2f9255b297f6512ce49d1650dc688b193 /source/Protocol/Protocol125.cpp
parentAdded jukeboxes (patch contributed by Luksor) (diff)
downloadcuberite-9f60f83ea7118c47f0dd2f7355d5b0a56a0bd255.tar
cuberite-9f60f83ea7118c47f0dd2f7355d5b0a56a0bd255.tar.gz
cuberite-9f60f83ea7118c47f0dd2f7355d5b0a56a0bd255.tar.bz2
cuberite-9f60f83ea7118c47f0dd2f7355d5b0a56a0bd255.tar.lz
cuberite-9f60f83ea7118c47f0dd2f7355d5b0a56a0bd255.tar.xz
cuberite-9f60f83ea7118c47f0dd2f7355d5b0a56a0bd255.tar.zst
cuberite-9f60f83ea7118c47f0dd2f7355d5b0a56a0bd255.zip
Diffstat (limited to 'source/Protocol/Protocol125.cpp')
-rw-r--r--source/Protocol/Protocol125.cpp99
1 files changed, 50 insertions, 49 deletions
diff --git a/source/Protocol/Protocol125.cpp b/source/Protocol/Protocol125.cpp
index e92197a9b..44c97993d 100644
--- a/source/Protocol/Protocol125.cpp
+++ b/source/Protocol/Protocol125.cpp
@@ -46,7 +46,7 @@ enum
PACKET_BLOCK_DIG = 0x0e,
PACKET_BLOCK_PLACE = 0x0f,
PACKET_SLOT_SELECTED = 0x10,
- PACKET_USE_BED = 0x11, // TODO: Sure this is not Use Bed??
+ PACKET_USE_BED = 0x11,
PACKET_ANIMATION = 0x12,
PACKET_PACKET_ENTITY_ACTION = 0x13,
PACKET_PLAYER_SPAWN = 0x14,
@@ -137,6 +137,15 @@ void cProtocol125::SendBlockAction(int a_BlockX, int a_BlockY, int a_BlockZ, cha
+void cProtocol125::SendBlockBreakAnim(int a_entityID, int a_BlockX, int a_BlockY, int a_BlockZ, char stage)
+{
+ // Not supported in this protocol version
+}
+
+
+
+
+
void cProtocol125::SendBlockChange(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
{
cCSLock Lock(m_CSPacket);
@@ -418,6 +427,7 @@ void cProtocol125::SendKeepAlive(int a_PingID)
cCSLock Lock(m_CSPacket);
WriteByte(PACKET_KEEP_ALIVE);
WriteInt (a_PingID);
+ Flush();
}
@@ -602,15 +612,6 @@ void cProtocol125::SendSoundParticleEffect(int a_EffectID, int a_SrcX, int a_Src
-void cProtocol125::SendBlockBreakAnim(int a_entityID, int a_BlockX, int a_BlockY, int a_BlockZ, char stage)
-{
- // Not supported in this protocol version
-}
-
-
-
-
-
void cProtocol125::SendSpawnMob(const cMonster & a_Mob)
{
cCSLock Lock(m_CSPacket);
@@ -630,6 +631,29 @@ void cProtocol125::SendSpawnMob(const cMonster & a_Mob)
+void cProtocol125::SendSpawnObject(const cEntity & a_Entity, char a_ObjectType, int a_ObjectData, short a_SpeedX, short a_SpeedY, short a_SpeedZ)
+{
+ cCSLock Lock(m_CSPacket);
+ WriteByte(PACKET_SPAWN_OBJECT);
+ WriteInt (a_Entity.GetUniqueID());
+ WriteByte(a_ObjectType);
+ WriteInt ((int)(a_Entity.GetPosX() * 32));
+ WriteInt ((int)(a_Entity.GetPosY() * 32));
+ WriteInt ((int)(a_Entity.GetPosZ() * 32));
+ WriteInt (a_ObjectData);
+ if( a_ObjectData != 0 )
+ {
+ WriteShort( a_SpeedX );
+ WriteShort( a_SpeedY );
+ WriteShort( a_SpeedZ );
+ }
+ Flush();
+}
+
+
+
+
+
void cProtocol125::SendTeleportEntity(const cEntity & a_Entity)
{
cCSLock Lock(m_CSPacket);
@@ -704,6 +728,22 @@ void cProtocol125::SendUpdateSign(
+void cProtocol125::SendUseBed(const cEntity & a_Entity, int a_BlockX, int a_BlockY, int a_BlockZ )
+{
+ cCSLock Lock(m_CSPacket);
+ WriteByte(PACKET_USE_BED);
+ WriteInt (a_Entity.GetUniqueID());
+ WriteByte(0); // Unknown byte only 0 has been observed
+ WriteInt (a_BlockX);
+ WriteByte(a_BlockY);
+ WriteInt (a_BlockZ);
+ Flush();
+}
+
+
+
+
+
void cProtocol125::SendWeather(eWeather a_Weather)
{
cCSLock Lock(m_CSPacket);
@@ -788,45 +828,6 @@ void cProtocol125::SendWindowOpen(char a_WindowID, char a_WindowType, const AStr
-void cProtocol125::SendUseBed(const cEntity & a_Entity, int a_BlockX, int a_BlockY, int a_BlockZ )
-{
- cCSLock Lock(m_CSPacket);
- WriteByte(PACKET_USE_BED);
- WriteInt (a_Entity.GetUniqueID());
- WriteByte(0); // Unknown byte only 0 has been observed
- WriteInt (a_BlockX);
- WriteByte(a_BlockY);
- WriteInt (a_BlockZ);
- Flush();
-}
-
-
-
-
-
-void cProtocol125::SendSpawnObject(const cEntity & a_Entity, char a_ObjectType, int a_ObjectData, short a_SpeedX, short a_SpeedY, short a_SpeedZ)
-{
- cCSLock Lock(m_CSPacket);
- WriteByte(PACKET_SPAWN_OBJECT);
- WriteInt (a_Entity.GetUniqueID());
- WriteByte(a_ObjectType);
- WriteInt ((int)(a_Entity.GetPosX() * 32));
- WriteInt ((int)(a_Entity.GetPosY() * 32));
- WriteInt ((int)(a_Entity.GetPosZ() * 32));
- WriteInt (a_ObjectData);
- if( a_ObjectData != 0 )
- {
- WriteShort( a_SpeedX );
- WriteShort( a_SpeedY );
- WriteShort( a_SpeedZ );
- }
- Flush();
-}
-
-
-
-
-
AString cProtocol125::GetAuthServerID(void)
{
// http://wiki.vg/wiki/index.php?title=Session&oldid=2262