* By default, the entity is evaluated and the right packet is created automatically.
*
* @return spawn packet
*/
public CommonPacket getSpawnPacket() {
final CommonPacket packet = EntityTrackerEntryRef.getSpawnPacket(handle);
if (PacketType.OUT_ENTITY_SPAWN.isInstance(packet)) {
// NMS error: They are not using the position, but the live position
// This has some big issues when new players join...
// Position
packet.write(PacketType.OUT_ENTITY_SPAWN.x, locSynched.getX());
packet.write(PacketType.OUT_ENTITY_SPAWN.y, locSynched.getY());
packet.write(PacketType.OUT_ENTITY_SPAWN.z, locSynched.getZ());
// Rotation
packet.write(PacketType.OUT_ENTITY_SPAWN.yaw, (byte) locSynched.getYaw());
packet.write(PacketType.OUT_ENTITY_SPAWN.pitch, (byte) locSynched.getPitch());
}
return packet;
}