int shouldBeMountedId = buffer.readInt();
if (this.riddenByEntity == null)
{
if (shouldBeMountedId > -1)
{
Entity e = FMLClientHandler.instance().getWorldClient().getEntityByID(shouldBeMountedId);
if (e != null)
{
if (e.dimension != this.dimension)
{
if (e instanceof EntityPlayer)
{
e = WorldUtil.forceRespawnClient(this.dimension, e.worldObj.difficultySetting.getDifficultyId(), e.worldObj.getWorldInfo().getTerrainType().getWorldTypeName(), ((EntityPlayerMP)e).theItemInWorldManager.getGameType().getID());
e.mountEntity(this);
}
}
else
e.mountEntity(this);
}
}
}
else if (this.riddenByEntity.getEntityId() != shouldBeMountedId)
{
if (shouldBeMountedId == -1)
{
this.riddenByEntity.mountEntity(null);
}
else
{
Entity e = FMLClientHandler.instance().getWorldClient().getEntityByID(shouldBeMountedId);
if (e != null)
{
if (e.dimension != this.dimension)
{
if (e instanceof EntityPlayer)
{
e = WorldUtil.forceRespawnClient(this.dimension, e.worldObj.difficultySetting.getDifficultyId(), e.worldObj.getWorldInfo().getTerrainType().getWorldTypeName(), ((EntityPlayerMP)e).theItemInWorldManager.getGameType().getID());
e.mountEntity(this);
}
}
else
e.mountEntity(this);
}
}
}
}
else
{
this.shouldMoveClient = buffer.readBoolean();
}
}
catch (final Exception e)
{
e.printStackTrace();
}
}