MCPcopy Create free account
hub / github.com/cuberite/cuberite / SendSpawnObject

Method SendSpawnObject

src/Protocol/Protocol14x.cpp:216–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214
215
216void cProtocol146::SendSpawnObject(const cEntity & a_Entity, char a_ObjectType, int a_ObjectData, Byte a_Yaw, Byte a_Pitch)
217{
218 cCSLock Lock(m_CSPacket);
219 WriteByte(PACKET_SPAWN_OBJECT);
220 WriteInt (a_Entity.GetUniqueID());
221 WriteChar(a_ObjectType);
222 WriteInt ((int)(a_Entity.GetPosX() * 32));
223 WriteInt ((int)(a_Entity.GetPosY() * 32));
224 WriteInt ((int)(a_Entity.GetPosZ() * 32));
225 WriteByte(a_Pitch);
226 WriteByte(a_Yaw);
227 WriteInt (a_ObjectData);
228 if (a_ObjectData != 0)
229 {
230 WriteShort((short)(a_Entity.GetSpeedX() * 400));
231 WriteShort((short)(a_Entity.GetSpeedY() * 400));
232 WriteShort((short)(a_Entity.GetSpeedZ() * 400));
233 }
234 Flush();
235}
236
237
238

Callers 5

SpawnOnMethod · 0.45
SpawnOnMethod · 0.45
SpawnOnMethod · 0.45
SpawnOnMethod · 0.45
SpawnOnMethod · 0.45

Calls 7

GetSpeedXMethod · 0.80
GetSpeedYMethod · 0.80
GetSpeedZMethod · 0.80
GetUniqueIDMethod · 0.45
GetPosXMethod · 0.45
GetPosYMethod · 0.45
GetPosZMethod · 0.45

Tested by

no test coverage detected