コード例 #1
0
ファイル: Protocol14x.cpp プロジェクト: Jothle12/MCServer
void cProtocol146::SendSpawnFallingBlock(const cFallingBlock & a_FallingBlock)
{
	// Send a spawn object / vehicle packet
	cCSLock Lock(m_CSPacket);

	WriteByte(PACKET_SPAWN_OBJECT);
	WriteInt (a_FallingBlock.GetUniqueID());
	WriteByte(70);
	WriteInt ((int)(a_FallingBlock.GetPosX() * 32));
	WriteInt ((int)(a_FallingBlock.GetPosY() * 32));
	WriteInt ((int)(a_FallingBlock.GetPosZ() * 32));
	WriteByte (0);  // Pitch
	WriteByte (0);  // Yaw
	WriteInt (a_FallingBlock.GetBlockType());  // data indicator = blocktype
	WriteShort((short)(a_FallingBlock.GetSpeedX() * 400));
	WriteShort((short)(a_FallingBlock.GetSpeedY() * 400));
	WriteShort((short)(a_FallingBlock.GetSpeedZ() * 400));
	Flush();
}
コード例 #2
0
ファイル: Protocol125.cpp プロジェクト: FX-Master/MCServer
void cProtocol125::SendSpawnFallingBlock(const cFallingBlock & a_FallingBlock)
{
	// This protocol version implements falling blocks using the spawn object / vehicle packet:
	SendSpawnObject(a_FallingBlock, 70, a_FallingBlock.GetBlockType(), 0, 0);
}